Forum Discussion

bert_92443's avatar
bert_92443
Icon for Nimbostratus rankNimbostratus
Sep 13, 2012

adding 2 pool into the same virtual-server

I have 2 pools - YAYA_80 with member 172.16.20.1:80 and 172.16.20.2:80

 

and a second pool YAYA_0 with member 172.16.20.3:0 and 172.16.20.4:0

 

I would like to have a single virtual-server 10.10.1.100 port 80 tcp with pool YAYA_80 and YAYA_0

 

is that possible?

 

I don't want to have to vip like 10.10.1.100:80 and 10.10.1.100.

 

Under the gui, All I can see if the default pool (single pool) and using tmsh It seems like it is the same issue.

 

 

Thanks for your assistance.

 

 

 

7 Replies

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Yes. You could create a single VS on port 0 with the default pool your port-0 pool. Then add an iRule that checks for server port == 80 and set the pool in the iRUle to your port-80 pool.

     

     

    H
  • thanks - I will test today -

     

    Can you provide a simple example of irule that will accomplish that.
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    There's probbaly one in codeshare. But a quick one (UNtested, type don the fly) would be something like

     

     

    The code assumes you may set your VS to all-protocols not just TCP and that your port 80 is TCP and not something else.

     

     

    
    when client-connect {
      if { [ IP::protocol ] == 6 }
        if { [TCP:local_port] == 80 } {
          pool my-server-pool-80
        }
      }
    }
    

     

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    And has a missing { character in it...

    
    when client-connect {
      if { [ IP::protocol ] == 6 } {
        if { [TCP:local_port] == 80 } {
          pool my-server-pool-80
        }
      }
    }
    

    H
  • CLIENT_ACCEPTED 🙂

    
    when CLIENT_ACCEPTED {
      if { [ IP::protocol ] == 6 } {
        if { [TCP:local_port] == 80 } {
          pool my-server-pool-80
        }
      }
    }
    

    It would probably be simpler and more efficient to create a separate port 80 and separate port 0 virtual server and avoid the iRule. Using a separate virtual server per protocol allows you to customize the traffic handling with profiles, idle timeouts, etc.

    Aaron
  • Yours members are different, then, you can create another pool, with the 4 members and use this pool on the VS

     

     

    this way is ready for you ?