KVM配置BOND,BRIDGE,VLAN
配置mode=0,平衡負載模式,需要配置與網卡相連的交換機采取聚合模式。
配置mode=1,主備模式,無需配置交換機
配置 mode=6,平衡負載模式,但是不必配置交換機。
# modprobe --first-time bonding
# modinfo bonding
# systemctl stop NetworkManager
# systemctl disable NetworkManager
# cd /etc/sysconfig/network-scripts/
# cat ifcfg-ens33
DEVICE=ens33
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat ifcfg-ens37
DEVICE=ens37
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat ifcfg-bond0
DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.7.17
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=balance-rr miimon=100"
GATEWAY=192.168.7.1
DNS1=192.168.17.1
DNS2=192.168.17.3
# systemctl restart network
查看bond情況:
參考文檔:
https://www.kernel.org/doc/Documentation/networking/bonding.txt.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-using_channel_bonding
二.bond上橋接網卡:接上一節
# modprobe --first-time bridge
# modinfo bridge
# yum -y install bridge-utils
# cat ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BONDING_OPTS="mode=balance-rr miimon=100"
BRIDGE=brbond0
# cat ifcfg-brbond0
DEVICE=brbond0
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.7.17
PREFIX=24
GATEWAY=192.168.7.1
DNS1=192.168.17.1
DNS2=192.168.17.3
參考文檔:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-network_bridging_using_the_command_line_interface
三.配置VLAN
交換機上的端口必須設置成trunk模式
# modprobe --first-time 8021q
# modinfo 8021q
方法:
重啟網卡:systemctl restart network
KVM配置BOND,BRIDGE,VLAN