bond0配置

redhat bond0配置步骤:

1、IP地址配置
在系统安装的过程中,配置网卡,比如eth0
2、确定第二个网卡的接口
很多bond0是在系统后期制作的,为了确定第二个网线接在哪个网卡上,可以采用下面的方式进行
①激活其他网卡,比如eht7
ifconfig eht7 up
②使用ethtool工具查看网卡接口状态
[root@dmzapp04 network-scripts]# ethtool eth7
Settings for eth7:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 4
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes

③ Link detected: yes ----表示网卡已经接上网线


3、制作bond0,采用已经配置的网卡eth0作为配置模板
# cd /etc/sysconfig/network-scripts/
# cp ifcfg-eth0 ifcfg-bond0

①编辑ifcfg-bond0配置,如下所示:
[root@dmzapp04 network-scripts]# cat ifcfg-bond0
# Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe
DEVICE=bond0
BOOTPROTO=static
IPADDR=10.3.0.28
NETMASK=255.255.255.0
BROADCAST=10.3.0.255
NETWORK=10.3.0.0
GATEWAY=10.3.0.1
ONBOOT=yes
TYPE=Ethernet
USERCTL=no


②编辑eth0配置
[root@dmzapp04 network-scripts]# cat ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe
DEVICE=eth0
BOOTPROTO=none
#HWADDR=2C:44:FD:93:90:70
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
TYPE=Ethernet

③编辑eth7配置
[root@dmzapp04 network-scripts]# cat ifcfg-eth7
# Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe
DEVICE=eth7
BOOTPROTO=none
#HWADDR=2C:44:FD:93:90:71
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
TYPE=Ethernet

4、在/etc/modprobe.conf底下添加两行bond0的信息
[root@dmzapp04 network-scripts]# cat /etc/modprobe.conf

alias bond0 bonding
options bond0 miimon=100 mode=1 primary=eth0

备注:mode=0表示负载均衡,除了做bond0外,还需要做交换机端口绑定才能实现;mode=1表示主备模式,一般情况下都采用这种方式。

5、为了保证bond0随机启动,编辑/etc/rc.local,添加如下信息
modprobe bonding miimon=100 mode=1


相关文档
最新文档