diff --git a/network/setup-ip b/network/setup-ip index 907a295..2483298 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ -x /usr/sbin/xenstore-read ]; then XENSTORE_READ="/usr/sbin/xenstore-read" @@ -9,15 +9,16 @@ fi ip=`$XENSTORE_READ qubes-ip 2> /dev/null` if [ x$ip != x ]; then netmask=`$XENSTORE_READ qubes-netmask` - gateway=`$XENSTORE_READ qubes-gateway` + primary_dns=`$XENSTORE_READ qubes-gateway` secondary_dns=`$XENSTORE_READ qubes-secondary-dns` /sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255 /sbin/ifconfig $INTERFACE up - /sbin/route add -host $gateway dev $INTERFACE - /sbin/route add default gw $gateway + gw_ip=${ip%.*}.1 + /sbin/route add -host $gw_ip dev $INTERFACE + /sbin/route add default gw $gw_ip /sbin/ethtool -K $INTERFACE sg off /sbin/ethtool -K $INTERFACE tx off - echo "nameserver $gateway" > /etc/resolv.conf + echo "nameserver $primary_dns" > /etc/resolv.conf echo "nameserver $secondary_dns" >> /etc/resolv.conf network=$($XENSTORE_READ qubes-netvm-network 2>/dev/null) if [ "x$network" != "x" ]; then