configure_network.sh 767 B

123456789101112131415161718192021222324252627
  1. # Replace with your wired Ethernet interface name
  2. ETH=eno1
  3. sudo modprobe bridge
  4. sudo modprobe br_netfilter
  5. sudo sysctl -w net.bridge.bridge-nf-call-arptables=0
  6. sudo sysctl -w net.bridge.bridge-nf-call-ip6tables=0
  7. sudo sysctl -w net.bridge.bridge-nf-call-iptables=0
  8. sudo ip tuntap add name tap0 mode tap user $USER
  9. sudo brctl addbr br0
  10. sudo brctl addif br0 tap0
  11. sudo brctl addif br0 $ETH
  12. sudo ip link set tap0 up
  13. sudo ip link set $ETH up
  14. sudo ip link set br0 up
  15. # This connects your host system to the internet, so you can use it
  16. # at the same time you run the examples.
  17. sudo dhcpcd br0
  18. sudo mkdir -p /usr/local/etc/qemu
  19. sudo mkdir -p /etc/qemu
  20. sudo sh -c 'echo "allow br0" > /usr/local/etc/qemu/bridge.conf'
  21. sudo sh -c 'echo "allow br0" > /etc/qemu/bridge.conf'