Forum Discussion

Greg_Ryan_33844's avatar
Greg_Ryan_33844
Icon for Nimbostratus rankNimbostratus
Jan 25, 2013

Stream::Enable irule executing when it shouldn't

Hi, I have an irule that we implemented that is executing correctly for the if statement. However it's also executing half the time when it shouldn't be. Within the Lifelink_CBD_ClientNets class I have "10.33. 10.20. 192.168.". When I connect from any ip that starts with those the irule works 100% of the time. However, when I connect with a different IP it still executes sometimes.

 

I have put in logging into the IF statement to grab the IP, and when I come from an IP that isn't in the CBD_ClientNets then it doesn't log, but it makes the change. I am completely stumped

 

 

Below is the irule:

 

 

Prevents server compression in responses

 

when HTTP_REQUEST {

 

 

Disable the stream filter for all requests

 

STREAM::disable

 

 

LTM does not uncompress response content, so if the server has compression enabled

 

and it cannot be disabled on the server, we can prevent the server from

 

sending a compressed response by removing the compression offerings from the client

 

HTTP::header remove "Accept-Encoding"

 

 

}

 

when HTTP_RESPONSE {

 

 

 

If Client is from CBD then we do the rewrites

 

if { [matchclass [IP::client_addr] starts_with $::Lifelink_CBD_ClientNets] } {

 

 

Check if response type is text

 

if {[HTTP::header value Content-Type] contains "text"}{

 

 

Replace frd01mediac01 with cbd01mediac01

 

STREAM::expression {@[Ff][Rr][Dd]01[Mm][Ee][Dd][Ii][Aa][Cc]01@cbd01mediac01@}

 

 

Enable the stream filter for this response only

 

STREAM::enable

 

log local0. "You're in carlsbad [IP::client_addr] - modification required"

 

 

}

 

}

 

}

 

2 Replies

  • have you got tcpdump showing response is changed even client ip does not start with ip in the data group?

     

     

    e.g.

     

    tcpdump -nni 0.0:nnn -s0 -w /var/tmp/output.pcap host x.x.x.x or host y.y.y.y

     

    x.x.x.x is virtual server ip

     

    y.y.y.y is pool member ip
  • Can you change Lifelink_CBD_ClientNets to an address data group with the ranges defined as networks, remove the $:: prefix from the data group name in the iRule and retest?

     

     

    Aaron