Skip to content

Instantly share code, notes, and snippets.

@rem7
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rem7/f96b1a3c9296ea963404 to your computer and use it in GitHub Desktop.
Save rem7/f96b1a3c9296ea963404 to your computer and use it in GitHub Desktop.
/usr/bin/startup.sh
#!/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