Sunday, January 17, 2016

Qemu bridging sorted

My original idea was to put a script in $HOME/bin which would start tap interfaces on demand.

That ran into snags when the echo 1 >/proc commands would give me permission errors.

Then I had the idea -make everything permanent and throw it all into /etc/rc.local.

Not the most elegant solution -but at least now I have six guarenteed tap interfaces to work with!

here's the code to put in /etc/rc.local (warning, make sure your distro supports /etc/rc.local..many newer ones may not);

 echo 1 > /proc/sys/net/ipv4/ip_forward
 echo 1 > /proc/sys/net/ipv4/conf/wlan0/proxy_arp

for x in {0..5}
 do
  tunctl -u random 
  sudo ip link set tap$x up
  echo 1 > /proc/sys/net/ipv4/conf/tap$x/proxy_arp
  route add -host 192.168.200.2$x dev tap$x
done

exit 0
===
Rebooted, works for me! So far, at least.

My next problem to work out involves figuring out how to kill headless qemu sessions (x86 doesn't give any output when done with -nographic).

No comments:

automating zfs mounts -a quick and very dirty script

 #!/bin/sh for x in obj xsrc src pkgsrc pkgsrc/distfiles pkgsrc/packages pkg         do zfs create ext/$x zfs set mountpoint=/usr/$x ext/$x ...