You are not logged in.

#1 2022-07-01 17:27:51

jenia
Member
Registered: 2014-07-12
Posts: 43

Setup bridge network systemd-networkd

I need to setup a bridge network on my machine but each time I try, the bridge does not get an IP and my ethernet card `eno1` does not have access to the internet.

Here is my setup for `systemd-networkd`:

[jenia@jenia network]$ pwd
/etc/systemd/network
[jenia@jenia network]$ files=(*)
[jenia@jenia network]$ for file in "${files[@]}";do echo "================="; echo $file; cat $file; echo ""; done
=================
bind.network
[Match]
Name=eno1

[Network]
Bridge=br0

=================
br0.netdev
[NetDev]
Name=br0
Kind=bridge

=================
br0.network
[Match]
Name=br0

[Network]
DHCP=ipv4
```

And here is my network configuration. Notice that `br0` does not have an IP for some reason.


[jenia@jenia network]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 78:24:af:36:1f:b5 brd ff:ff:ff:ff:ff:ff
    altname enp0s25
    inet6 fe80::7a24:afff:fe36:1fb5/64 scope link 
       valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:0f:9b:b6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether fe:8f:a3:0a:20:b2 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc8f:a3ff:fe0a:20b2/64 scope link 
       valid_lft forever preferred_lft forever
5: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:cc:3c:51 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fecc:3c51/64 scope link 
       valid_lft forever preferred_lft forever

Can someone please give me a tip on how to setup my bridge network on my Archlinux install?

Offline

#2 2022-07-01 18:47:20

stronnag
Member
Registered: 2011-01-25
Posts: 61

Re: Setup bridge network systemd-networkd

The following works for me:

$ cat ee-br0.netdev
[NetDev]
Name=br0
Kind=bridge

[Address]
ManageTemporaryAddress=true

$ cat ee-br0.network
[Match]
Name=br0

[Network]
DHCP=yes
MulticastDNS=yes
IPv6PrivacyExtensions=kernel

$ cat ee-eth0.network
[Match]
Name=eth*

[Network]
Bridge=br0
MulticastDNS=yes

[Link]
Multicast=true

MulticastDNS and IPv6 stuff optional

Offline

#3 2022-07-03 22:24:14

jenia
Member
Registered: 2014-07-12
Posts: 43

Re: Setup bridge network systemd-networkd

Hey

Thanks for the tip but unfortunately it didn't work - there was no internet connection and the eno0 card had an IP somehow whereas I wanted the br0 to have an IP and to route traffic through it.

Here is what I tried the setup I tried (as you suggeested):

[jenia@jenia network]$ files=(*)
[jenia@jenia network]$ 
[jenia@jenia network]$ 
[jenia@jenia network]$ for file in "${files[@]}";do echo "================="; echo $file; cat $file; echo ""; done
=================
ee-br0.netdev
[NetDev]
Name=br0
Kind=bridge

[Address]
ManageTemporaryAddress=true

=================
ee-br0.network
[Match]
Name=br0

[Network]
DHCP=yes

MulticastDNS=yes
IPv6PrivacyExtensions=kernel

=================
ee-eno0.network
[Match]
Name=eth*

[Network]
Bridge=br0
MulticastDNS=yes

[Link]
Multicast=true


[jenia@jenia network]$ 
[jenia@jenia network]$ 
[jenia@jenia network]$ pwd
/etc/systemd/network

If you have any more tips, it'd be greatly appreciated as you can imagine wink

Happy fourth of July wink (if you're in that part of the woods wink)

Offline

#4 2022-07-15 07:21:47

Grigorios
Member
Registered: 2021-01-10
Posts: 23

Re: Setup bridge network systemd-networkd

Hey, it could be a problem with your DHCP Server, maybe it is supplying addresses only to known mac addresses?
A second thing that comes to my mind is, if you first created the network device and restarted systemd-networkd to see if it got created and then added the network configuration without deleting the created br0 interface, systemd-networkd won't recreate the interface but use the existing without overwriting it's configuration. If that is the case, delete the br0 interface with $ip link delete br0 and then restart systemd-networkd.

Greetings

Grigorios

Last edited by Grigorios (2022-07-15 07:22:06)

Offline

#5 2022-07-26 01:00:43

jenia
Member
Registered: 2014-07-12
Posts: 43

Re: Setup bridge network systemd-networkd

Hey Grigorios. Thanks for all you kind help.

I noticed that there was a typo in my ee-eno0.network file. "Name" should have been en* not eth*  I corrected it and deleted the br0 bridge as you suggested. Here is the result:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 78:24:af:36:1f:b5 brd ff:ff:ff:ff:ff:ff
    altname enp0s25
    inet 192.168.1.123/24 brd 192.168.1.255 scope global dynamic noprefixroute eno1
       valid_lft 86348sec preferred_lft 75548sec
    inet6 fe80::7a24:afff:fe36:1fb5/64 scope link 
       valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:0f:9b:b6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether fe:8f:a3:0a:20:b2 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc8f:a3ff:fe0a:20b2/64 scope link 
       valid_lft forever preferred_lft forever

As you can see, the eno1 gets an IP but the internet is still not working for some reason. Also the bridge has no IP.

Any further pointers?

Offline

#6 2022-07-26 01:09:52

jenia
Member
Registered: 2014-07-12
Posts: 43

Re: Setup bridge network systemd-networkd

Here by the way are the contents of my networkd config files:

[jenia@jenia network]$ cat ee-br0.netdev 
[NetDev]
Name=br0
Kind=bridge


[Address]
ManageTemporaryAddress=true
[jenia@jenia network]$ 
[jenia@jenia network]$ 
[jenia@jenia network]$ 
[jenia@jenia network]$ cat ^C
[jenia@jenia network]$ cat ee-br0.network
[Match]
Name=br0

[Network]
DHCP=yes
[jenia@jenia network]$ 
[jenia@jenia network]$ 
[jenia@jenia network]$ 
[jenia@jenia network]$ cat ee-eno0.network
[Match]
Name=en*

[Network]
Bridge=br0
MulticastDNS=yes

[Link]
Multicast=true

Offline

#7 2022-07-31 08:21:16

Grigorios
Member
Registered: 2021-01-10
Posts: 23

Re: Setup bridge network systemd-networkd

Hello,

based on your ee-br0.network file, I can see that you have not configured an IP-address for your br0 device.
The idea is, that your internet facing device eno1 has no IP-address configured and works as a slave for the br0 device which has got an IP-address configured (via DHCP, or static).
So you should leave your eno1 interface not configured and only bind it to the br0 interface, which you already did in ee-eno0.network.
So what you should do is create a br0.network file and configure it with an IP-address and make sure that you do not have a .network file  that assigns eno1 with an IP-address.

Greetings

Grigorios

Offline

Board footer

Powered by FluxBB