Forum Discussion

Ken_51674's avatar
Ken_51674
Icon for Nimbostratus rankNimbostratus
Sep 19, 2013

Multiple "Outside" interfaces and routing lookups

Tech Guru's,

I currently have a basic setup for load balancing consisting of an "outside" VIP subnet along with an "inside" POOL subnet. A firewall borders the "Outside" interface which NAT's public address’s to the VIP address's which allows the LTM to load balance. All is well.
We now would like to move another subnet (load balanced via a different LTM) underneath this F5 and not have to change any addresses associated with the devices either "Outside" or "Inside". This new "outside" subnet will hang off another interface on the FW and we'll need to add another interface on the LTM as well. The "inside" POOL subnet can stay the same as it is currently a transit VLAN which allows the "Pools" to sit anywhere. The new proposed setup would be 2 "Outside"LTM  interfaces on different VLANs/Subnets attached to two different Firewall interfaces  along with the single "Inside" LTM interface.
Here's my question surrounding the LTM and routing a packet.   Today we have a default route on the LTM pointing out the current "Outside" interface to the border Firewall.  When I add the second "Outside" interface how will the LTM choose which "Outside" interface to send the packet through? I'm wondering what the LTM will do when it gets a packet from a pool member translates it to the corresponding VIP address and now needs to send it out.  Does it look to see what interface to send it on by which VIP address it translated it to or does it look at the routing table and forward the packet via the route table lookup?  Does the VIP address matter (from a forwarding perspective) after the translation from pool member to VIP address takes place.. i.e will the LTM forward the packet on the VIP interface it just translated the pool member to or look to the routing table?

Thanks! Ken

11 Replies

  • Doesn't sound like an optimal design but regardless, the Auto Last Hop feature will save you here but not if your firewalls are clustered and use VRRP things get a bit sticky.

     

    You can find more information on ALH here: http://support.f5.com/kb/en-us/solutions/public/13000/800/sol13876.html.

     

    From a design POV, could you not route the traffic from the additional f/w through the existing one perhaps? No idea of your set-up and even that doesn't sound great I guess. My worry is one day someone will disable ALH and things will go very wrong.

     

  • What Lies Beneath,

     

    Thanks for your answer. As if you couldn't tell my LTM knowledge is limited to VIP's and Pools. I never heard of Auto Last Hop but that does sound like something I'll need if we move to multiple interfaces on the outside (more to come on this).

     

    In a question surrounding design I'll put this past you for your input if you have time. Ultimately here are the requirements.

     

    • We have two VIP subnets (say 10.10.10.0/24 and 10.20.20.0/24).
    • There are multiple pools underneath which aren't at issue.
    • We would like to keep all VIP addresses the same to ease the switch to a new site.

    Additional Questions: Can the LTM have one outside netblock (say 10.30.30.0/24) with the current VIP's still on 10.0.10.0/10.20.20.0 (as long as a FW or router can route the 10.10.10.0 and 10.20.20.0 traffic to the LTM 10.30.30.0 address?

     

    Does the LTM need to have an interface on the same netblock as the VIP addresses?

     

    If it doesn't need to have an interface per VIP subnet that makes for a much easier transition.

     

    Regards, Ken

     

  • You'll be glad to know the Virtual Server subnets do not have to exist anywhere, everything just works as long as you route the VS subnets to the F5 outside interface from your firewall. I'll upload a diagram demonstrating this shortly.

     

  • Makes perfect sense. Thanks for shedding light on this. I was tied to thinking the VIP's were required to have a physical interface which complicated everything. The information you provided is much appreciated!

     

  • Maybe one more question to solidfy my thinking on this.

     

    It appears the LTM is basically a router under the covers. When it receives a packet it will check the destination and if it is a VIP will perform its magic, tie it to a node eventually and then look in the routing table for destination interface on where to send it. If it receives a packet from a node it will look to see how to un-do the connection (Node for VIP address) and once again look into it's route table to decide how to forward the packet. Basically as long as the route table on the LTM has the correct paths to the destination networks the LTM could care less from what interface the packet arrived on (of course without some of the other tweaks that could be made like ALH). Ultimately the routing table decides the destination interface and nothing else.

     

    Is this a correct way of thinking?

     

  • I'm afraid not. Think of it more like a stateful firewall (unless you implement VS's to mimic stateless routing). The only difference is that the return traffic path ignores the routing table and uses ALH instead. ALH will return the traffic to the L2 MAC address it originally received it from rather than consult the routing table. You can of course change this behaviour.

     

  • OK I'll try this again to get my thinking in order.

     

    First off there is no designation for "outside" or "inside" networks from what I can tell.

     

    When a packet comes into the LTM destined for a VIP address the LTM creates a state entry which includes keeping track of the interface and MAC that the packet came in on. The LTM will then load balance or perform other functionality and send the packet on. When the return packet comes back the LTM associates this with the previously created state entry, rebuilds the packet for the VIP address and sends it to the interface and MAC it stored in the state entry. For any stateful connection the route table is not consulted to determine which interface to send the packet through. The destination will always be which interface and MAC sent the initial packet to the LTM.

     

    Got it now?

     

  • You can have a look at your connection table:

    tmsh show sys conn all-properties

    As W.L.B. already pointed out, beside the tuple and timeouts also the last hop information (MAC address) is stored, the ingress VLAN and even the egress VLAN (not on display unfortunately).

    Btw, using the last hop information improves the performance, as no additional lookups are required to forward the servers response.

    There is one disadvantage to keep in mind: A failover on the routers may lead to a situation where responses are still forwarded to the initial MAC address. As this router / firewall is in 'standby' now, these packets will be dropped. Turning off auto last hop selectively is one workaround. Setting the HSRP / VRRP virtual MAC address as last hop via iRule is another one.

    Using virtual address space (both for VIPs and SNATs / NATs) to be reached via floating self IPs is a common concept in F5 deployments. And yes, 1st time it sounds strange to everyone who is familiar with typical router / firewall deployments. 🙂

    PS: Things become complicated in active / active deployments (multiple traffic groups).

  • W.L.B / Stephan,

    Thank you very much for these detailed responses.  Much Appreciated! 
    

    Ken