Hello all,
I wanted to create a kind of passthrough connection between the onboard ethernet port and a second ethernet port by plugging a USB to ethernet adapter. The reason was that I wanted to plug an RPi running Zabbix in between ISP handoff and the network to test data consumed over certain time in GB (not speed graph in K/Mbps).
So I did the following and that gives me something like a NIC teaming ( active / passive), but I was expecting bridging that allows full L2 passthru including dhcp and that does not happen.
I followed this document and then did the config as shown below.
https://wiki.linuxfoundation.org/networking/bridge
I used HDMI Monitor to do this (left most HDMI port on RPI 4B) to ensure I don’t get locked out.
apt install bridge-utils
reboot
brctl addbr br0
brctl setfd br0 0
brctl addif br0 eth0 eth1
eth1 above is USB ethernet adapter.
nano /etc/network/interfaces
#add at the bottom the following
and under existing #Ethernet stanza, comment out all the lines
#Disable DHCP client on bridge interfaces
iface eth0 inet manual
iface eth1 inet manual
Bridge setup
auto br0
iface br0 inet static
bridge_ports eth0 eth1
address 192.168.2.111
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 9.9.9.9 1.1.1.1
Also under /etc/resolv.conf, I had to specify name servers.
With this diet-pi will show eth0 ON but disconnected and will ask to set up this interface via dietpi-config. Hit enter to login.
The ifconfig (I installed net-tools and traceroute as well as mc ) shows br0 has IP address and is up and so are the eth0 and eth1 up, but no IP on these of course).
And I can then plug either of the ethernet port to the network and I can SSH into it as well as RPi is online. But if I use the second port to connect to a test laptop, I don’t get dhcp IP. I also tried by assigning static IP address on laptop NIC, in same subnet but still nothing.
Anyone having done any bridging setup something similar to my needs, please share your configuration. There is standard setup of Wireless AP bridged to ethernet for upstream access to Internet.
Thanks and stay healthy everyone.