I am running Ubuntu server 15.04 in a virtual machine. I am able to use the brctl program to create and manipulate networking bridges. I've decided to persist the setup (through reboots) by updating my /etc/network/interfaces as shown below:

auto m-br0
iface m-br0 inet static
bridge_stp 0ff
bridge_maxwait 0
bridge_fd 0
address 10.0.0.1
network 10.0.0.0
broadcast 10.0.0.255

However, when the VM comes back up, the bridge is not there. Checking journalctl shows the following:

Jul 21 20:44:16 Net systemd[1]: Starting LSB: Raise network interfaces....
Jul 21 20:44:16 Net networking[381]: * Configuring network interfaces...
Jul 21 20:44:16 Net networking[381]: Cannot find device "m-br0"
Jul 21 20:44:16 Net networking[381]: Failed to bring up m-br0.
Jul 21 20:44:16 Net networking[381]: ...done.
Jul 21 20:44:16 Net systemd[1]: Started LSB: Raise network interfaces...

I was hoping that the bridge creation would be done by the underlying framework being leveraged by brctl since, I was able to do all the bridge creation and configuration with it. But, I do not think that this facility (i.e. systemd-udevd) is being invoked and can't figure out how to get it to create a device for my bridge. Should I create .device unit file for my bridge and where in the start-up process should I put it? (I cannot find a sample .device unit file on my system to give me an idea on how to go about)

Would someone have some pointers for me? Thanks in advance.

up vote 1 down vote accepted

For bridge creation with ifupdown, you should usually specify the underlying device using bridge_ports. And what is bridge_stp 0ff???

Working configuration would be like:

auto m-br0
iface m-br0 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 10.0.0.1
network 10.0.0.0
broadcast 10.0.0.255

Read bridge-utils-interfaces manpage for detail.

  • Thanks for the prompt reply. 0ff was a typo :) Sorry for confusing you. I read the man page you referenced and it appears that bridge_ports is a mandatory property in /etc/network/interfaces. I do not want to create connection to those ports yet. I would have to find another way to get the bridge created. – Pieru Poika Jul 22 '15 at 3:57
  • 1
    @PieruPoika Then you could use bridge_ports none, or something like pre-up brctl addbr m-br0. – yaegashi Jul 22 '15 at 4:15
  • 1
    @PieruPoika One more thing, you should specify netmask for inet static interface, otherwise it might be set to 255.0.0.0 which would be unwanted configuration. Actually you don't necessarily have to specify network and broadcast while you should always specify address and netmask there. – yaegashi Jul 22 '15 at 7:07
  • 1
    Just to confirm @yaegashi suggestion that in my case the setting bridge-ports none did the trick – Pieru Poika Jul 22 '15 at 10:24

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.