- 论坛徽章:
- 0
|
我安装的redhat AS 5
服务器上有两块网卡eth0和eth1,想绑定成一块bond0,从网上下了个脚本,不太好用啊,做完后bond0一直起不来,说什么bond0似乎不存在,请大侠们帮帮忙!
附脚本zz~~:
#!/bin/sh
clear
echo ''
echo ''
echo 'Network Card Port Bond For Red Hat AS3'
echo ''
echo 'Input New VIP'
read vip
echo 'Input New VIP Netmask:'
read netmask
echo 'Input New Gateway:'
read gateway
echo 'Input New VIP Network:'
read network
echo 'Input New VIP Broadcast 192.168.1.255)'
read broadcast
echo ''
echo ''
echo 'Begin Bonding...'
echo 'Write to kernel...'
echo 'alias bond0 bonding' >> /etc/modules.conf
cho 'Create VIP...'
echo 'DEVICE=bond0' > /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'IPADDR='$vip >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'NETMASK='$netmask >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'GATEWAY='$gateway >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'NETWORK='$network >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'BROADCAST='$broadcast >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'ONBOOT=yes' >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'USERCTL=no' >> /etc/sysconfig/network-scripts/ifcfg-bond0
echo 'Set Network Member eth2...'
echo 'DEVICE=eth2' > /etc/sysconfig/network-scripts/ifcfg-eth2
echo 'ONBOOT=yes' >> /etc/sysconfig/network-scripts/ifcfg-eth2
echo 'MASTER=bond0' >> /etc/sysconfig/network-scripts/ifcfg-eth2
echo 'SLAVE=yes' >> /etc/sysconfig/network-scripts/ifcfg-eth2
echo 'BOOTPROTO=none' >> /etc/sysconfig/network-scripts/ifcfg-eth2
echo 'USERCTL=no' >> /etc/sysconfig/network-scripts/ifcfg-eth2
echo 'Set Network Member eth3...'
echo 'DEVICE=eth3' > /etc/sysconfig/network-scripts/ifcfg-eth3
echo 'ONBOOT=yes' >> /etc/sysconfig/network-scripts/ifcfg-eth3
echo 'MASTER=bond0' >> /etc/sysconfig/network-scripts/ifcfg-eth3
echo 'SLAVE=yes' >> /etc/sysconfig/network-scripts/ifcfg-eth3
echo 'BOOTPROTO=none' >> /etc/sysconfig/network-scripts/ifcfg-eth3
echo 'USERCTL=no' >> /etc/sysconfig/network-scripts/ifcfg-eth3
echo 'view network config...'
ifconfig eth2 up
ifconfig eth3 up
ifconfig
echo ''
echo ''
echo 'Restart Service....'
service network restart
echo ''
echo ''
echo 'Test port Bond,Waiting...'
ping 61.139.2.69
# vi /etc/rc.d/rc.local
加入两行
ifenslave bond0 eth0 eth1
route add -net 172.31.3.254 netmask 255.255.255.0 bond0 |
|