How to configure a network bridge without IP (Ubuntu 16.04)?

7,937

Solution 1

Create the br1 bridge without IP in your /etc/network/interfaces:

auto br1
iface br1 inet static
    address 0.0.0.0
    bridge_ports eth1

Solution 2

As I now found on http://manpages.ubuntu.com/manpages/xenial/man5/bridge-utils-interfaces.5.html, there is an additional and even shorter way of configuring this type of bridge (which by the way appears to be called anonymous bridge):

auto br1
iface br1 inet manual
    bridge_ports eth1
Share:
7,937

Related videos on Youtube

Michael Schmidle
Author by

Michael Schmidle

Updated on September 18, 2022

Comments

  • Michael Schmidle
    Michael Schmidle over 1 year

    I am trying to set up an LXD hypervisor that is connected to two networks: interface eth0 connects to a private network (i.e. 192.168.192.0/24) and interface eth1 connects to a small network with 16 public IPs (i.e. 8.8.8.0/28).

    My goal is to be able to attach the LXD containers to either one of these networks and have corresponding IPs assigned to them by the DHCP service that already is available in these networks. This will require configuration of two bridges on the LXD host in /etc/network/interfaces, for example like this for br0 and eth0:

    auto br0
    iface br0 inet dhcp
    bridge-ifaces eth0
    bridge-ports eth0
    up ifconfig eth0 up
    
    iface eth0 inet manual
    

    This bridge br0 will be assigned an IP from the private network so the LXD host can be managed through this IP. This is fine.

    On the other hand, I want to configure the bridge br1 for the second network with the public IP range so that the LXD host does not get an IP. I want to avoid "sacrificing" one of the few precious 16 public IPs for the host (sice it already has a private IP). In essence, I want to configure a bridge without IP but still allow the LXD containers to use this bridge just like br0.

    Is there a way to achieve that and "hide" br1 from the host? Thanks for your help.

  • Gohu
    Gohu almost 7 years
    +1. The shorter, the better. The maner, the better.