relocating packets
Assuming I had two NICs in my machine that happen to be on the same network, is there a way to force packets of certain ports to use only one NIC or IP?
Thanks,
~Mark
Quoted 3 lines · Mark Oden
Assuming I had two NICs in my machine that happen to be on the same network, is there a way to force packets of certain ports to use only one NIC or IP?
I believe this scenario is covered by the LARTC HOWTO. In brief: use "-j MARK --set-mark 0xff" in mangle. Use dual routing tables, and a rule to put "fwmark 0xff" traffic in the alternate table. The mark can be anything from 0x0 to 0xffff.
Signature · 2 lines
mail to this address is discarded unless "/dev/rob0"
or "not-spam" is in Subject: headerQuoted 1 line · Mark Oden
Assuming I had two NICs in my machine that happen to be on the same network, is there a way to force packets of certain ports to use only one NIC or IP?
If you have multiple NICs in the same Ethernet broadcast segment then I would recommend you to enable "arp_ignore".
echo 1 >/proc/sys/net/ipv4/conf/all/arp_ignore
If not things will get very confusing with traffic "randomly" coming in on either interface.
Once this is done you can firewall each NIC separately as you please, policy routing, marking etc to control how the interfaces are used.
Regards
Henrik