addr
1 TopicMultiple Switch statements in a single iRule
Hi there, I have several ranges of addresses which I want to see if traffic is coming from and deny traffic. Say the ranges are as follows as an example: 10.11.0.0/16 10.12.0.0/16 10.13.13.0/22 10.14.14.0/22 10.23.23.0/24 10.24.24.0/24 I am wondering if I can have multiple switch statements in the CLIENT_ACCEPTED section of code such as (obviously some default statement would need to be added somewhere along the line or an overarching check to bypass this lookup if it is not required): when CLIENT_ACCEPTED { switch -glob [IP::addr [IP::client_addr]/16] { "10.11.0.0" { some action } "10.12.0.0" { some action } } switch -glob [IP::addr [IP::client_addr]/22] { switch -glob [IP::addr [IP::client_addr]/22] { "10.13.13.0" { some action } "10.14.14.0" { some action } } switch -glob [IP::addr [IP::client_addr]/24] { switch -glob [IP::addr [IP::client_addr]/22] { "10.23.23.0" { some action } "10.24.24.0" { some action } } }Solved899Views0likes9Comments