bond0网卡配置网卡
#!/bin/bash # #Usage: sh bond.sh [0|1] eth0 eth1 # #################################################### if [ $# -ne 3 ];then echo "Usage: sh bond.sh [0|1] eth0 eth1" exit 1 fi bondType=$1 eth0=$2 eth1=$3 bondType=$1 for eth in $eth0 $eth1 do cat>/etc/sysconfig/network-scripts/ifcfg-$eth<<eof TYPE="Ethernet" BOOTPROTO=none DEVICE="$eth" ONBOOT="yes" SLAVE=yes MASTER=bond0 eof done cat>/etc/sysconfig/network-scripts/ifcfg-bond$bondType<<eof DEVICE="bond$bondType" TYPE="Ethernet" BOOTPROTO=none ONBOOT="yes" BONDING_OPTS="mode=$bondType miimon=100" #IPADDR=192.168.1.32 #PREFIX=24 #GATEWAY=192.168.1.1 DNS1=114.114.114.114 eof systemctl restart network echo "Successfull"
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步