ubuntu18.04系统bond mode4的多网卡绑定测试
测试过程
虚拟机使用kvm创建,名称为bond-mode4,操作系统为ubuntu18.04
1、宿主机创建虚拟网桥,由于为测试用,并无实际的物理连接。
brctl addbr br-test1
brctl addbr br-test2
brctl addbr br-test3
brctl addbr br-test4
2、给虚拟机挂载虚拟网卡
virsh attach-interface --type bridge --source br-test1 vm_domain
virsh attach-interface --type bridge --source br-test2 vm_domain
virsh attach-interface --type bridge --source br-test3 vm_domain
virsh attach-interface --type bridge --source br-test4 vm_domain
3、使用kvm创建虚拟机bond-mode4
3、给bond-mode4的netplan配置
root@bond-mode4:/etc/netplan# cat 50-cloud-init.yaml
network:
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
eth2:
dhcp4: no
eth3:
dhcp4: no
bonds:
bond1:
dhcp4: no
optional: true
interfaces:
- eth0
- eth1
- eth2
- eth3
parameters:
mode: 802.3ad
version: 2
root@bond-mode4:/etc/netplan# 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: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond1 state UP group default qlen 1000
link/ether fa:16:3e:9c:dc:d3 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond1 state UP group default qlen 1000
link/ether fa:16:3e:9c:dc:d3 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond1 state UP group default qlen 1000
link/ether fa:16:3e:9c:dc:d3 brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond1 state UP group default qlen 1000
link/ether fa:16:3e:9c:dc:d3 brd ff:ff:ff:ff:ff:ff
6: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:cf:02:de brd ff:ff:ff:ff:ff:ff
inet 100.114.0.22/16 brd 100.114.255.255 scope global noprefixroute eth4
valid_lft forever preferred_lft forever
inet6 fe80::610:43eb:15d4:3b4d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
7: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether fa:16:3e:9c:dc:d3 brd ff:ff:ff:ff:ff:ff
inet 169.254.217.204/16 brd 169.254.255.255 scope link noprefixroute bond1
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fe9c:dcd3/64 scope link
valid_lft forever preferred_lft forever
由于bond1获取不到ip地址,所以ip地址为169.254
测试结论
从测试过程来看,可以直接配置多网卡的mode4,后续测试需要交换机端配合测试。
待续