0

I have a PC with dual LAN, I wish them both to be on the same network and connectable to other systems. I boot with the below settings in /etc/network/interfaces

auto eth1
iface eth1 inet static
address 10.128.192.28
netmask 255.255.255.0
network 10.128.192.0
broadcast 10.128.192.255

auto eth2
iface eth2 inet static
address 10.128.192.19
netmask 255.255.255.0
network 10.128.192.0
broadcast 10.128.192.255

On bootup the IPs are configured correctly. However if I connect a laptop to eth1, I cannot ping the PC at all. If I connect to eth2, I can ping both 10.128.192.28 and 10.128.192.19.

If eth1 and eth2 are on different networks, both work without issue. However I need them to be on the same network.

How can I get eth1 and eth2 to operate independently on the same 10.128.192.X network ?

Thanks.

0

Because of how the network stack is implemented in linux, you can't have more interfaces in one server configured to same sub-net.

What you could do is bonding - also called port trunking, link aggregation or IEEE 802.3ad (search for: ubuntu network bonding), but that requires that your switch supports that.

  • Thanks for the reply. I am unsure about bonding, plus I would prefer not having to use an additional hardware switch if possible. My application is internal LAN only to sensors with known and fixed IPs on the same network. Isn't there anyway of tells the OS 'if you want to send/receive a tcp/ip msg to sensor A on IP a.b.c.d, use eth1' and 'if you want to send/receive a tcp/ip msg to sensor B on IP a.b.c.e use eth2' ? Instead of the OS deciding by itself which one and only one of the interfaces to use. Thanks. – John Feb 2 '17 at 9:10
  • @John You could put A and eth1 on one subnet and B and eth2 on another. It doesn't solve your problem but Linux will use both devices separately. – Ken Sharp Mar 8 '18 at 0:23
  • “you can't have more interfaces in one server configured to same sub-net” Are you sure about this? Are you referring specifically to Ethernet? I have a laptop which uses Wifi and Ethernet on the same network with no issues whatsoever. Indeed, Linux routers can do this with no issue. – Ken Sharp Mar 9 '18 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.