Sheng Yang 96e7e3d1ca CS-15175: Fix public interfaces of redundant router
We need to use ifup/ifdown to bring up the interfaces, because ifconfig don't
know the ip of the interface after we modify cloud-early-config to avoid
first start up of public interface.

Reviewed-by: Edison
2012-05-31 17:58:02 -07:00

13 lines
234 B
Plaintext

#!/bin/bash
set -e
ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist
while read i
do
ifdown $i
ifup $i
done < /tmp/iflist
ip route add default via [GATEWAY] dev eth2 && \
service dnsmasq restart