Forum Discussion
How do I record the IP assigned to a client after login?
- Apr 16, 2015
The VPN address is assigned after the APM policy is completed. Use an iRule to detect the VPN startup URI and then wait a few seconds before querying session.assigned.clientip.
when CLIENT_ACCEPTED { ACCESS::restrict_irule_events disable } when HTTP_REQUEST { if { [HTTP::uri] starts_with "/myvpn?sess=" } { after 5000 { log local0. "VPN started for [ACCESS::session data get session.logon.last.username] from IP [IP::client_addr] assigned client IP [ACCESS::session data get session.assigned.clientip]"} } }
The VPN address is assigned after the APM policy is completed. Use an iRule to detect the VPN startup URI and then wait a few seconds before querying session.assigned.clientip.
when CLIENT_ACCEPTED {
ACCESS::restrict_irule_events disable
}
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/myvpn?sess=" } {
after 5000 { log local0. "VPN started for [ACCESS::session data get session.logon.last.username] from IP [IP::client_addr] assigned client IP [ACCESS::session data get session.assigned.clientip]"}
}
}
- Will_33786Apr 20, 2015NimbostratusHi John. Your solution works! It's exactly what I want. You just gave me a big help. Thank you!
- John_Alam_45640Apr 20, 2015Historic F5 AccountGlad it worked for you.
- DevBabuJul 23, 2018Cirrus
Has the URI changed in version 12.1.3.4. I am running 12.1.3.4 and couldn't catch that URI /myvpn?sess=.
When i did URI logging and saw URI /isession?sess= and I could get the session.assigned.clientip.
So, my rule looks like:
when CLIENT_ACCEPTED { ACCESS::restrict_irule_events disable } when HTTP_REQUEST { if { [HTTP::uri] starts_with "/isession?sess=" } { after 5000 { log local0. "VPN started for [ACCESS::session data get session.logon.last.username] from IP [IP::client_addr] assigned client IP [ACCESS::session data get session.assigned.clientip]"} } }
- FabNov 30, 2023Altostratus
Hello,
It seems that now (at least 15.1.8) the URI has changed. I think /vdesk/resource_all_info.eui?resourcename=/Common/*******&resourcetype=network_access works.
I have an issue with the "after" command though.
It works with a value of 10 for instance, but with 1000 (or 5000) the "log local0." command is not triggered. Do you know why by any chance?
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