免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1357 | 回复: 1
打印 上一主题 下一主题

关于双网卡绑定 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-20 15:23 |只看该作者 |倒序浏览
我安装的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 Broadcast192.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

论坛徽章:
0
2 [报告]
发表于 2007-09-21 11:10 |只看该作者
怎么每人理啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP