Forum Discussion
Yaniv_99962
Jul 03, 2011Nimbostratus
insert HTTP header according to a value received in Radius accounting
Hi, I'd like to know if the following is somehow achievable: I want that from Every Radius Accounting message (UDP 1813) the BIGIP will look for 3 attributes: Calling-Station-Id, Framed-...
Yaniv_99962
Jul 07, 2011Nimbostratus
Thanks Aaron,
I made it working.
I created an iRule under the Radius accounting Virtual Server (UDP 1813) so that for every Radius Start (Acct-Status-Type[40]=1) the F5 will write an entry to a memory table called “ip2msisdn” using the subscriber IP as the key (Framed-IP-Address[8]) and the subscriber MSISDN as value (Calling-Station-Id[31]). For every Radius Stop (Acct-Status-Type[40]=2) the F5 will delete the value assigned to the key.
when CLIENT_DATA {
if { [RADIUS::avp 40 integer] equals 1}{
table set -subtable "ip2msisdn" [RADIUS::avp 8 ip4] [RADIUS::avp 31 string]
}
elseif { [RADIUS::avp 40 integer] equals 2}{
table delete -subtable "ip2msisdn" [RADIUS::avp 8 ip4]
}
}
I created an iRule under the HTTP Virtual Server (TCP 80) so that for every HTTP request it will look at the source IP of the packet and use it to lookup in the “ip2msisdn” table to get the MSISDN of that subscriber and insert it into an HTTP header called MSISDN.
when HTTP_REQUEST {
HTTP::header insert MSISDN [table lookup -subtable "ip2msisdn" [IP::client_addr]]
forward
}
Thanks a lot
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects