Skip to content

Instantly share code, notes, and snippets.

@kohlerdominik
Last active April 5, 2022 09:18
Show Gist options
  • Save kohlerdominik/12006028a487342bd84f5003e7484499 to your computer and use it in GitHub Desktop.
Save kohlerdominik/12006028a487342bd84f5003e7484499 to your computer and use it in GitHub Desktop.
Raspberry Pi with Raspbian Stretch: use bridge interfaces
sudo apt-get update && sudo apt-get install bridge-utils
sudo nano /etc/network/interfaces
iface eth0 inet manual
iface eth1 inet manual
auto eth0
iface br0 inet manual
bridge_ports eth0 eth1
sudo nano /etc/dhcpcd.conf
denyinterfaces eth0 eth1
interface br0
static ip_address=192.168.8.99/24
static routers=192.168.8.1
static domain_name_servers=8.8.8.8
@ygoe
Copy link

ygoe commented Dec 8, 2021

Can I also have a dynamic IP address for the bridge, from an existing DHCP server in the network?

@kohlerdominik
Copy link
Author

Hi @ygoe
if you leave the static config away, I think it should use DHCP automatically. I can't test it, though.

@TK3062
Copy link

TK3062 commented Apr 5, 2022

Hi @kohlerdominik
I would recommend changing one line in your network interface settings..

Current

auto eth0
iface br0 inet manual
bridge_ports eth0 eth1

Recommended

auto eth0
iface br0 inet dhcp
bridge_ports eth0 eth1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment