Forum Discussion

Harry_175563's avatar
Harry_175563
Icon for Nimbostratus rankNimbostratus
Nov 25, 2014

To create an irule to direct traffic irrespective of ports ( all ports)

Hi, can any one help me creating an irule for the following :

 

source IP: 0.0.0.0/0 destination IP : 0.0.0.0 redirect the traffic of port 80 to one pool and anything else to another pool..

 

thanks

 

5 Replies

  • to be more descriptive one pool is the bluecoat cacheflow and the other pool is the peerapp device for transparent caching ... the issue is that the traffic gets directed to either of the pool at a given time ... which i want to regulate by creating an irule specifying that anything on port 80 should get redirected to bluecoat cache pool and any other port than port 80 be redirected to the peerapp pool... appreciate help on this
  • you can check destination port using TCP::local_port and send to specific pool using pool command. TCP::local_port   https://clouddocs.f5.com/api/irules/TCP__local_port.html pool   https://clouddocs.f5.com/api/irules/pool.html by the way, why don't you create 2 virtual servers; one is 0.0.0.0:0/0 and the other one is 0.0.0.0:80/0? so, you do not need the irule.
  • Hi nitass, "by the way, why don't you create 2 virtual servers; one is 0.0.0.0:0/0 and the other one is 0.0.0.0:80/0? so, you do not need the irule." ....... thats what we did but still dont work ...
  • was there any error in /var/log/ltm? have you tried to capture packet?
  • Below is the iRule:

    when CLIENT_ACCEPTED

    {

    if { [TCP::local_port] eq "80" } {

     pool httppool
    

    } else {

    pool otherPool
    

    }

    }