Networking Forums

Networking Forums > Computer Networking > Linux Networking > linux routing rules

Reply
Thread Tools Display Modes

linux routing rules

 
 
Moonstruck
Guest
Posts: n/a

 
      09-13-2003, 02:05 PM
I have a server with two routes to the internet.

Router A with a MAC address of 12:34:56:78:90:AB
and
Router B with a MAC address of CD:EF:12:34:56:78

It is a linux box. I want to force it to route return packets via the router
that the original packet came from. I was thinking something like:

Use iptables on the server to add an fwmark of 1 to in-bound packets
originating
from Router A
and an fwmark of 2 to packets originating from Router B

iptables -t mangle -A INPUT -m mac --mac-source 12:34:56:78:90:AB -j
MARK --set-mark 1
iptables -t mangle -A INPUT -m mac --mac-source CD:EF:12:34:56:78 -j
MARK --set-mark 2

then use iproute to add a routing rule based on the fwmark

ip rule add fwmark 1 table <something something something>
ip rule add fwmark 2 table <something something something>

What I don't know is...
does a return packet inherit an fwmark from the originating packet? If it
doesn't, then marking the in-bound packet is pointless.

Can someone that has wrestled with this problem give me a few pointers. This
must be a reasonably common need, is there a standard methodology for
dealing with it?

Thanks.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I replace my existing Linksys box with Linux Router, how can I know what kind of Routing to be enabled on my Linux Box? santa19992000@yahoo.com Linux Networking 3 01-06-2005 01:18 PM
linux routing help Jemy Linux Networking 2 08-27-2004 10:34 AM
linux routing Jemy Linux Networking 2 08-24-2004 03:21 AM
linux routing rules (based on session source) Moonstruck Linux Networking 3 09-16-2003 01:32 AM
linux routing rules (based on session source) Moonstruck Linux Networking 0 09-13-2003 02:13 PM



1 2 3 4 5 6 7 8 9 10 11