[arch-general] VLAN config works only partially

Rainer Dorsch ml at bokomoko.de
Sat Jan 22 17:40:38 UTC 2022


Hi,

I configured my network with multiple VLANs. I started with the description at

https://wiki.archlinux.org/title/VLAN#systemd-networkd



My current configuration:

[n3150 ~]# cat /etc/systemd/network/enp2s0.network
[Match]
Name=enp2s0

[Link]
ActivationPolicy=Manual

[Network]
Description=The unconfigured physical ethernet device

# In case of 'tagged only' setups, you probably don't need any IP
# configuration on the link without VLAN (or: default VLAN).
# For that just omit an [Address] section and disable all the
# autoconfiguration magic like this:
LinkLocalAddressing=no
LLDP=no
EmitLLDP=no
IPv6AcceptRA=no
IPv6SendRA=no


;these are arbitrary names, but must match the *.netdev and *.network files
VLAN=enp2s0.1
VLAN=enp2s0.2
VLAN=enp2s0.7

[DHCPv4]
UseDNS=false
[n3150 ~]# 

The VLAN config is simple, e.g.

n3150% cat /etc/systemd/network/enp2s0.2.netdev
[NetDev]
Name=enp2s0.2
Kind=vlan

[VLAN]
Id=2%                                                                                                                                                                                                                                       
n3150% cat /etc/systemd/network/enp2s0.2.network
[Match]
Name=enp2s0.2

[Network]
DHCP=yes
Hostname=n3150-wlan


n3150% 



The resulting routes:

n3150% ip route
default via 192.168.0.1 dev enp2s0.1 proto dhcp src 192.168.0.206 metric 1024 
default via 192.168.2.1 dev enp2s0.2 proto dhcp src 192.168.2.206 metric 1024 
default via 192.168.7.1 dev enp2s0.7 proto dhcp src 192.168.7.206 metric 1024 
default via 192.168.0.1 dev enp2s0 proto dhcp metric 20100 
192.168.0.0/24 dev enp2s0 proto kernel scope link src 192.168.0.206 metric 100 
192.168.0.0/24 dev enp2s0.1 proto kernel scope link src 192.168.0.206 metric 
1024 
192.168.0.1 dev enp2s0.1 proto dhcp scope link src 192.168.0.206 metric 1024 
192.168.2.0/24 dev enp2s0.2 proto kernel scope link src 192.168.2.206 metric 
1024 
192.168.2.1 dev enp2s0.2 proto dhcp scope link src 192.168.2.206 metric 1024 
192.168.7.0/24 dev enp2s0.7 proto kernel scope link src 192.168.7.206 metric 
1024 
192.168.7.1 dev enp2s0.7 proto dhcp scope link src 192.168.7.206 metric 1024 
n3150%

Unfortunately, the 192.168.0.* network is not reachable without explicitly 
deleting the routes for enp2s0:

[n3150 ~]# ping 192.168.0.30
PING 192.168.0.30 (192.168.0.30) 56(84) Bytes an Daten.
^C
--- 192.168.0.30 ping-Statistik ---
2 Pakete übertragen, 0 empfangen, 100% packet loss, time 1016ms

[n3150 ~]# ip route del default via 192.168.0.1 dev enp2s0 proto dhcp metric 
20100 
[n3150 ~]# ip route del 192.168.0.0/24 dev enp2s0 proto kernel scope link src 
192.168.0.206 metric 100
[n3150 ~]# ping 192.168.0.30
PING 192.168.0.30 (192.168.0.30) 56(84) Bytes an Daten.
64 Bytes von 192.168.0.30: icmp_seq=1 ttl=64 Zeit=0.699 ms
64 Bytes von 192.168.0.30: icmp_seq=2 ttl=64 Zeit=0.287 ms
^C
--- 192.168.0.30 ping-Statistik ---
2 Pakete übertragen, 2 empfangen, 0% packet loss, time 1010ms
rtt min/avg/max/mdev = 0.287/0.493/0.699/0.206 ms
[n3150 ~]# 

Can anybody tell how I can avoid the routes for enp2s0 get configured?

Thanks
Rainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20220122/710de6bb/attachment.sig>


More information about the arch-general mailing list