Last active
August 29, 2015 14:08
-
-
Save rem7/f96b1a3c9296ea963404 to your computer and use it in GitHub Desktop.
/usr/bin/startup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ifconfig | |
echo 'waiting for eth0 and eth1' | |
/usr/bin/pipework --wait -i eth0 | |
echo 'found eth0' | |
/usr/bin/pipework --wait -i eth1 | |
echo 'found eth1' | |
echo '************ env ************' | |
env | |
echo '************ env ************' | |
echo 'building bridge br0' | |
sudo /sbin/brctl addbr br0 | |
echo 'adding eth0 -- /sbin/brctl addif br0 eth0' | |
sudo /sbin/brctl addif br0 eth0 | |
echo 'adding eth1 -- /sbin/brctl addif br0 eth1' | |
sudo /sbin/brctl addif br0 eth1 | |
echo 'deleting default route - ip route del 100.68.0.0/16 dev eth0' | |
sudo /sbin/ip route del 100.68.0.0/16 dev eth0 | |
# add route through bridge | |
echo 'deleting default route through bridge - ip addr add 100.68.0.100/16 dev br0' | |
sudo /sbin/ip addr add 100.68.0.100/16 dev br0 | |
echo 'bridge br0 up!' | |
sudo /sbin/ifconfig br0 up | |
echo 'done.' | |
tail -f /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment