From 4ef785a01683fa638149fb55fdfbfbb2d23a7671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 13 Aug 2014 08:09:44 +0200 Subject: [PATCH] network: use the same gateway IP generation method as backend Backend domain generates its IP address based on frontend IP, not settings given from dom0. So change frontend method to the same (for DispVM it makes a difference). Now "qubes-gateway" xenstore entry is basically primary DNS address only. --- network/setup-ip | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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