Networking Forums

Networking Forums > Computer Networking > Linux Networking > linux routing rules (based on session source)

Reply
Thread Tools Display Modes

linux routing rules (based on session source)

 
 
Moonstruck
Guest
Posts: n/a

 
      09-13-2003, 02:13 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

The server 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
Is source address selection based on rules (netfilter) possible ? Xavier Roche Linux Networking 29 09-11-2010 07:51 PM
source based routing help needed Jack Snodgrass Linux Networking 4 02-29-2008 10:31 AM
VPN server: routing based on source IP? Ryan Windows Networking 5 10-14-2007 04:41 AM
Tcp/ip session based routing Tom Linux Networking 0 05-16-2006 03:34 AM
linux routing rules (based on session source) Moonstruck Linux Networking 3 09-16-2003 01:32 AM



1 2 3 4 5 6 7 8 9 10 11