#!/bin/bash echo "Get MAC & IPs information ..." MAC_A="00:a0:f4:de:ad:cc" MAC_B="00:a0:f4:de:ad:cd" IP_A="192.168.33.188" MASK_A="255.255.255.0" GW_A="192.168.33.1" IP_B="3.11.33.188" MASK_B="255.255.255.0" GW_B="3.111.33.1" sleep 1 echo "Set DUAL interfaces down .." ifconfig eth2 0.0.0.0 down sleep 1 ifconfig eth3 0.0.0.0 down sleep 5 echo "Set MAC address ${MAC_A} to eth1 & eth2 interfaces .." ifconfig eth2 hw ether ${MAC_A} sleep 1 ifconfig eth3 hw ether ${MAC_B} sleep 5 echo "Set eth2 & eth3 interfaces up .." ifconfig eth2 up sleep 1 ifconfig eth3 up sleep 5 echo "Create br0 interface and add eth2 & eth3 ports .." brctl addbr br0 sleep 1 brctl addif br0 eth2 sleep 1 brctl addif br0 eth3 sleep 5 echo "Start bridge br0 ..." brctl stp br0 on sleep 5 echo "Switch bridge mode from stp to rstp ..." mstpctl setforcevers br0 rstp sleep 5 echo "Set br0 with IP=${IP_A} interface up .." ifconfig br0 ${IP_A} netmask ${MASK_A} up sleep 5 echo "RSTP ready for PTP configuration ..." ifconfig > /tmp/start_redundancy.ok sleep 1