For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Ron_130795's avatar
Ron_130795
Icon for Nimbostratus rankNimbostratus
Mar 25, 2014

Creating an iRule with different multiple ports for one VIP

I have a VIP that needs to respond to multiple ports. They are not in the same range so would my below iRule work?

 

when CLIENT_ACCEPTED { if {([TCP::local_port] = 799 ) && ([TCP::local_port] = 8914) || ([TCP::local_port] = 3000 ) && ([TCP::local_port] = 3050) } { pool Test_pool } else reject }

 

1 Reply

  • You're saying: if (the local port is 799 AND 8914) OR (local port is 3000 AND 3050), then allow it.

    Try this:

    when CLIENT_ACCEPTED {
        switch [TCP::local_port] {
            "799" -
            "8914" -
            "3000" -
            "3050" { return }
            default { reject }
        }
    }
    

    You also shouldn't need the pool statement there if you have the pool assigned to the VIP.