Forum Discussion

Allim_63326's avatar
Allim_63326
Icon for Nimbostratus rankNimbostratus
Sep 24, 2009

LTM VIP for port range and specific ports

I have a strange request that I need do, I have to create a VIP for port range (10000-10100) and some specific ports (6427, 6813, 6837)

 

 

I know how to create a rule for port range but I am having difficulty in adding specific ports to the iRule. Here are the steps that I did

 

 

1. Create the VIP with any port (0)

 

2. created the iRule for port range (10000 to 10100)

 

 

when I try to add specific port to iRule it doesn't work

 

 

Any help would be highly appreciated.

4 Replies

  • Could you post your rule? It'll help visualize what may be going on.

     

    TIA,

     

    -Matt
  • Here is the iRule that doesn't work

     

     

    when CLIENT_ACCEPTED {

     

     

    Check if requested port is outside 6427, 6813, 6837, 10000 - 10100

     

    if { [TCP::client_port] != 6427 or [TCP::client_port] != 6813 or [TCP::client_port] != 6837 or [TCP::client_port] < 10000 or [TCP::client_port] > 10100 }{

     

    drop

     

    }

     

    }

     

  • How about this?

     
     when CLIENT_ACCEPTED { 
        if {not ([TCP::local_port] == 6427 or [TCP::local_port] == 6813 or [TCP::local_port] == 6837 or \ 
           ([TCP::local_port] >= 10000 and [TCP::local_port] <= 10100))}{ 
           drop 
        } 
     } 
     

    Aaron