跳到主要内容

7、网卡bond配置

网卡bond脚本

mode=1 主备脚本

脚本位置:

https://onedayxyy.cn/scripts/bond/Linux-eth-bond-mode1-2024.3.25.sh

Linux-eth-bond-mode1-2024.3.25.sh

# 业务网卡bond0:
cat > /etc/sysconfig/network-scripts/ifcfg-ens7f0 << EOF
DEVICE=ens7f0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
EOF

cat > /etc/sysconfig/network-scripts/ifcfg-ens9f0 << EOF
DEVICE=ens9f0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
EOF

cat >/etc/sysconfig/network-scripts/ifcfg-bond0 << EOF
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.130.xx.xx
NETMASK=255.255.255.0
GATEWAY=10.130.xx.1
IPV6INIT=no
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"
EOF