Skip to contentSkip to conversation

Can netfilter bypass routing table?

DISCUSSION [email protected] 2 participants 2 messages May 28, 2006 – May 30, 2006

lore
Share & tools
lore
#0 lore raw

I have a linux machine with two interfaces eth0 and eth1. I am interested in sending a packet to address 1.2.3.4. I want the packet to go out eth0 if it is being sent by ProcessA. I want the packet to go out eth1 if is being sent by ProcessB.

Is this possible to do with iptables?

I see that CONFIG_NF_IP_OWNER has the ability to identify packets by process. I don't understand how to use iptables to change the interface.

Any advice cheerfully accepted,
Thanks,
-jon

#1 lore raw
Quoted 6 lines

I have a linux machine with two interfaces eth0 and eth1. I am interested in sending a packet to address 1.2.3.4. I want the packet to go out eth0 if it is being sent by ProcessA. I want the packet to go out eth1 if is being sent by ProcessB.

Is this possible to do with iptables?

Have you looked at the ROUTE target ?
http://www.netfilter.org/projects/patch-o-matic/pom-extra.html#pom-extra
-ROUTE

You can also mark the packets and use iproute to route them to a different gateway. I *think* the ROUTE target is be the simplest method, however, I have done neither in practice..

Gr,
Rob