Under Debian Stretch, I used to achieve that by getting eth0's IP address, setting eth0 to 0.0.0.0, then creating the bridge, adding the two interfaces and assigning the IP address from step 1 to the bridge:
Code: Select all
ifconfig eth0 0.0.0.0 down brctl addbr bridge_usb brctl addif bridge_usb eth0 ifconfig eth0 0.0.0.0 up ifconfig bridge_usb up # Point 1 ifconfig bridge_usb 0.0.0.0 down ifconfig usb0 0.0.0.0 down brctl addif bridge_usb usb0 ifconfig usb0 up ifconfig bridge_usb up ifconfig bridge_usb $PUBLIC_IP
However, under Buster, I cannot get it to work. The same steps correctly set up the bridge and assign it the IP address, but there are multiple problems:
1) As soon as eth0 is contained in the bridge (Point 1 above), the Pi itself loses Internet access (eg ping doesn't work anymore)
2) It seems the eth0 interface automatically restores its IP address to $PUBLIC_IP after a few seconds, even when it is contained in the bridge
3) I'm unable to access the Pi via sshing to $PUBLIC_IP, and I assume that's because there are now 2 interfaces with $PUBLIC_IP, one of which is in the bridge
4) If I don't manually assign an address to the bridge interface, it seems that the bridge interface bridge_usb receives an IP address from my local network's DHCP server. This behavior seems to differ from Stretch.
Does anyone have any idea what could be the reason for the difference in behaviour from Stretch to Buster? What do I need to do to restore Stretch behavior for network bridges?