You are not logged in.

#1 2024-12-25 04:05:16

Beemo
Member
Registered: 2024-12-20
Posts: 84

[Solved] Why IP assignment should be on Bridge not Ethernet

I have a server with soft-AP where Ethernet (where the Internet is) is bridged to the wireless AP. The server also needs access to the Internet. All the configuration examples show that IP assignment (e.g. DHCP) should be on the Bridge. NetworkManager will not allow assignment to ports (bridge slaves), but it seems not obvious whether it's possible for systemd-networkd.
What's the reason for it? Couldn't I have DHCP on the Ethernet interface since the DHCP server is on the Ethernet?

Last edited by Beemo (2024-12-25 11:11:28)

Offline

#2 2024-12-25 04:13:38

Guidatarch
Member
Registered: 2024-12-19
Posts: 1

Re: [Solved] Why IP assignment should be on Bridge not Ethernet

merry christmass bro


"Arch linux is the future"

Offline

#3 2024-12-25 09:19:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,681

Re: [Solved] Why IP assignment should be on Bridge not Ethernet

server with soft-AP where Ethernet (where the Internet is) is bridged to the wireless AP. The server also needs access to the Internet

Sanity check: are you just looking for https://wiki.archlinux.org/title/Networ … over_Wi-Fi or is there another reason for the bridge?

Offline

#4 2024-12-25 09:49:30

cryptearth
Member
Registered: 2024-02-03
Posts: 2,164

Re: [Solved] Why IP assignment should be on Bridge not Ethernet

cannot explain why it has to be this way, but here's my systemd-networkd setup

[main@main ~]$ ls -alFh /etc/systemd/network
insgesamt 28K
drwxr-xr-x 2 root root 4,0K 12. Mär 2024  ./
drwxr-xr-x 5 root root 4,0K 22. Dez 23:58 ../
-rw-r--r-- 1 root root   30 11. Okt 2023  10_br0.netdev
-rw-r--r-- 1 root root   30  5. Mär 2024  11_br1.netdev
-rw-r--r-- 1 root root   43 12. Mär 2024  20_lan.network
-rw-r--r-- 1 root root  121 14. Okt 2023  30_br0.network
-rw-r--r-- 1 root root   78 10. Mär 2024  31_br1.network
[main@main ~]$ cat /etc/systemd/network/10_br0.netdev 
[NetDev]
Name=br0
Kind=bridge
[main@main ~]$ cat /etc/systemd/network/11_br1.netdev 
[NetDev]
Name=br1
Kind=bridge
[main@main ~]$ cat /etc/systemd/network/20_lan.network 
[Match]
Name=enp42s0

[Network]
Bridge=br0
[main@main ~]$ cat /etc/systemd/network/30_br0.network 
[Match]
Name=br0

[Network]
DHCP=yes

[DHCPv4]
UseDomains=true

[DHCPv6]
UseDomains=true

[IPv6AcceptRA]
UseDomains=true
[main@main ~]$ cat /etc/systemd/network/31_br1.network 
[Match]
Name=br1

[Network]
ConfigureWithoutCarrier=yes
IgnoreCarrierLoss=yes

the second bridge is to play around with VMs without involving the main network or to test stuff like routing and forwarding and sharing and all that stuff
also: https://wiki.archlinux.org/title/System … _to_bridge

The Ethernet interface must not have DHCP or an IP address associated, as the bridge requires an interface to bind to with no IP address.

Last edited by cryptearth (2024-12-25 09:54:55)

Offline

#5 2024-12-25 11:09:41

Beemo
Member
Registered: 2024-12-20
Posts: 84

Re: [Solved] Why IP assignment should be on Bridge not Ethernet

Guidatarch wrote:

merry christmass bro

Merry Christmas

seth wrote:

Sanity check: are you just looking for https://wiki.archlinux.org/title/Networ … over_Wi-Fi or is there another reason for the bridge?

Yea I guess, I need regular Internet, not NAT like in nmcli dev wifi hotspot.

I found this stackexchange answer, the relevant part starts at the middle. Seems like it doesn't make sense when the Ethernet interface is part of the bridge.

Offline

Board footer

Powered by FluxBB