Forum Discussion

Les_Marstaeller's avatar
Les_Marstaeller
Icon for Nimbostratus rankNimbostratus
May 15, 2006

Routing with irules?

Hi,

 

 

Is it possible to route packets with irules? I would like to source route, that is, if a packet comes in on interface A then send it out interface b. If the same packet comes in interface c then send it out interface d.

 

 

I suspect this cannot be done but thought I would ask the very knowledgeable people on this forum just to make sure.

 

 

Thanks for any help in advance.

 

 

Les

 

Canberra, Australia

2 Replies

  • I am doing source routing currently, check this thread:

     

     

    http://devcentral.f5.com/Default.aspx?tabid=28&forumid=5&postid=7784&view=topic

     

     

    To source route not only on IP but also on arriving interface, I'd look at integrating [LINK::vlad_id] or [LINK::lasthop] into the rule. Post back if you get stuck.
  • I haven't tested routing only at the mac layer, but you could try something like this:

    
    class nexthop_select {
      "src_MAC_1 dst_MAC_1"
      "src_MAC_2 dst_MAC_2"
      "src_MAC_3 dst_MAC_3"
    }
    when CLIENT_ACCEPTED {
      LINK::nexthop [findclass [LINK::lasthop] $::nexthop_select " "]
    }

    Note that the class would be added under the datagroups section if being entered in the GUI. Need to be on 9.2 to use these commands apparently. My 9.1.1 system doesn't recognize them. Also note that you might want to do some logging to determine how the lasthop is populated (upper/lowercase,leading zeroes omitted, etc)

    Good luck!