Forum Discussion
Rise_77519
Nov 30, 2011Nimbostratus
irule with diameter result code
Hi ,
I need an irule for diameter service that is based on resuld codes in AVP 286 code.AVP 286 code also includes some result codes (exmp. 2001 DIAMEMETER_SUCCESS) . I would like to take an action(allow or drop) based on these result codes when server respond to clients.I have seen some basic irule example about the AVR code and also look at http://www.f5.com/pdf/deployment-guides/diameter-load-balancing-dg.pdf but it is not related to these result codes.Need help from someone who have configured Diameter protocol by using Result Code.
- nitassEmployeewhat version are you running? is it v10 or v11?
- Rise_77519NimbostratusI am using version 10.2.
- Rise_77519NimbostratusI am using version 10.2.
- nitassEmployeenot sure if this is helpful?
[root@ve1023:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.19.79:3868 ip protocol 6 rules myrule2 profiles { diameter {} mblb {} tcp {} } } [root@ve1023:Active] config b pool foo list pool foo { members 200.200.200.101:3868 {} } [root@ve1023:Active] config b rule myrule2 list rule myrule2 { when SERVER_CONNECTED { TCP::collect } when SERVER_DATA { while {[TCP::payload length] > 20} { binary scan [TCP::payload] II a b set comcode [expr {$b & 0xffffff}] set mlen [expr {$a & 0xffffff}] set rflag [expr {($b >> 31)&1}] if {!($rflag)} { switch $comcode { 280 - 282 {} default { set index 20 while {$index < $mlen} { binary scan [TCP::payload $mlen] @${index}II avp_code avp_len set avp_len [expr {$avp_len & 0xffffff}] set avp_len_pad [expr {(($avp_len + 3)/4)*4}] if {$avp_code == 268} { set avp_dlen [expr {$avp_len - 8}] binary scan [TCP::payload $mlen] @[expr {$index + 8}]I result break } incr index $avp_len_pad } } } switch $result { 2001 { log local0. "2001" } default { log local0. "others" } } } TCP::release $mlen } TCP::collect } } [root@ve1023:Active] config tail /var/log/ltm Nov 30 10:52:27 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:27 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:28 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:29 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:30 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:31 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:32 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:33 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:34 local/tmm info tmm[23027]: Rule myrule2 : 2001 Nov 30 10:52:35 local/tmm info tmm[23027]: Rule myrule2 : 2001
- Rise_77519NimbostratusHi Nitass,
- hooleylistCirrostratusThe forum code parser converts "&" to "& amp ;". Can you replace the "& amp ;" instances with &.
- Rise_77519NimbostratusHi,
- nitassEmployeeI have seen a messages it was responded by Nitass who said that " i have not found command to silently drop CCA message." this mean this irule could not drop result code 5012 .if you do not mind to drop or reject tcp connection (not a message), you can use drop or reject command.
- Nat_ThirasuttakornEmployeeto silently drop any TCP data in iRule, you can use the following simple technique
- Rise_77519NimbostratusHi Nitass,
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