Skip to main content
1 of 2
Marcus Müller
  • 52.7k
  • 4
  • 80
  • 123

is it possible to divide one physical 8-terminal ethernet port into 2 by 4?

No, that's electrically and digitally not possible, as a network card has but one transceiver logic per port, and it's also not what you need.

This is solved "properly" already on Ethernet level!

Ethernet (for the last ~ 25 years) supports VLAN, where the originating network device adds a "tag", a number to the Ethernet header that says "this packet belongs to virtual local network 1, and this packet to virtual local network 2".

A switch can then separate packets into real separate physical networks. You can configure your switch to say "Port 1, 2 and 4 on this switch belong to network 1, ports 1, 3, 5 belong to network 2", and then these networks are completely separate, don't need nor see any VLAN tags, because they are really separate, aside from port 1 (where your raspberry Pi sits, gets packets when aimed at it from both networks, and knows how to deal with VLAN tags).

It's really easy to set up VLAN for your ethernet device on Linux. In essence, it's either using the graphical NetworkManager administration to add two new "VLAN" type interfaces, both with your physical ethernet interface as "parent interface", and set them up as you want (one might get its IP address from a router via DHCP, the other might have a static IP address, for example). Make sure they have differing VLAN numbers!

Same can be done via command line using nmlci; https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/configuring_and_managing_networking/configuring-vlan-tagging is a good guide (you don't need any of the "optional" steps).

What you'll need is to use a switch that can be configured to assign its physical ports to different VLANs. We usually call these switches "managed". The thing you want to look for is support for "IEEE 802.1Q", which is the standard that defines how VLANs work. If you're in Europe this might be a sensible list of devices that do IEEE 802.1Q and have a web interface to configure that easily. Make sure you don't buy one that needs some kind of cloud account to manage.

Marcus Müller
  • 52.7k
  • 4
  • 80
  • 123