linux配置bond


[root@slave ~]# cd  /etc/sysconfig/network-scripts
[root@slave network-scripts]# ls  
找以ifcfg-开头的配置文件
[root@slave network-scripts]# vim  ifcfg-eth0
[root@slave network-scripts]# cat  ifcfg-eth0
DEVICE=eth0               网口名eth0
TYPE=Ethernet            以太网接口
ONBOOT=yes              LINUX在启动时激活该网口
BOOTPROTO=none    使用什么协议激活网口
                                               none表示不使用任何协议
                                               static表示设置静态IP
                                               dhcp表示动态获取IP
MASTER=bond0         指定虚拟网口的名字
SLAVE=yes                  备用
 
[root@slave network-scripts]# vim  ifcfg-eth1
[root@slave network-scripts]# cat  ifcfg-eth1
DEVICE=eth1               网口名eth1
TYPE=Ethernet            以太网接口
ONBOOT=yes              LINUX在启动时激活该网口
BOOTPROTO=none    使用什么协议激活网口
                                              none表示不使用任何协议
                                              static表示设置静态IP
                                              dhcp表示动态获取IP
MASTER=bond0         指定虚拟网口的名字
SLAVE=yes                  备用
备注:eth0、eth1的MASTER(主人)是bond0,本身是属于从设备作为bond0的SLAVE(备用)
 
[root@slave network-scripts]# vim  ifcfg-bond0
[root@slave network-scripts]# cat  ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=IP
NETMASK=255.255.0.0
GATEWAY=网关
 
配置bonding
[root@slave network-scripts]# vim  /etc/modprobe.d/dist.conf
末尾增加以下两行
alias bond0 bonding
options bond0 miimon=100 mode=1
在/etc/rc.d/rc.local文件中加入下面语句,是系统启动自动运行。
ifenslave  bond0  eth0  eth1


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM