The bridge-utils-interface man pages describe the options.
Create and link to article covering fundamental bridging btw existing network interface... the original use of a bridge.
Creating a Simple Bridge
I'm frankly still fuzzy on what's happening here. But this bridge works for my LXD host to allow my containers to interface with my hosts network directly.
Here is the default dhcp network interface...
Here is the network interface with modifications to make it static...
Here is we've added a bridge br0 that interfaces with the host's primary network card ens3,
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto br0 iface br0 inet static address 192.168.0.50 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 192.168.0.1 bridge-ports ens3 bridge-stp off
Common to to all,
auto br0 iface br0 inet dhcp # or static but keeping simple for now # Required bridge_ports eth0 # Binds the bridge to your existing ethernet # Looks to be options bridge_maxwait 0 bridge_stp off bridge_fd 0 # ?
Differences between articles,
https://insights.ubuntu.com/2015/11/10/converting-eth0-to-br0-and-getting-all-your-lxc-or-lxd-onto-your-lan/ - LXC/LXD specific bridging. This looks quite different than the other examples and not sure why
auto br0 iface br0 inet dhcp bridge-ifaces eth0 # Different than other examples. bridge-ports eth0 up ifconfig eth0 up # Different than other examples. iface eth0 inet manual # Different than other examples.
https://help.ubuntu.com/community/KVM/Networking - KVM specific, but also explains each item more,
auto lo iface lo inet loopback auto br0 iface br0 inet static address 192.168.0.10 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.1 dns-nameservers 192.168.0.5 18.104.22.168 dns-search example.com bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0
https://www.theurbanpenguin.com/ubuntu-server-creating-a-bridge-interface/ - mentions for KVM too,
auto br0 iface br0 inet static address 192.168.0.201 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 22.214.171.124 126.96.36.199 bridge_ports eth0 bridge_stp off
https://help.ubuntu.com/community/NetworkConnectionBridge - Bridge article, shows how to also do as straight command line (which does not persist after reboot) for testing,
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # Bridge between eth0 and eth1 auto br0 iface br0 inet dhcp # For static configuration delete or comment out the above line and uncomment the following: # iface br0 inet static # address 192.168.1.10 # netmask 255.255.255.0 # gateway 192.168.1.1 # dns-nameservers 192.168.1.5 # dns-search example.com bridge_ports eth0 eth1 bridge_stp off bridge_fd 0 bridge_maxwait 0
https://www.cyberciti.biz/faq/how-to-create-bridge-interface-ubuntu-linux/ - shows bridging with multiple cards... more complicated,
# br1 setup with static wan IPv4 with ISP router as gateway auto br1 iface br1 inet static address 188.8.131.52 network 255.255.255.248 netmask 255.255.255.0 broadcast 184.108.40.206 gateway 220.127.116.11 bridge_ports eth1 bridge_stp off bridge_fd 0 bridge_maxwait 0
auto br0 iface br0 inet static address 10.18.44.26 netmask 255.255.255.192 broadcast 10.18.44.63 dns-nameservers 10.0.80.11 10.0.80.12 # set static route for LAN post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.18.44.1 post-up route add -net 18.104.22.168 netmask 255.255.0.0 gw 10.18.44.1 bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0