Forum Discussion

usend_209769's avatar
usend_209769
Icon for Nimbostratus rankNimbostratus
Mar 28, 2017

"IP forwarding" VS and nexthop iRule

Hello,

 

I have a F5 node working as a router (with a "IP forwarding" virtual server with 0.0.0.0 destination).

 

I would like to configure conditional routing. When a specific origin/destination port/ip addresses are matched, a different next hop is used.

 

I have problems doing this. It's possible on this type of virtual server to create a irule that match some ip addresses/port and execute command nexthop to use a different route?

 

It's possible to do this when dynamic routing is used?

 

Thanks.

 

4 Replies

  • Create this iRule and assign it to your virtual server that matches the specific IPs you want to route to the IP address in the iRule.

    Replace interface name and IP address. Remove "[]"

    when CLIENT_ACCEPTED {
        nexthop [INTERFACE NAME] [IP ADDRESS]
    }
    

    If it is a tunnel, you only need the interface name.

    • usend_209769's avatar
      usend_209769
      Icon for Nimbostratus rankNimbostratus

      Thank you for the answer.

       

      I'm trying this but without the interface name. I will try again.

       

      If I using a route domain, I must specify this on the IP (IP%domain)?

       

      If I working with dynamic routing this should work too?

       

      Thanks again.

       

    • BigD_300005's avatar
      BigD_300005
      Icon for Cirrostratus rankCirrostratus

      I currently use this rule with BGP on the same box. The VS/iRule will take priority over the route table. If you do a tcpdump, you can see it hitting your virtual server.

       

      I do not have multiple route domains on my F5. I do not have an answer for how that would work into the iRule.

       

  • Hi,

    Use pool assignment for route assignment.

    pool gateway_pool    
    

    A virtual server with network destination have the option "translate destination" disabled converting pool to gateway pool.