#!/bin/bash
em1='/etc/sysconfig/network-scripts/ifcfg-em1'
em2='/etc/sysconfig/network-scripts/ifcfg-em2'
bond0='/etc/sysconfig/network-scripts/ifcfg-bond0'
mod='/etc/modprobe.d/dist.conf'
rc='/etc/rc.local'
cat > $em1 <<EOF
DEVICE=em1
ONBOOT=yes
BOOTPROTO=none
EOF
cat > $em2 <<EOF
DEVICE=em2
ONBOOT=yes
BOOTPROTO=none
EOF
cat > $bond0 <<EOF
DEVICE=bond0
BOOTPROTO=static
NETMASK=xxxxxxx
NETMASK=xxxxxxx
GATEWAY=xxxxxxxxx
ONBOOT=yes
TYPE=Ethernet
BONDING_OPTS="mode=4 xmit_hash_policy=layer3+4 miimon=100"
EOF
cat >> $mod <<EOF
alias bond0 bonding
EOF
cat >> $rc <<EOF
ifenslave bond0 em1 em2
EOF
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。