bond网卡
[root@foundation15 ~]# virt-manager
[root@rhel6 ~]# service NetworkManager status
NetworkManager (pid 1258) is running...
[root@rhel6 ~]# service NetworkManager stop
Stopping NetworkManager daemon: [ OK ]
[root@rhel6 ~]# chkconfig NetworkManager off
[root@rhel6 ~]# cd /etc/sysconfig/network-scripts/
[root@rhel6 network-scripts]# ls ifcfg-*
ifcfg-eth0 ifcfg-lo
[root@rhel6 network-scripts]# cp ifcfg-eth0 ifcfg-bond0
[root@rhel6 network-scripts]# cp ifcfg-eth0 ifcfg-eth1
[root@rhel6 network-scripts]# cp ifcfg-eth0 ifcfg-eth2
[root@rhel6 network-scripts]# vim ifcfg-bond0
[root@rhel6 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System bond0"
IPADDR=192.168.122.40
NETMASK=255.255.255.0
BONDING_OPTS="mode=0" #负载均衡模式,当BONDING_OPTS="mode=1 primary=eth1"主从模式,eth1为主
[root@rhel6 network-scripts]# vim ifcfg-eth1
[root@rhel6 network-scripts]# vim ifcfg-eth2
[root@rhel6 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
MASTER=bond0
SLAVE=yes
[root@rhel6 network-scripts]# cat ifcfg-eth2
DEVICE=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth2"
MASTER=bond0
SLAVE=yes
[root@rhel6 network-scripts]# service network-functions restart
[root@rhel6 network-scripts]# yum -y install iptraf
[root@rhel6 network-scripts]# iptraf
[root@foundation15 ~]# ping 192.168.122.40
[root@rhel6 ~]# service NetworkManager status
NetworkManager (pid 1258) is running...
[root@rhel6 ~]# service NetworkManager stop
Stopping NetworkManager daemon: [ OK ]
[root@rhel6 ~]# chkconfig NetworkManager off
[root@rhel6 ~]# cd /etc/sysconfig/network-scripts/
[root@rhel6 network-scripts]# ls ifcfg-*
ifcfg-eth0 ifcfg-lo
[root@rhel6 network-scripts]# cp ifcfg-eth0 ifcfg-bond0
[root@rhel6 network-scripts]# cp ifcfg-eth0 ifcfg-eth1
[root@rhel6 network-scripts]# cp ifcfg-eth0 ifcfg-eth2
[root@rhel6 network-scripts]# vim ifcfg-bond0
[root@rhel6 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System bond0"
IPADDR=192.168.122.40
NETMASK=255.255.255.0
BONDING_OPTS="mode=0" #负载均衡模式,当BONDING_OPTS="mode=1 primary=eth1"主从模式,eth1为主
[root@rhel6 network-scripts]# vim ifcfg-eth1
[root@rhel6 network-scripts]# vim ifcfg-eth2
[root@rhel6 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
MASTER=bond0
SLAVE=yes
[root@rhel6 network-scripts]# cat ifcfg-eth2
DEVICE=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth2"
MASTER=bond0
SLAVE=yes
[root@rhel6 network-scripts]# service network-functions restart
[root@rhel6 network-scripts]# yum -y install iptraf
[root@rhel6 network-scripts]# iptraf
[root@foundation15 ~]# ping 192.168.122.40
本文来自希曼博客-www.ximan.tech,作者:希曼博客,转载请注明原文链接:https://www.cnblogs.com/lihuaichen/p/10128493.html

浙公网安备 33010602011771号