Forum Discussion

Ken_50869's avatar
Ken_50869
Icon for Nimbostratus rankNimbostratus
Aug 14, 2007

Compress content by IP

Hello,

 

 

I've created the following iRULE to compress content based on the client's source IP address. However, as soon as I apply the iRULE to the virtual server, client's are no longer able to reach the application. Can anyone verify that my syntax is correct, or if anything else could be wrong?

 

 

Thanks in advance...

 

 

 

when HTTP_RESPONSE {

 

if {[IP::client_addr] eq "192.168.10.0/255.255.255.0"} {

 

COMPRESS::enable}

 

elseif {[IP::client_addr] eq "192.168.20.0/255.255.255.0" } {

 

COMPRESS::enable}

 

else {

 

COMPRESS::disable}

 

 

}

2 Replies

  • You can check the /var/log/ltm log file for TCL errors generated from your iRule. It's also viewable in the GUI under system >> logs >> local traffic.

    You can use the IP::addr command (Click here) to compare IP addresses.

    Here's an example:

    
    if {[IP::addr [IP::client_addr]/24 equals 192.168.10.0] \
       or [IP::addr [IP::client_addr]/24 equals 192.168.20.0]}{
       log local0. "matched for [IP::client_addr]"
       COMPRESS::enable
    } else {
       log local0. "didn't match for [IP::client_addr]"
       COMPRESS::disable
    }

    Aaron
  • Outstanding!

     

     

    The new rule that you posted worked. After applying it to the virtual server, the application works.

     

     

    Thank you very much for your help.