ubuntu 18 网卡绑定不工作

ubuntu 18 网卡绑定不工作

我在 ubuntu 18 中遇到了一些聚合网卡问题。我无法让它工作。它无法 ping 通,也无法 ping 通。

**Netplan config:**
*network:
    bonds:
        bond0:
            addresses:
            - 192.168.1.5/24
            interfaces:
            - enp2s0f0
            - enp2s0f1
            nameservers: {}
            parameters:
                lacp-rate: fast
                mode: 802.3ad
                transmit-hash-policy: layer2*

**ip a:**
*4: enp2s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 36:bf:72:43:e1:7b brd ff:ff:ff:ff:ff:ff
5: enp2s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 36:bf:72:43:e1:7b brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 36:bf:72:43:e1:7b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.5/24 brd 192.168.1.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::34bf:72ff:fe43:e17b/64 scope link 
       valid_lft forever preferred_lft forever*

**cat /proc/net/bonding/bond0** 
*Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation

    Transmit Hash Policy: layer2 (0)
    MII Status: up
    MII Polling Interval (ms): 100
    Up Delay (ms): 0
    Down Delay (ms): 0
    802.3ad info
    LACP rate: fast
    Min links: 0
    Aggregator selection policy (ad_select): stable
    System priority: 65535
    System MAC address: 36:bf:72:43:e1:7b
    Active Aggregator Info:
        Aggregator ID: 1
        Number of ports: 1
        Actor Key: 9
        Partner Key: 1
        Partner Mac Address: 00:00:00:00:00:00
    Slave Interface: enp2s0f1
    MII Status: up
    Speed: 1000 Mbps
    Duplex: full
    Link Failure Count: 1
    Permanent HW addr: 00:1b:21:ce:47:47
    Slave queue ID: 0
    Aggregator ID: 1
    Actor Churn State: none
    Partner Churn State: churned
    Actor Churned Count: 0
    Partner Churned Count: 2
    details actor lacp pdu:
        system priority: 65535
        system mac address: 36:bf:72:43:e1:7b
        port key: 9
        port priority: 255
        port number: 1
        port state: 79
    details partner lacp pdu:
        system priority: 65535
        system mac address: 00:00:00:00:00:00
        oper key: 1
        port priority: 255
        port number: 1
        port state: 1
    Slave Interface: enp2s0f0
    MII Status: up
    Speed: 1000 Mbps
    Duplex: full
    Link Failure Count: 1
    Permanent HW addr: 00:1b:21:ce:47:46
    Slave queue ID: 0
    Aggregator ID: 2
    Actor Churn State: churned
    Partner Churn State: churned
    Actor Churned Count: 2
    Partner Churned Count: 2
    details actor lacp pdu:
        system priority: 65535
        system mac address: 36:bf:72:43:e1:7b
        port key: 9
        port priority: 255
        port number: 2
        port state: 71
    details partner lacp pdu:
        system priority: 65535
        system mac address: 00:00:00:00:00:00
        oper key: 1
        port priority: 255
        port number: 1
        port state: 1*



**dmesg | grep bond0:**
*[   22.504377] IPv6: ADDRCONF(NETDEV_UP): bond0: link is not ready
[   22.898724] bond0: Enslaving enp2s0f1 as a backup interface with a down link
[   23.290738] bond0: Enslaving enp2s0f0 as a backup interface with a down link
[   25.732090] bond0: link status definitely up for interface enp2s0f1, 1000 Mbps full duplex
[   25.732094] bond0: Warning: No 802.3ad response from the link partner for any adapters in the bond
[   25.732104] bond0: first active interface up!
[   25.732118] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
[   26.252098] bond0: link status definitely up for interface enp2s0f0, 1000 Mbps full duplex
[  478.581700] bond0: link status definitely down for interface enp2s0f1, disabling it
[  478.581707] bond0: first active interface up!
[  482.742094] bond0: link status definitely up for interface enp2s0f1, 1000 Mbps full duplex
[  484.198092] bond0: link status definitely down for interface enp2s0f0, disabling it
[  484.198096] bond0: first active interface up!
[  487.942057] bond0: link status definitely up for interface enp2s0f0, 1000 Mbps full duplex**

**systemctl status networking:**
*● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: active (exited) 
     Docs: man:interfaces(5)
  Process: 1546 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
  Process: 1525 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=1/FAILURE)
 Main PID: 1546 (code=exited, status=0/SUCCESS)
Oct 09 08:59:33 srv5 systemd[1]: Starting Raise network interfaces...
Oct 09 08:59:33 srv5 systemd[1]: Started Raise network interfaces.*

如果您需要任何详细信息,请告诉我。T haks。

相关内容