我已经加载了绑定驱动程序:
gentooserver / # lsmod | grep bonding
bonding 114688 0
我有一个像这样配置的债券:
gentooserver / # cat /etc/systemd/network/bond0dhcp.network
[Match]
Name=bond0
[Network]
DHCP=yes
gentooserver / # cat /etc/systemd/network/bond0.netdev
[NetDev]
Name=bond0
Description=LAG/Bond to a switch
Kind=bond
[Bond]
Mode=802.3ad
gentooserver / # cat /etc/systemd/network/bond0.network
[Match]
Name=eno*
[Network]
Bond=bond0
ping4 不起作用:
gentooserver / # ping4 google.com
PING google.com (172.217.2.238) 56(84) bytes of data.
From 10.0.0.38 (10.0.0.38) icmp_seq=1 Destination Host Unreachable
From 10.0.0.38 (10.0.0.38) icmp_seq=2 Destination Host Unreachable
From 10.0.0.38 (10.0.0.38) icmp_seq=3 Destination Host Unreachable
From 10.0.0.38 (10.0.0.38) icmp_seq=4 Destination Host Unreachable
^C
--- google.com ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 152ms
pipe 5
gentooserver / # ping4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.0.0.38 icmp_seq=1 Destination Host Unreachable
From 10.0.0.38 icmp_seq=2 Destination Host Unreachable
From 10.0.0.38 icmp_seq=3 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 137ms
pipe 4
ping6 工作:
gentooserver / # ping6 google.com
PING google.com(dfw28s23-in-x0e.1e100.net (2607:f8b0:4000:817::200e)) 56 data bytes
64 bytes from dfw28s23-in-x0e.1e100.net (2607:f8b0:4000:817::200e): icmp_seq=1 ttl=54 time=30.8 ms
64 bytes from dfw28s23-in-x0e.1e100.net (2607:f8b0:4000:817::200e): icmp_seq=2 ttl=54 time=38.2 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 82ms
rtt min/avg/max/mdev = 30.797/34.479/38.162/3.687 ms
ifconfig:
gentooserver / # ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.0.0.38 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 2605:6000:1020:395::1712 prefixlen 128 scopeid 0x0<global>
inet6 fe80::ec4:7aff:feac:3d91 prefixlen 64 scopeid 0x20<link>
inet6 2605:6000:1020:395:ec4:7aff:feac:3d91 prefixlen 64 scopeid 0x0<global>
inet6 2605:6000:1020:395:b72f:e4c:4281:3a7b prefixlen 64 scopeid 0x0<global>
ether 0c:c4:7a:ac:3d:91 txqueuelen 1000 (Ethernet)
RX packets 2798 bytes 384543 (375.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2308 bytes 344136 (336.0 KiB)
TX errors 0 dropped 20 overruns 0 carrier 0 collisions 0
eno1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
inet 10.0.0.38 netmask 255.255.255.0 broadcast 10.0.0.255
ether 0c:c4:7a:ac:3d:91 txqueuelen 1000 (Ethernet)
RX packets 1352 bytes 187718 (183.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1369 bytes 186668 (182.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfb200000-fb27ffff
eno2: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
inet 10.0.0.38 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::a3b2:8bcf:adf8:8936 prefixlen 64 scopeid 0x20<link>
ether 0c:c4:7a:ac:3d:91 txqueuelen 1000 (Ethernet)
RX packets 1446 bytes 196825 (192.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 939 bytes 157468 (153.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfb100000-fb17ffff
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 655 bytes 79944 (78.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 655 bytes 79944 (78.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
网络控制:
gentooserver / # networkctl -a status
● 1: lo
Link File: /lib64/systemd/network/99-default.link
Network File: n/a
Type: loopback
State: carrier (unmanaged)
Address: 127.0.0.1
::1
● 2: eno1
Link File: /lib64/systemd/network/99-default.link
Network File: /etc/systemd/network/bond0.network
Type: ether
State: routable (configuring)
Path: pci-0000:06:00.0
Driver: igb
Vendor: Intel Corporation
Model: I210 Gigabit Network Connection
HW Address: 0c:c4:7a:ac:3d:91 (Super Micro Computer, Inc.)
Address: 10.0.0.38
Gateway: 10.0.0.1
● 3: eno2
Link File: /lib64/systemd/network/99-default.link
Network File: /etc/systemd/network/bond0.network
Type: ether
State: routable (configuring)
Path: pci-0000:07:00.0
Driver: igb
Vendor: Intel Corporation
Model: I210 Gigabit Network Connection
HW Address: 0c:c4:7a:ac:3d:91 (Super Micro Computer, Inc.)
Address: 10.0.0.38
fe80::a3b2:8bcf:adf8:8936
Gateway: 10.0.0.1
● 4: bond0
Link File: /lib64/systemd/network/99-default.link
Network File: /etc/systemd/network/bond0dhcp.network
Type: bond
State: routable (configured)
Driver: bonding
HW Address: 0c:c4:7a:ac:3d:91 (Super Micro Computer, Inc.)
Address: 10.0.0.36
10.0.0.38
2605:6000:1020:395::1712
2605:6000:1020:395:ec4:7aff:feac:3d91
2605:6000:1020:395:b72f:e4c:4281:3a7b
fe80::ec4:7aff:feac:3d91
Gateway: 10.0.0.1 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
10.0.0.1 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
fe80::1:1 (GIGA-BYTE TECHNOLOGY CO.,LTD.)
DNS: 10.0.0.1
2605:6000:1020:395:96de:80ff:fea8:8096
/进程:
gentooserver / # 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): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eno2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 0c:c4:7a:ac:3d:91
Slave queue ID: 0
Slave Interface: eno1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 0c:c4:7a:ac:3d:90
Slave queue ID: 0
IP地址:
gentooserver / # 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: eno1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether 0c:c4:7a:ac:3d:91 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.38/24 brd 10.0.0.255 scope global noprefixroute eno1
valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether 0c:c4:7a:ac:3d:91 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.38/24 brd 10.0.0.255 scope global noprefixroute eno2
valid_lft forever preferred_lft forever
inet6 fe80::a3b2:8bcf:adf8:8936/64 scope link tentative
valid_lft forever preferred_lft forever
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0c:c4:7a:ac:3d:91 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.38/24 brd 10.0.0.255 scope global noprefixroute bond0
valid_lft forever preferred_lft forever
inet 10.0.0.36/24 brd 10.0.0.255 scope global secondary dynamic bond0
valid_lft 4074sec preferred_lft 4074sec
inet6 2605:6000:1020:395::1712/128 scope global dynamic noprefixroute
valid_lft 4084sec preferred_lft 1384sec
inet6 2605:6000:1020:395:ec4:7aff:feac:3d91/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86396sec preferred_lft 14396sec
inet6 2605:6000:1020:395:b72f:e4c:4281:3a7b/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86396sec preferred_lft 14396sec
inet6 fe80::ec4:7aff:feac:3d91/64 scope link
valid_lft forever preferred_lft forever
ip-4路由:
gentooserver / # ip -4 route
default via 10.0.0.1 dev bond0 proto dhcp src 10.0.0.38 metric 204
default via 10.0.0.1 dev bond0 proto dhcp src 10.0.0.36 metric 1024
10.0.0.0/24 dev bond0 proto dhcp scope link src 10.0.0.38 metric 204
10.0.0.1 dev bond0 proto dhcp scope link src 10.0.0.36 metric 1024
ip-6路由:
gentooserver / # ip -6 route
::1 dev lo proto kernel metric 256 pref medium
2605:6000:1020:395::/64 dev bond0 proto ra metric 204 mtu 1500 pref medium
2605:6000:1020:395::/64 dev bond0 proto ra metric 1024 pref medium
fe80::/64 dev bond0 proto kernel metric 256 pref medium
fe80::/64 dev eno2 proto kernel metric 256 pref medium
ff00::/8 dev bond0 metric 256 pref medium
ff00::/8 dev eno1 metric 256 pref medium
ff00::/8 dev eno2 metric 256 pref medium
default via fe80::1:1 dev bond0 proto ra metric 204 mtu 1500 pref medium
default proto ra metric 1024 mtu 1500
nexthop via fe80::1:1 dev bond0 weight 1
nexthop via fe80::a263:91ff:fe7c:32a2 dev bond0 weight 1 pref medium
ip路由获取8.8.8.8:
gentooserver / # ip route get 8.8.8.8
8.8.8.8 via 10.0.0.1 dev bond0 src 10.0.0.38 uid 0
cache