Moxa V2403-C3-W-T Руководство по программной части (Linux) онлайн [21/90] 170744

Moxa V2403-C3-W-T Руководство по программной части (Linux) онлайн [21/90] 170744
V2403 Series Linux Software Managing Communications
3-6
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
NAME=bonding
PATH=/bin:/usr/bin:/sbin:/usr/sbin
case "$1" in
start)
# to set ethX interfaces as slave the bond0 must have an ip
if [ "$2" == "" ]; then
$0
exit 1
fi
echo "Starting bonding service: $NAME."
modprobe bonding mode=1 miimon=100 # load bonding module
ifdown eth2 # putting down eth2
ifdown eth1 # putting down eth1
ifconfig bond0 hw ether 00:90:E8:00:00:60 # change mac address
ifconfig bond0 $2 netmask 255.255.255.0 up # set ip address
ifenslave bond0 eth2 # set eth2 in slave for bond0
ifenslave bond0 eth1 # set eth1 in slave for bond0
;;
stop)
echo "Stopping bonding service: $NAME"
ifenslave -d bond0 eth2 # release eth2 from bond0
ifenslave -d bond0 eth1 # release eth1 from bond0
ifconfig bond0 down # putting down bond0
modprobe -r bonding # unload bonding module
ifup eth2
ifup eth1
;;
restart)
$0 stop
$0 start $2
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart} [ip address]"
exit 1
;;
esac
exit 0

Содержание

Похожие устройства

Скачать