Ubuntu 18.04 已连接并运行但无法访问互联网(网络/接口)

Ubuntu 18.04 已连接并运行但无法访问互联网(网络/接口)

绑定正在运行,但无法访问互联网。希望我已提供所有必要的详细信息。

**kalidoss@kalidoss:~$ cat /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
#auto lo
#iface lo inet loopback

auto lo
iface lo inet loopback

#eth0 is manually configured, and slave to the “bond0” bonded NIC
auto enp1s0
iface enp1s0 inet manual
    bond-master bond0

#eth1 ditto, thus creating a 2-link bond.
auto enp5s0
iface enp5s0 inet manual
    bond-master bond0

# bond0 is the bonding NIC and can be used like any other normal NIC.
# bond0 is configured using static network information.
auto bond0
iface bond0 inet static
address 192.168.2.100
gateway 192.168.2.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8, 8.8.4.4
#dns-search google.com
bond-mode 1 #balance-tlb
bond-miimon 100
bond-lacp 1
bond-slaves enp1s0 enp5s0

kalidoss@kalidoss:~$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: enp1s0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:21:85:c7:d5:81
Slave queue ID: 0

Slave Interface: enp5s0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:e0:4d:08:1f:7a
Slave queue ID: 0    


kalidoss@kalidoss:~$ ifconfig
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::221:85ff:fec7:d581  prefixlen 64  scopeid 0x20<link>
        ether 00:21:85:c7:d5:81  txqueuelen 1000  (Ethernet)
        RX packets 316  bytes 25192 (25.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137  bytes 10257 (10.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp1s0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 00:21:85:c7:d5:81  txqueuelen 1000  (Ethernet)
        RX packets 22  bytes 3124 (3.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 4143 (4.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp5s0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 00:21:85:c7:d5:81  txqueuelen 1000  (Ethernet)
        RX packets 294  bytes 22068 (22.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 73  bytes 6114 (6.1 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 1250  bytes 79648 (79.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1250  bytes 79648 (79.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 

kalidoss@kalidoss:~$ 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 00:21:85:c7:d5:81 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 00:21:85:c7:d5:81 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 00:21:85:c7:d5:81 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::221:85ff:fec7:d581/64 scope link 
       valid_lft forever preferred_lft forever**

我已按照以下页面中的说明进行操作 https://help.ubuntu.com/community/UbuntuBonding

kalidoss@kalidoss:~$ dmesg | grep -i bond0
[    4.157741] bonding: bond0 is being created...
[    4.331301] IPv6: ADDRCONF(NETDEV_UP): bond0: link is not ready
[    4.378080] bond0: making interface enp5s0 the new active one
[    4.378359] bond0: Enslaving enp5s0 as an active interface with an up link
[    4.378468] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
[    4.402765] bond0: Enslaving enp1s0 as a backup interface with a down link
[    5.246473] bond0: option mode: unable to set because the bond device has slaves

相关内容