network-proxy-setup.sh 641 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