网卡有一定的瓶颈,是物理硬件。
**配置网络桥接
**配置 bond 网络接口
**配置 team 网络接口
bond网络接口配置:
简单的说,bonding就是把多个物理网络接口绑定到一起,使它们就像一个网络接口那样运行。 通过Bonding技术,可以实现网口冗余,负载均衡,从而达到高可用高可靠的目的。
选择 Linux 以太网绑定模式:
模式 0 ( 平衡轮循 ) - 轮循策略 , 所有接口都使用采用轮循方式在所有 Slave 中传输封包 ; 任何 Slave 都可以接收。
模式 1 ( 主动备份 ) - 容错。一次只能使用一个 Slave 接口, 但是如果该接口出现故障 , 另一个Slave 将接替它。
模式 3 ( 广播 ) - 容错。所有封包都通过所有 Slave 接口广播。
首先在真机打开virt-manager给desktop添加两块网卡。
[kiosk@foundation84 Desktop]$ su - 切换到超级用户
Password:
Last login: Thu May 17 10:55:36 CST 2018 on pts/2
Last failed login: Thu May 17 10:57:57 CST 2018 from 172.25.254.121 on ssh:notty
There was 1 failed login attempt since the last successful login.
ABRT has detected 2 problem(s). For more info run: abrt-cli list --since 1526525736
[root@foundation84 ~]# virt-manager 打开虚拟机管理命令
添加网卡:
网卡已经添加成功:
在虚拟机的三个shell中操作:(实验都是在desktop虚拟机操作,只是开了三个shell)
A:配置 bond 网络接口
[root@foundation176 Desktop]# ifconfig 查看时没有bond0网卡
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 52:54:00:a3:bd:a3 txqueuelen 1000 (Ethernet)
RX packets 2010 bytes 156554 (152.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 108 bytes 11595 (11.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 52:54:00:af:54:5f txqueuelen 1000 (Ethernet)
RX packets 1594 bytes 111905 (109.2 KiB)
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
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 0 (Local Loopback)
RX packets 23 bytes 2196 (2.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23 bytes 2196 (2.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@foundation176 Desktop]# nmcli connection add con-name bond0 type bond mode active-backup ip4 172.25.254.121/24 添加bond0
Connection 'bond0' (84d66bb7-0355-4e30-8d06-65e9e34113ba) successfully added.
[root@foundation176 Desktop]# ifconfig 查看已经成功添加
nm-bond: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 172.25.254.121 netmask 255.255.255.0 broadcast 172.25.254.255
ether 4e:55:dc:7f:f4:11 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
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
[root@foundation176 Desktop]# nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0 添加两块网卡,因为打开监控没有网卡为其服务
Connection 'eth0' (295663a8-4d73-44df-a7de-123d2a94b49f) successfully added.
[root@foundation176 Desktop]# nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
Connection 'eth1' (9aba4da4-c36f-4667-8ddf-66dcea0d1fa3) successfully added.
[root@foundation176 Desktop]# ping 172.25.254.121 ping网可以ping的通
PING 172.25.254.121 (172.25.254.121) 56(84) bytes of data.
64 bytes from 172.25.254.121: icmp_seq=1 ttl=64 time=0.043 ms
[root@foundation176 Desktop]# ifconfig eth0 down 将eth0关闭,则eth1会出来顶替eth0的工作
[root@foundation176 Desktop]# ifconfig eth0 up 将etho打开,则eth0作为备份闲置,解决了网突然坏掉的情况
添加bond接口:
添加两块网卡,测试一块网卡坏掉的情况
B进行监控:
[root@localhost ~]# cat /proc/net/bonding/nm-bond 只有添加了bond之后才可以查看到信息
Ethernet Channel Bonding Driver: v3.7.1 (April