You could also do bridging instead of routing. This would transform your computer in a switch, more or less intelligent. To do this you will need the bridge-utils
package and to unconfigure the IP address of NIC A by disabling DHCP (and rebooting) or by running ip addr del 10.11.0.1 dev eth0
.
To configure the bridge, you'll need to do:
brctl add br0
brctl addif br0 eth0 # NIC A
brctl addif br0 eth1 # NIC B
Your bridge is up and running now. To filter packets you can use iptables or ebtables.
LE: Since joe mentioned IP addresses, I've remembered that I've forgot something. If you want the server to have an IP address you could assign it to the br0
interface and the server will act like any other computer connected to either NIC A or B.
LE2: The bridge configuration can be saved under /etc/sysconfig
. To see how read /usr/share/doc/initscripts-*/sysconfig.txt
. For example my config files look like this:
# /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
STP=off
DELAY=1
ONBOOT=yes
BOOTPROTO=dhcp
# /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BRIDGE=br0
I have only one network card and I use the bridge for my virtual machines.