新建文件:/etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 YeWLinux联盟 ONBOOT=yes YeWLinux联盟 BOOTPROTO=static YeWLinux联盟 IPADDR=192.168.7.242 YeWLinux联盟 NETMASK=255.255.255.0 YeWLinux联盟 NETWORK=192.168.7.0 YeWLinux联盟 BROADCAST=192.168.7.255 GATEWAY=192.168.7.1 修改网卡配置文件: /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes YeWLinux联盟 BOOTPROTO=static YeWLinux联盟 /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 ONBOOT=yes YeWLinux联盟 BOOTPROTO=static YeWLinux联盟 修改/etc/modprobe.conf,在最后面加入以下两行: alias bond0 bonding YeWLinux联盟 options bond0 miimon=100 mode=0 修改/etc/rc.d/rc.local,在最后面加入以下行: ifenslave bond0 eth0 eth1 设置完成后重起启动。 说明: miimon=100 miimon 是指多久時間要檢查網路一次,單位是ms(毫秒) 這邊的100,是100ms,即是0.1秒 YeWLinux联盟 意思是假設其中有一條網路斷線,會在0.1秒內自動備援 mode 共有七種(0~6) YeWLinux联盟 mode=0:平衡負載模式,有自動備援,但需要"Switch"支援及設定。 YeWLinux联盟 mode=1:自動備援模式,其中一條線若斷線,其他線路將會自動備援。 YeWLinux联盟 mode=6:平衡負載模式,有自動備援,不需要"Switch"支援及設定。 YeWLinux联盟 也就是一般的Switching Hub就可以了!
|