network-proxy-setup.sh 646 B

123456789101112131415
  1. #!/bin/sh
  2. # Setup gateway for all the VMs this netVM is serviceing...
  3. network=$(/usr/bin/xenstore-read qubes-netvm-network 2>/dev/null)
  4. if [ "x$network" != "x" ]; then
  5. gateway=$(/usr/bin/xenstore-read qubes-netvm-gateway)
  6. netmask=$(/usr/bin/xenstore-read qubes-netvm-netmask)
  7. secondary_dns=$(/usr/bin/xenstore-read qubes-netvm-secondary-dns)
  8. modprobe netbk 2> /dev/null || modprobe xen-netback
  9. echo "NS1=$gateway" > /var/run/qubes/qubes-ns
  10. echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns
  11. /usr/lib/qubes/qubes-setup-dnat-to-ns
  12. echo "1" > /proc/sys/net/ipv4/ip_forward
  13. /sbin/ethtool -K eth0 sg off || :
  14. fi