Forum Discussion

Olowndez's avatar
Olowndez
Icon for Nimbostratus rankNimbostratus
Sep 28, 2020

iRule error elseif undefined procedure

Hello guys: I am trying to configure an iRule that performs load balancing based on the client IP. I need to load balance based on entire networks and based on some specific IP address. Those entire...
  • Andrew-F5's avatar
    Sep 29, 2020

    What software version are you running? I wasn't able to reproduce the issue in v14.1.2.7.

    I imagine you're running into something like what's described in this other DevCentral post.

    You can try restructuring your iRule as follows to see if the error goes away:

    when CLIENT_ACCEPTED {
    	if { [class match [IP::client_addr] equals My_NETS] } {
    		pool pool_A
    		snatpool snat_pool_A
    	}	elseif { [IP::addr [IP::client_addr] equals 172.17.0.20] } {
    		pool pool_B
    		snatpool snat_pool_B
    	}	elseif { [IP::addr [IP::client_addr]  equals 192.168.20.10] } {
    		pool pool_C
    		snatpool snat_pool_C
    	}
    }