Adding startup code to linux
Since adding the bridging code in my linux machine I’ve had to manually execute the script that starts up the networking.
I’ve been wanting to figure out how to have it execute automatically. So today I looked at /etc/init.d/rc and found that the last thing this script does is executes /sbin/setup.sh if it is executable. Turns out it wasn’t there so I created it with:
/home/wink/bin/br
and made it executable (chmod 755 setup.sh) and change owner to root (chown root:root setup.sh). Rebooted and guess what all is well. For completeness br is
#!/bin/sh
set -x
brctl addbr br0
/etc/qemu-ifup eth0
chmod 666 /dev/net/tun
dhclient3 br0
This is the code from my notes on getting kvm running.