Forum Discussion
insert HTTP header according to a value received in Radius accounting
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-IP-Address & Acct-Status-Type
In case the Radius attribute Acct-Status-Type=1 (Start) the BIGIP will insert an entry to a table in which the key will be the Framed-IP-Address and the value will be the Calling-Station-Id.
In case the Radius attribute Acct-Status-Type=2 (Stop) the BIGIP will remove the value of an entry in the same table (remove the value which is the calling-station-id assigned to the framed-ip-address)
Then when HTTP transaction arrive from a client IP which appears as a key in the table, the BIGIP will insert the value assigned to that key in the table (i.e. the corresponding Calling-Station-Id) to an HTTP header called "MSISDN".
Example:
Radius accounting arrives with following attributes:
Acct-Status-Type=1
Calling-Station-Id=123456789
Framed-IP-Address=1.1.1.1
An entry is inserted to a table
1.1.1.1 (key) -> 123456789 (value)
HTTP request arrives from source IP 1.1.1.1
The F5 will insert a header "MSISDN: 123456789" to the HTTP request before forwarding.
Radius accounting arrives with following attributes:
Acct-Status-Type=2
Calling-Station-Id=123456789
Framed-IP-Address=1.1.1.1
The value is removed
1.1.1.1 (key) -> (empty)
HTTP request arrives from source IP 1.1.1.1
The F5 will not insert a header (not "MSISDN: 123456789" and not "MSISDN: ")
Hope it's clear.
Thanks in advance,
Yaniv
- hooleylistCirrostratusHi Yaniv,
- Yaniv_99962NimbostratusThanks Aaron,
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] } }
when HTTP_REQUEST { HTTP::header insert MSISDN [table lookup -subtable "ip2msisdn" [IP::client_addr]] forward }
- Colin_Walker_12Historic F5 AccountSince your code got munged by the forums (grumble grumble, we're working on it..sorry), I'll just mention that you should likely make sure you're specifically setting timeout and lifetime on this type of table entry, since it sounds like you don't want them randomly disappearing on you if you're using them to keep a count of starts/stops.
- Yaniv_99962NimbostratusRight,
- Yaniv_99962NimbostratusHi experts,
- Colin_Walker_12Historic F5 AccountWhile this should be technically doable, it's going to be a bit of a juggling act. ;)
- Yaniv_99962NimbostratusColin,
- Colin_Walker_12Historic F5 AccountI can't give any specific timelines as to when that sort of functionality will be available, unfortunately, but keep an eye out for release notes when new versions come out, and make sure to keep checking back here as we'll definitely make a big fuss on DevCentral about it. ;)
- Yaniv_99962NimbostratusThanks a lot Colin.
- Colin_Walker_12Historic F5 AccountI'm glad to hear you're enjoying the BIG-IPs and looking to make better use of them. That's awesome. :)
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