cd /etc/sysconfig/network-scripts/
[
root@rgdefmdb1 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
NM_CONTROLLED=no #yes的话是不须要network restart,直接生效。
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.225.3.164
NETMASK=255.255.255.0
GATEWAY=10.225.3.254
DNS1=10.225.5.16
USERCTL=no
BONDING_OPTS="mode=1 miimon=100" #redhat6能够直接在这里配置,不须要在/etc/modprobe.d/dist.conf里面配置
[
root@rgdefmdb1 network-scripts]# cat ifcfg-bond1
DEVICE=bond1
NM_CONTROLLED=no
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.0.1
NETMASK=255.255.255.0
USERCTL=no
BONDING_OPTS="mode=1 miimon=100" #1是高可用,0是负载均衡
[
root@rgdefmdb1 network-scripts]# cat ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
USERCTL=no
[
root@rgdefmdb1 network-scripts]# cat ifcfg-eth1
DEVICE="eth1"
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
USERCTL=