Debian Ubuntu Mint Howto Create Bridge (br0)

Having a network bridge allows you to bridge traffic under multiple devices so they can talk natively without using any special routing, iptables/firewall or other trickery.

To create your bridge you need the bridge-utils package for brctl and if you want to do things like bridge VMs that run on a tap   device you will need the uml-utilities which provides "tunctl".

Install the utilities to make our bridge

sudo apt-get install bridge-utils uml-utilities

Backup your interfaces file to your home dir

sudo cp /etc/network/interfaces ~/interfaces-`date +%Y-%m-%d-%s`

Edit your interfaces file like this:

In this case I have a public facing NIC enp0s9 which I do NOT want to bridge.

But I wanted to bridge my internal NIC enp0s8.  The first thing you do is set a line for the bridged NIC to just be manual (remove any IP config info whether static or DHCP from the NIC you want to bridge).

Disable the NIC you want to bridge

iface enp0s8 inet manual

Setup your bridge

For simplicity I am going to call it br0 but it could be called almost anything.

The key part is below in bold where I declare the br0:


iface br0 inet static
  bridge_ports enp0s8

Now of course I could use dhcp instead of static and that is where it would end (assuming you wanted to use DHCP). 

On the second line below indented you add "bridge_ports enp0s8" which defines enp0s8 as belonging to the br0 bridge.

Here is what it all looks like:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo enp0s9 br0
iface lo inet loopback
iface enp0s9 inet dhcp

iface enp0s8 inet manual
iface br0 inet static
  bridge_ports enp0s8
   address 192.168.1.1
   netmask 255.255.255.0
   gateway 192.168.1.1


Tags:

debian, ubuntu, mint, howto, br, allows, multiple, devices, natively, routing, iptables, firewall, trickery, utils, brctl, vms, uml, utilities, provides, quot, tunctl, install, sudo, apt, interfaces, dir, cp, etc, edit, nic, enp, bridged, manual, ip, config, info, static, dhcp, disable, iface, inet, simplicity, bold, declare, bridge_ports, indented, defines, belonging, ifup, ifdown, auto, loopback, netmask, gateway,

Latest Articles

  • Linux tftp listens on all interfaces and IPs by DEFAULT Security Risk Hole Solution
  • python import docx error
  • Cisco Unified Communications Manager Express Cheatsheet CUCME CME
  • Linux Ubuntu Debian Missing privilege separation directory: /var/run/sshd
  • bash how to count the number of columns or words in a line
  • bash if statement how to test program output without assigning to variable
  • RTNETLINK answers: Network is unreachable
  • Centos 7 how to save iptables rules like Centos 6
  • nfs tuning maximum amount of connections
  • qemu-kvm error "Could not initialize SDL(No available video device) - exiting"
  • Centos 7 tftpd will not work with selinux enabled
  • Debian Ubuntu Mint Howto Create Bridge (br0)
  • How To Control Interface that dhcpd server listens to on Debian based Linux like Mint and Ubuntu
  • LUKS unable to type password to unlock during boot on Debian, Ubuntu and Mint
  • Debian Ubuntu and Linux Mint Broken Kernel After Date - New Extra Module Naming Convention
  • Wordpress overwrites and wipes out custom htaccess rules and changes soluton
  • Apache htaccess and mod_rewrite how to redirect and force all URLs and visitors to the SSL / HTTPS version
  • python 3 pip cannot install mysql module
  • QEMU-KVM won't boot Windows 2016 or 2019 server on an Intel Core i3
  • Virtualbox vbox not starting