缺少 Netplan / systemd-networkd VLAN

缺少 Netplan / systemd-networkd VLAN

我尝试添加额外的虚拟 VLAN 接口,但它在 ifconfig 中不可见。

Netplan Config:
    network:
        version: 2
        renderer: networkd
        ethernets:
            enp0s31f6:
                addresses: [95.216.XX.XXX/32,"2a01:4f9:xx:XXXX::2/64"]
                gateway4: 95.216.xx.xx
                gateway6: fe80::1
                nameservers:
                    addresses: [192.168.122.1,213.133.98.98,213.133.99.99,"2a01:4f8:0:1::add:9999","2a01:4f8:0:1::add:10$
        vlans:
            enp0s31f6.4001:
                id: 4001
                link: enp0s31f6
                addresses: [192.168.3.20/24]
                mtu: 1400

此外,networkctl 不知道 VLAN 设备:

~ # networkctl
IDX LINK             TYPE               OPERATIONAL SETUP
  1 lo               loopback           carrier     unmanaged
  2 enp0s31f6        ether              routable    configured

2 links listed.

~ # 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: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 90:1b:0e:f3:88:4d brd ff:ff:ff:ff:ff:ff
    inet 95.216.xx.xxx peer 95.216.xx.xx/32 scope global enp0s31f6
       valid_lft forever preferred_lft forever
    inet6 2a01:4f9:xx:xxxx::2/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::921b:eff:fef3:884d/64 scope link
       valid_lft forever preferred_lft forever

~ # ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 90:1b:0e:f3:88:4d brd ff:ff:ff:ff:ff:ff

但运行文件包含 VLAN 设备配置

==> /run/systemd/network/10-netplan-enp0s31f6.4001.netdev <==
[NetDev]
Name=enp0s31f6.4001
MTUBytes=1400
Kind=vlan

[VLAN]
Id=4001

==> /run/systemd/network/10-netplan-enp0s31f6.4001.network <==
[Match]
Name=enp0s31f6.4001

[Network]
Address=192.168.3.20/24

==> /run/systemd/network/10-netplan-enp0s31f6.network <==
[Match]
Name=enp0s31f6

[Network]
Address=95.216.xx.xxx/32
Address=2a01:4f9:XXX:XXX::2/64
Gateway=95.216.xx.xx
Gateway=fe80::1
DNS=192.168.122.1
DNS=213.133.98.98
DNS=213.133.99.99
DNS=2a01:4f8:0:1::add:9999
DNS=2a01:4f8:0:1::add:1010
DNS=2a01:4f8:0:1::add:9898
VLAN=enp0s31f6.4001

有人能帮我解决我的问题吗?

亲切的问候

相关内容