在 ubuntu 18.04 中绑定已完成但没有互联网连接

在 ubuntu 18.04 中绑定已完成但没有互联网连接

我们在 /etc/netplan/ 中使用了以下内容

在 01-netcfg.yaml 文件中

network:
    version: 2
    renderer: networkd
    ethernets:
        enp1s0:
          match:
            macaddress: 00:21:85:c7:d5:81   
        enp5s0:
          match:
            macaddress: 00:e0:4d:08:1f:7a  

在 02-bondings.yaml 文件中

network:
    version: 2
    renderer: networkd
    bonds:
        bond0:
            interfaces: [enp1s0,enp5s0]
            addresses: [192.168.2.100/24]
            gateway4: 192.168.2.1
            parameters:
              mode: active-backup
              mii-monitor-interval: 100
              lacp-rate: fast
            mtu: 1500
            nameservers:
                addresses: [198.168.0.250] 

Netplan 调试没有错误,但没有互联网连接。

如果我们给出 ifconfig -a

bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
        inet 192.168.2.100  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::1ccf:81ff:fe56:ba5a  prefixlen 64  scopeid 0x20<link>
        ether 1e:cf:81:56:ba:5a  txqueuelen 1000  (Ethernet)
        RX packets 365  bytes 32687 (32.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 551  bytes 38956 (38.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp1s0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 1e:cf:81:56:ba:5a  txqueuelen 1000  (Ethernet)
        RX packets 331  bytes 28909 (28.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp5s0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 1e:cf:81:56:ba:5a  txqueuelen 1000  (Ethernet)
        RX packets 34  bytes 3778 (3.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 551  bytes 38956 (38.9 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 1101  bytes 89766 (89.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1101  bytes 89766 (89.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我们也尝试过这个链接,但结果是一样的 https://gist.github.com/PhilipSchmid/54e17f53c15e3bd2c922ec6ff9ee434f

如果我们给出 ip addr show

    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: enp1s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
    link/ether 1e:cf:81:56:ba:5a brd ff:ff:ff:ff:ff:ff
3: enp5s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UNKNOWN group default qlen 1000
    link/ether 1e:cf:81:56:ba:5a brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 1e:cf:81:56:ba:5a brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.100/24 brd 192.168.2.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::1ccf:81ff:fe56:ba5a/64 scope link 
       valid_lft forever preferred_lft forever

相关内容