Bridging of eth0 and USB adapter based eth1 works and not

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 :slight_smile: ) 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.

I added following to make the passthru traffic work.

ifconfig eth0 -arp promisc 0.0.0.0 up
ifconfig eth1 -arp promisc 0.0.0.0 up

Did a reboot and now with laptop attached to either of eth0 or eth1 with other port connected to the network, I have laptop as well as RPi online and working.

Though it does not work to meet my needs of Zabbix application to see the traffic. Probably Zabbix is only able to see the traffic that leaves the bridge / interface and goes up the IP stack. So I will try some other way.

Hi,

thanks for sharing your solution to setup a bridged network.
BTW: ifconfig deprecated and was replaced by ip command :wink:

Regarding your network analyze, I found following interesting guide on the web. Not sure if this what you are looking for https://brooks.sh/2019/11/17/network-flow-analysis-with-prometheus/