2

I'm using Fedora 25, with kernel 4.11.9, kvm and bridge-utils are installed. I'm following the instructions on http://www.linux-kvm.org/page/Networking#Public_Bridge, to get public bridge. I also have Docker installed on my machine (which creates its own bridges and virtual interfaces).

When I run ip link add br0 type bridge, everything is ok. But after that, when I run ip link set eth0 master br0 my network stop working. The interface eth0 is the interface I use to access the local network and exit to the internet.

What could be going wrong? How can I troubleshoot this?

2
  • you have to do the ip setup on br0, not eth0. you need to clear ipv4 settings from eth0 beforehand, and set br0 to use that config instead. Commented Aug 11, 2017 at 14:44
  • Worked like a charm. I've used ip addr del 192.168.64.230/24 dev eth0 and ip addr flush dev eth0 to clear my eth0, repeated the steps and got ir working. Could you please post your comment as the answer so that I can mark it as correct?
    – Diogo Melo
    Commented Aug 11, 2017 at 14:58

2 Answers 2

4

When you add your ethernet interface to your bridge, you need to move your ipv4 settings from your eth0 to br0 as well. So, first clear eth0 settings and then give your ipv4/6 addresses/gateway/etc to your br0.

Personally I find it convenient to use NetworkManager's GUI (or TUI) to do this task.

-1

This how-to worked for me (using NetworkManager CLI):

https://gist.github.com/plembo/f7abd2d9b6f76e7afdece02dae7e5097

The steps would be, as root:

> nmcli con show
Ethernet 1  e923bc3e-d77f-4f68-8b33-eaa9955f437d  ethernet  eth0

Identify the ethernet connection and the physical device. From now and as an example, they were "Ethernet 1" and "eth0" respectively. Now create a bridge network:

> nmcli con add ifname br0 type bridge con-name 'Bridge 1'

And add the physical device as slave for this new connection:

> nmcli con add type bridge-slave ifname eth0 master 'Bridge 1'

As now, the thing would show as this:

> nmcli con show
Ethernet 1         e923bc3e-d77f-4f68-8b33-eaa9955f437d  ethernet  eth0
Bridge 1           c2a4218f-70b8-488e-83a6-49530ad79d7c  bridge    br0
bridge-slave-eth0  92fab279-110a-48ec-9e55-f240353f4fb2  ethernet  --

If you use DHCP:

> nmcli con mod 'Bridge 1' ipv4.method auto

If not,

> nmcli con mod 'Bridge 1' ipv4.method manual
> nmcli con mod 'Bridge 1' ipv4.addresses 10.1.1.16/24
> nmcli con mod 'Bridge 1' ipv4.gateway 10.1.1.1
> nmcli con mod 'Bridge 1' ipv4.dns '10.1.1.1,8.8.8.8,8.8.4'

Also, STP is not needed, so disable it:

> nmcli con mod 'Bridge 1' bridge.stp no

Now turn down the ethernet connection and turn up the bridge:

> nmcli con down 'Ethernet 1'
> nmcli con up 'Bridge 1'

For now, when you restart the computer, the Ethernet 1 connection keeps binding to the eth0 device, but we don't want this. So that the bridge slave can bind to the physical device, this last have to be free, so you have to disable the autoconnect flag of the ethernet connection:

> nmcli con mod 'Ethernet 1' connection.autoconnect no

Additional steps:

  • In addition, you could need to open the NetworkManager GUI, and edit the bridge-slave-eth0 connection to restrict it to the eth0 physical device.
  • At this point, the eth0 physical device could be locked to the 'Ethernet 1' connection, and you may need to restart.
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .