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

  • Cannot Print PDF Solution and Howto Resize
  • Linux Console Login Screen TTY Change Message
  • Apache Cannot Start Listening Already on 0.0.0.0
  • MySQL Bash Query to pipe input directly without using heredoc trick
  • CentOS 6 and 7 / RHEL Persistent DHCP Solution
  • Debian Ubuntu Mint rc-local service startup error solution rc-local.service: Failed at step EXEC spawning /etc/rc.local: Exec format error
  • MySQL Cheatsheet Guide and Tutorial
  • bash script kill whois or other command that is running for too long
  • 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)