Forum Discussion

statmp_87631's avatar
statmp_87631
Icon for Nimbostratus rankNimbostratus
Dec 19, 2011

iRules with subnet failed.

Hi,I met a problem with iRules recently, below is our iRules:

 

 

 

if { [IP::addr [IP::remote_addr] equals 221.177.152.0/26] } {

 

 

 

pool CMNET }

 

 

 

else { pool CMWAP_ OTHER }}

 

 

 

if the DNS query client with IP address 221.177.152.33 send a DNS message, f5 will answer with pool CMWAP_OTHER.

 

 

 

 

 

and if we change the iRules to below, the answer will be correct with pool CMNET.

 

if { [IP::addr [IP::remote_addr] equals 221.177.152.33/32] } {

 

pool CMNET }

 

else {

 

pool CMWAP_ OTHER

 

}

 

}

 

 

 

so , what's the difference between a host and a subnet int iRules?

 

thanks

 

 

 

 

 

 

  • very strange, this format will work fine:

     

    if { [IP::addr [IP::remote_addr]/26 equals 221.177.152.0] }
  • what version are you on? That doesn't look right at all. BTW, the comparison should be last for the most efficient operation, though in your case, it doesn't appear to be working. Here's an article I wrote on the various methods for comparing IP addresses:

     

     

    Click Here

     

     

  • my version: BIGIP-10.2.1.297.0.iso

     

    I don't think this is a good methord to compare also, but it is the only way can work.

     

    and after I read your article then change to this statement.