I have need to attach the two robotic devices to my computer, and for this I would like to use the two network cards connecting to these different pieces of hardware. Both devices happened to use the same network (ip addresses 10.0.0.70 and 10.0.0.21, netmask 255.255.255.0 in both cases).
I have discovered that if I configure and put up the network of any single card, it works no problem: I can ping the robotic device, and I have all other connectivity to it. However as soon as I put the second card up, only one of the two is working. I tried to given the main computer different IP addresses, tried to give the same, makes no difference. I tried to specify IP address of the host computer as the gateway, different for each card, the same, no difference at all. Even ping does not work on one of the cards when both are up, and even if I specify when pinging which interface to use.
My kernel is 4.15.0-39-generic #42~16.04.1-Ubuntu SMP Wed Oct 24 17:09:54 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux.
Both network cards can work together if I assign them to the different networks. However it would be preferred not to change the network settings on the side of the robotic devices. I do not need to route packets between these two cards.
Here is the working configuration I got:
enp3s0 Link encap:Ethernet HWaddr 18:d6:c7:00:d9:3e
inet addr:10.0.1.30 Bcast:10.0.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16929681 errors:0 dropped:0 overruns:0 frame:0
TX packets:56504 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1219898415 (1.2 GB) TX bytes:5267812 (5.2 MB)
enp6s0 Link encap:Ethernet HWaddr 18:d6:c7:01:69:35
inet addr:10.0.0.22 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::1ad6:c7ff:fe01:6935/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:52316 errors:0 dropped:0 overruns:0 frame:0
TX packets:16935487 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4325056 (4.3 MB) TX bytes:1220948325 (1.2 GB)
It stops working as soon as I change the IP of the first device to 10.0.0.30 (and broadcast address changes into 10.0.0.255).
I have just tried under Kali Linux live distribution, even there it does not work. Under Kali Linux
ifconfig eth0 10.0.0.21 netmask 255.255.255.0 up
ifconfig eth1 10.0.0.70 netmask 255.255.255.0 up
Again, I would expect that at least ping -I should work but nope, to ping any one, another must be down. How can any simple switch have multiple physical ports connected to the same network and a large computer cannot?