Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Answer by u1686_grawity for How to connect to 3 devices on the same subnet with a network adapter card

Normally each network interface is independent at layer 2 – which basically means each interface is a separate "subnet" physically. (Which is why they all have separate IP configuration!)

Trying to configure several independent interfaces with the same IP subnet number will not work as expected – only one of them will be used for all outbound packets to the entire subnet (whichever of the 3 identical routes in the IP routing table ip r ends up having lowest metric set). The host does not try to probe all interfaces to figure out which one allows reaching the IP address you want – it'll just always use the same 1st interface for everything.

There are two ways to achieve what you want (keeping everything in the same subnet), both involve the same kind of layer-2 connectivity:

  • Create a virtual bridge interface and add all 4 physical Ethernet interfaces as "bridge ports". Only the bridge should be configured with an IP address from the subnet.

  • Buy a cheap 5-port Ethernet switch, connect it to one of your physical Ethernet ports, and connect all cameras to that switch. Keep the other interfaces disconnected, or use them for something else (different subnets).

As your devices mainly communicate with the PC and not with each other, the 1st option (software bridge) will be good enough.

NetworkManager supports creating bridges, but the standard Ubuntu network settings app doesn't have that as an option – instead you'll need to use nm-connection-editor (from the network-manager-gnome package) or nmcli con add type bridge.

(Don't forget to disable STP in the bridge's settings; the obsolete STP version used by Linux will otherwise spend ~30 seconds learning the network state, which is annoying.)

(This method would still work if the devices were e.g. a PC and a NAS, which wanted to talk directly to each other, but a physical Ethernet switch would offer somewhat better performance as it doesn't rely on your CPU to do the L2 bridging.)


Viewing latest article 2
Browse Latest Browse All 3

Trending Articles