Could you lend your expertise in understanding how to go about configuring the separation of network traffic on two network interfaces?
As I understand thus far, static routes are used for network traffic that is not designed to use a default gateway. The default gateway is used for all traffic which is not destined for the local network and for which no preferred route has been specified in a routing table.
The scenario is as follows.
- Each computer in the network has two network cards.
- The production interface for each is
eth0(GW = 10.10.10.1).
- The management interface for each is
eth1(GW = 192.168.100.1).
- Production and Management traffic should be totally separated.
I have posted, below, what things I have tried with Debian Wheezy. And, my problem is that, although I have hosts set up in such a way that they do communicate on both interfaces, individual hosts seem to "hear" traffic on the wrong interface. For example:
eth0 Link encap:Ethernet HWaddr 08:00:27:d1:b6:8f inet addr:10.10.10.140 Bcast:10.10.10.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fed1:b68f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1341 errors:0 dropped:0 overruns:0 frame:0 TX packets:2530 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:641481 (626.4 KiB) TX bytes:241124 (235.4 KiB) eth1 Link encap:Ethernet HWaddr 08:00:27:ad:14:b6 inet addr:192.168.100.140 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fead:14b6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7220 errors:0 dropped:0 overruns:0 frame:0 TX packets:5257 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:602485 (588.3 KiB) TX bytes:1022906 (998.9 KiB)
From host 140, I execute this command:
tcpdump -i eth0. In a separate
session on host 140, I execute
19:17:29.301565 IP 192.168.100.140 > 192.168.100.50: ICMP echo request, id 1400, seq 10, length 64 19:17:30.301561 IP 192.168.100.140 > 192.168.100.50: ICMP echo request, id 1400, seq 11, length 64 19:17:31.301570 IP 192.168.100.140 > 192.168.100.50: ICMP echo request, id 1400, seq 12, length 64 19:17:32.301580 IP 192.168.100.140 > 192.168.100.50: ICMP echo request, id 1400, seq 13, length 64
Why do I see the above output on
eth0? I think I should only see traffic for 10.10.10.140.
I also see this on
eth1, as expected:
19:18:47.805408 IP 192.168.100.50 > 192.168.100.140: ICMP echo request, id 1605, seq 247, length 64
If I ping from Host 50 (same
ifconfig results - just a different last quad),
eth0 is silent, and I see the ICMP echos on
eth1, as expected.
I would like to understand how to configure each interface to handle only the traffic for which it is responsible in two major Linux varieties. I think I am almost there, but I am missing something I just can't seem to find.
- Debian Wheezy (7.x) or Debian Jessie (8.x)
- Enterprise Linux (6.x) (RedHat/CentOS/Scientific/Oracle).
I know that a solution for Debian should be good for both Wheezy and Jessie, and that a solution for an EL should be the same for all the EL 6.x versions. I would like to avoid using an RC script to execute commands, opting instead for using the configuration files.
In Debian the relevant configuration files that I know about are:
In EL 6.x, the relevant configuration files that I know about are:
My Debian 8 "Jessie"
source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # Production interface auto eth0 allow-hotplug eth0 iface eth0 inet static address 10.10.10.140 netmask 255.255.255.0 gateway 10.10.10.1 # Management interface auto eth1 allow-hotplug eth1 iface eth1 inet static address 192.168.100.140 netmask 255.255.255.0
netstat -anr might illustrate the problem:
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 10.10.10.1 0.0.0.0 UG 0 0 0 eth0 10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1