Forum Discussion

BluHades_10582's avatar
BluHades_10582
Icon for Nimbostratus rankNimbostratus
Oct 24, 2007

Help with redirecting traffic over one ISP link all the time.

Hello,

 

I'm new to writing iRules and would like some assistance please.

 

I have a link controller with 2 links to 2 ISP's. ISP 1 is on net a.b.c.d and ISP 2 is on net w.x.y.z

 

I have clients internal in my network that need to use ISP 1 a.b.c.d for outbound traffic each time they access the FQDN cbd.mo.uk (which is a resource in ISP 1 network), otherwise for all other traffic they can use either link.

 

I would like for the link controller on receiving outbound traffic to cbd.mo.uk to always use ISP 1 a.b.c.d

 

Could someone please provide a sample Irule i could use in this scenario.

 

Many thanks for your time and expertise.

 

Blue.

7 Replies

  • HI Bluehade

     

     

    if it's a LC box, it only can inspect IP address and port number. it that case you might need to resolve the ip address for cbd.mo.uk. assuming the ip address is 3.3.3.3, you can try out irule

     

     

     

    when CLIENT_ACCEPTED {

     

    if {[IP::addr[IP::local_addr] equals 3.3.3.3]} {

     

    pool router_isp1

     

    } else {

     

    pool gw_pool

     

    }

     

    }

     

     

    assign this irule to wildcard_vs.

     

     

    happy trying.
  • You could also define a virtual server for the "3.3.3.3" IP address and have the router_isp1 pool as the virtual server's resouce, if you wanted to avoid using a rule for this.

     

     

    Aaron
  • Thanks for your replies. I have a question for kky. Looking at the syntax [IP::local_addr] equals 3.3.3.3] what does local_addr mean? To me the syntax reads "if the local address is 3.3.3.3 use pool router_isp1. I was a little confused as to whether the term local address should have been the term remote address (assuming such a term exists in the syntax), meaning If remote address or destination address is 3.3.3.3 then use pool router_isp1.

     

    Does this make sense?

     

     

    Also, Hoolio, i tried your suggestion and created the Pool with ISP1 as a member, and a Virtual server 3.3.3.3 with ISP1 as the resource. However, some traffic destined for 3.3.3.3 still ends up being sent out through the second ISP link. I can tell this is happening for a TCPdump on the 2nd ISP for host 3.3.3.3 shows up.

     

    thanks for your time.

     

    Blue.

     

  • Hi Blue,

     

     

    Because I'm using a clientside event, IP::local_addr referring to destination IP address and IP::remote_addr.

     

     

    regards,
  • I have a similar scenario, but I didn't understand how I would accomplish what you were saying here.

     

     

    I have the LTM connected to two different subnets. What I need is to have the responses to traffic going to VIPs on Subnet A routed back to Gateway A (regardless of what the LTM routing table says) and consequently traffic responses to traffic on Subnet B routed back to Gateway B.

     

     

    Can I do this without an iRule and if so... how? Sorry, it doesn't seem intuitive to me?

     

     

    (If I need an iRule, what would it look like approximately?)
  • If auto-lasthop is enabled, traffic will be sent back to the original mac independent of the routing table.