为什么我的 netplan 配置不起作用?

为什么我的 netplan 配置不起作用?

我使用的是 Ubuntu20 服务器及其默认的 Netplan。该服务器是 OVH 管理下的裸机,因此我对网络接口的更改控制非常有限。

我已经在那台电脑上安装了 cloudstack-management 和 cloudstack-agent 来试用。我可以创建虚拟机并使用 NFS 进行存储。在网络方面,本节文档中展示了如何在网络接口之间创建桥梁,以获得管理地址和到公共互联网的流量。

我已成功创建指向 eno2 的一座桥。因此,虚拟机和 cloudstack-management 都无法访问互联网。我无法下载 ISO 映像,也无法从外部 ping 我创建的虚拟机。

根据上述对 cloudbr1 的定义,网络在启动时无法加载,我必须进入救援模式来修复它。而且,由于没有任何公共互联网接口的参考,我无法下载任何 ISO 或授予对虚拟机的访问权限...

问:我的配置应该怎样?

我的 Netplan 配置:

network:
    version: 2
    ethernets:
        eno2:
            dhcp4: no
            addresses:
              - 192.168.0.1/16
        eno1:
            accept-ra: false
            addresses:
            - 2001:41d0:700:3cea::/56
            dhcp4: true
            match:
                macaddress: ac:1f:6b:df:50:78
            nameservers:
                addresses:
                - 2001:41d0:3:163::1
            routes:
            -   to: ::/0
                via: 2001:41d0:700:3cff:ff:ff:ff:ff
            -   to: 2001:41d0:700:3c00::/57
    bridges:
        cloudbr0:
            addresses: [192.168.1.1/16]
            gateway4: 192.168.255.255
            nameservers:
                addresses: [8.8.8.8]
            interfaces: [eno2]
            dhcp4: false
            dhcp6: false
            parameters:
                stp: false
                forward-delay: 0
        cloudbr1:
            interfaces: [eno1]  # Use eno1 as the physical interface for cloudbr1
            dhcp4: false
            dhcp6: false
            parameters:
                stp: false
                forward-delay: 0

ip a

    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 mq state UP group default qlen 1000
    link/ether ac:1f:6b:df:50:78 brd ff:ff:ff:ff:ff:ff
    inet xx.XXX.x.xxx/24 brd 51.195.5.255 scope global dynamic eno1
       valid_lft 86332sec preferred_lft 86332sec
    inet6 2001:41d0:700:3cea::/56 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::ae1f:6bff:fedf:5078/64 scope link 
       valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master cloudbr0 state UP group default qlen 1000
    link/ether ac:1f:6b:df:50:79 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/16 brd 192.168.255.255 scope global eno2
       valid_lft forever preferred_lft forever

ifconfig:

cloud0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        inet6 fe80::b0f4:27ff:fe83:f5ea  prefixlen 64  scopeid 0x20<link>
        ether b2:f4:27:83:f5:ea  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13  bytes 1054 (1.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cloudbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.1  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::503d:95ff:fec9:f267  prefixlen 64  scopeid 0x20<link>
        ether ac:1f:6b:df:50:79  txqueuelen 1000  (Ethernet)
        RX packets 36  bytes 3624 (3.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 38  bytes 3460 (3.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xx.XXX.xx.X  netmask 255.255.255.0  broadcast xx.XXX.xx.X
        ether ac:1f:6b:df:50:78  txqueuelen 1000  (Ethernet)
        RX packets 498  bytes 60973 (60.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 507  bytes 73778 (73.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.1  netmask 255.255.0.0  broadcast 192.168.255.255
        ether ac:1f:6b:df:50:79  txqueuelen 1000  (Ethernet)
        RX packets 37  bytes 4200 (4.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 38  bytes 3460 (3.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 53371  bytes 11301198 (11.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 53371  bytes 11301198 (11.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

相关内容