Guest User

QEMU ifup

a guest
Feb 8th, 2016
423
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. if [ -z "$(ip addr | grep vmtap0)" ];
  4. then
  5.     echo No vmtap0 interface, creating...
  6.  
  7.     # No vmtap0 yet.
  8.     ip tuntap add mode tap vmtap0
  9.     sleep 0.5s
  10. else
  11.     echo Using existing vmtap0 interface...
  12. fi
  13.  
  14. # Add to br0
  15. if [ -z "$(brctl show br0 | grep vmtap0)" ];
  16. then
  17.     echo Adding vmtap0 to bridge...
  18.     brctl addif br0 vmtap0
  19.     sleep 0.5s
  20. fi
  21.  
  22. # Up vmtap0
  23. echo Upping vmtap0 link...
  24. ip link set vmtap0 up
  25. sleep 0.5s
RAW Paste Data