jlb4350
Jul 19, 2022Cirrus
Help tweaking my iRule
Hello all. I have an oubound virtual server that allows all traffic and protocols to any address, it's a wildcard outbound. I'm wanting to use an iRule to block outbound connections to Russia using data referenced in a data group. I created the following data group and iRule, but it ended up blocking everything when I attached it to my wildcard outbound VS. Are there any iRule gurus could can help me tweak this? Any help is much appreciated!
Data group:
iRule:
The iRule is slightly wrong in that it is trying to pull out a value of RU and then matching the IP address to the value which would never happen. I would use the framework set in the support article and do something like this:
when SERVER_CONNECTED { set ipaddr [IP::remote_addr] set fromCountry [whereis $ipaddr country] if { [class match $fromCountry equals GeoIPOutboundBlockRussia] } { log local0. "Attacker IP [IP::client_addr]" ;# This can be removed/commented out if not required drop } }