Collect and pass on variables from client device
Hi,
I have a VIP with a redirect which is pointing to a captive portal, that works fine.
The issue I am having is I need the traffic to collect variables such source Mac address, originating IP added onto a link for example:
portal/step1.html?MACAddr=XX%XXX%XXX%XXXX%XXX%XXXX&IPAddr=123.123.123.123&OrigURL=http%3A%2F%2Fwww.msftconnecttest.com%2Fredirect
Is this possible from the F5?
We would need the client device to point to the VIP then hit the redirect with the variables attached?
If I add the url like this:
www.example.com/portal/step1.html?MACAddr=$SUB&IPAddr=$IP&OrigURL=$URL it wont work.
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.