Redhat6.x bond配置

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 00:20   483   0
#!/bin/bash
cat >/etc/sysconfig/network-scripts/ifcfg-bond0<<EOF1
BOOTPROTO=static
DEVICE=bond0
IPADDR=bond对外服务IP地址
PREFIX=27子网掩码位数
GATEWAY=10.91.225.97
USERCTL=no
ONBOOT=yes
EOF1
cat >/etc/sysconfig/network-scripts/ifcfg-eth4<<EOF2
DEVICE=eth4 eth4表示绑定网卡中的一块网卡
PREFIX=27 子网掩码位数
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
ONBOOT=yes
EOF2
cat >/etc/sysconfig/network-scripts/ifcfg-eth5<<EOF3
DEVICE=eth5 eth5表示绑定网卡中的另一块网卡
PREFIX=27 子网掩码位数
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
ONBOOT=yes
EOF3
#配置bond模式1主备方式
cat >/etc/modprobe.d/bonding.conf<<EOF4
alias bond0 bonding
options bond0 miimon=100 mode=1 primary=eth4
EOF4
echo "ifenslave bond0 eth4 eth5">>/etc/rc.d/rc.local
echo "/etc/init.d/network restart">>/etc/rc.d/rc.local
chmod 550 /etc/rc.d/rc.local
chmod 550 /etc/rc.local
reboot
#如果bond0无效建议重启,多组bond修改以上参数(此例为bond mod0配置)
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP