Forum Discussion
Collect and pass on variables from client device
- Jan 24, 2020
No, I meant to redirect with the information at the end.
Try this:
when HTTP_REQUEST priority 400 { set mac [LINK::lasthop] set ip [IP::client_addr] set url [HTTP::uri] switch -glob -- [string tolower [HTTP::host]] { "123.45.67.890" { HTTP::redirect "https://example.com/portal/step1.html?MACAddr=$mac&IPAddr=$ip&OrigURL=$url" } } }
Forgot to say...
Don't forget the mac address you will get is the last device mac address.
If the client is not in the same network as the F5, it is not going to be the client mac address.
No, I meant to redirect with the information at the end.
Try this:
when HTTP_REQUEST priority 400 {
set mac [LINK::lasthop]
set ip [IP::client_addr]
set url [HTTP::uri]
switch -glob -- [string tolower [HTTP::host]] {
"123.45.67.890" { HTTP::redirect "https://example.com/portal/step1.html?MACAddr=$mac&IPAddr=$ip&OrigURL=$url" }
}
}
Forgot to say...
Don't forget the mac address you will get is the last device mac address.
If the client is not in the same network as the F5, it is not going to be the client mac address.
Hi Leonardo,
Thank you so much for getting back to me, this has resolved the issue!
I couldn't see it before but thanks to you these Irules are starting to make more sense.
No all heroes wear capes!
Thank you again!
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com