Forum Discussion

Or_A_157009's avatar
Mar 01, 2016

F5 iRule - Change node dynamically and keep the default pool

Hello,

 

i have written an iRule that changes the destination ip of the http request, it's done by:

 

node $destProxy $destPort

 

after doing that the request goes to the default gateway of the f5 appliance instead of the default pool assigned to the virtual server.

 

i guess the node overrides the default pool.

 

is there a way to use the node inside the iRule and keep the default pool?

 

just to mention, the default pool has more than one nodes so it cannot be the default gateway.

 

thanks

 

or

 

9 Replies

  • Vernon_97235's avatar
    Vernon_97235
    Historic F5 Account

    Are you trying to control how the packet is routed toward the destination address? If so, you can utilize the nexthop command.

    I will say that you can, in fact, use a pool as the default gateway, if that's what you really want:

    tmsh create net route default network default pool /Common/some-pool-or-another
    
    • Or_A_157009's avatar
      Or_A_157009
      Icon for Cirrus rankCirrus
      hey, thanks for the answer. i want to keep my existing default gateway for other traffic. for this specific irule i want a different pool as a gateway. the next hop is a good option if the gateway is one, but in my setup i have a pool with 2 nodes for round robin. the only thing i could think of is a virtual mac at the gateways...
    • Vernon_97235's avatar
      Vernon_97235
      Historic F5 Account
      Can you insert a specific route to the destination in question? That is, if the node is a single address, say 74.56.1.5, can you add a route for 74.56.1.5/32 pointing to the pool you desire?
    • Or_A_157009's avatar
      Or_A_157009
      Icon for Cirrus rankCirrus
      no, the node is dynamic, changes from time to time. but i have figured it out without the node command. got another device after the f5 to do this exact job. thanks!
  • Are you trying to control how the packet is routed toward the destination address? If so, you can utilize the nexthop command.

    I will say that you can, in fact, use a pool as the default gateway, if that's what you really want:

    tmsh create net route default network default pool /Common/some-pool-or-another
    
    • Or_A_157009's avatar
      Or_A_157009
      Icon for Cirrus rankCirrus
      hey, thanks for the answer. i want to keep my existing default gateway for other traffic. for this specific irule i want a different pool as a gateway. the next hop is a good option if the gateway is one, but in my setup i have a pool with 2 nodes for round robin. the only thing i could think of is a virtual mac at the gateways...
    • VernonWells's avatar
      VernonWells
      Icon for Employee rankEmployee
      Can you insert a specific route to the destination in question? That is, if the node is a single address, say 74.56.1.5, can you add a route for 74.56.1.5/32 pointing to the pool you desire?
    • Or_A_157009's avatar
      Or_A_157009
      Icon for Cirrus rankCirrus
      no, the node is dynamic, changes from time to time. but i have figured it out without the node command. got another device after the f5 to do this exact job. thanks!
  • mo_99289's avatar
    mo_99289
    Historic F5 Account
    Regarding the $destProxy, is that address only accessible to bigip via the gateway? Regarding "is there a way to use the node inside the iRule and keep the default pool?" I think the irule you paste here can implement it.