Last active
October 15, 2019 20:28
-
-
Save pedrominicz/2c47652e7957ae4f19be2b2b77c718d3 to your computer and use it in GitHub Desktop.
Helper scripts for VMs on a virtual network.
This file contains hidden or 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/sh | |
ip link delete tap0 | |
ip link delete tap1 | |
ip link delete br0 |
This file contains hidden or 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/sh | |
qemu_cmd=(qemu-system-x86_64 | |
-m 1G | |
-enable-kvm | |
-cpu host | |
-device virtio-vga,xres=640,yres=480 | |
-serial mon:stdio | |
-nic user | |
-netdev tap,id=t1,ifname=tap1,script=no,downscript=no | |
-device e1000,netdev=t1,mac=12:34:00:00:00:01 | |
1.img) | |
sudo screen -dmS 'qemu.1' "${qemu_cmd[@]}" |
This file contains hidden or 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/sh | |
ip tuntap add tap0 mode tap | |
ip tuntap add tap1 mode tap | |
ip link set tap0 up promisc on | |
ip link set tap1 up promisc on | |
ip link add br0 type bridge | |
ip link set tap0 master br0 | |
ip link set tap1 master br0 | |
ip link set br0 up |
This file contains hidden or 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/sh | |
qemu_cmd=(qemu-system-x86_64 | |
-m 1G | |
-enable-kvm | |
-cpu host | |
-device virtio-vga,xres=640,yres=480 | |
-serial mon:stdio | |
-nic user | |
-netdev tap,id=t0,ifname=tap0,script=no,downscript=no | |
-device e1000,netdev=t0,mac=12:34:00:00:00:00 | |
0.img) | |
sudo screen -dmS 'qemu.0' "${qemu_cmd[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment