You are not logged in.

#1 2023-06-12 16:49:49

justdanyul
Member
Registered: 2011-09-29
Posts: 133

Network bridge uncertainty and network resolution question [solved]

I got two separate NICs in my server, enp6s0 and enp4s0.

I want to use systemd-networkd to achieve the following:

- I want enp4s0 to automatically IPs (both v4 and v6) and when any other host tries to resolve on server.local, I want it to get an ip reflecting this interface
- I want enp6s0 to get assigned to a bridge, and I dont want the NIC itself to get assigned an IP (v4 or v6).

To achieve the latter, I followed this https://wiki.archlinux.org/title/System … _interface and created

/etc/systemd/network/25_mybridge0.netdev

[NetDev]
Name=mybridge0
Kind=bridge

/etc/systemd/network/10_bind.network

[Match]
Name=enp6s0

[Network]
Bridge=mybridge0

/etc/systemd/network/28_mybridge0.network

[Match]
Name=mybridge

[Network]
DHCP=ipv4

To try and force enp6s0 not to use dhcp I also added
/etc/systemd/network/20_wired.network

[Match]
Name=enp6s0

[Network]
DHCP=no

Now, the bridge is created. But, this is the end result

2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master mybridge0 state UP group default qlen 1000
    link/ether 58:11:22:9f:9f:a5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.165/24 brd 192.168.50.255 scope global dynamic noprefixroute enp6s0
       valid_lft 86353sec preferred_lft 75553sec
    inet6 fe80::16ee:549e:dc0f:e6cd/64 scope link 
       valid_lft forever preferred_lft forever
3: mybridge0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 02:69:03:4c:7a:39 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.50/24 metric 1024 brd 192.168.50.255 scope global dynamic mybridge0
       valid_lft 86348sec preferred_lft 86348sec
    inet6 fe80::69:3ff:fe4c:7a39/64 scope link 
       valid_lft forever preferred_lft forever
4: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 58:11:22:9f:9f:a4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.162/24 brd 192.168.50.255 scope global dynamic noprefixroute enp4s0
       valid_lft 86368sec preferred_lft 75568sec
    inet6 fe80::fd69:aac3:dc90:954e/64 scope link 
       valid_lft forever preferred_lft forever

Unfortunately it doesn't seem to work. The bridge does get created, but, enp6s0 gets IPs and seems to be the preferred route to my server

Even if I delete the IPs manually, using "ip address del ..." they go way, and shortly after, a new IP is assigned.

How do I stop this behaviour?


EDIT ---------------------------

Success. I had dhcpcd running next to Systemd-networkd, so dhcpcd was proving IPs regardless of my Systemd-networkd config.

Last edited by justdanyul (2023-06-13 08:36:29)

Offline

Board footer

Powered by FluxBB