vm: more reliably set IP address of VM
This commit is contained in:
parent
7bf51a71e7
commit
4fd6cf98d5
@ -50,13 +50,6 @@ start()
|
|||||||
usleep 10
|
usleep 10
|
||||||
done
|
done
|
||||||
echo Back to life.
|
echo Back to life.
|
||||||
# Fix IP address (replace template IP with DispVM one)
|
|
||||||
IP=$(/usr/bin/xenstore-read qubes_ip 2>/dev/null)
|
|
||||||
if [ "$IP" ]; then
|
|
||||||
ip addr flush dev eth0
|
|
||||||
ip addr add dev eth0 $IP/32
|
|
||||||
ip route add dev eth0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MEM_CHANGE_THRESHOLD_KB=30000
|
MEM_CHANGE_THRESHOLD_KB=30000
|
||||||
|
@ -26,6 +26,12 @@ start()
|
|||||||
hostname $name
|
hostname $name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set IP address again (besides action in udev rules); this is needed by
|
||||||
|
# DispVM (to override DispVM-template IP) and in case when qubes_ip was
|
||||||
|
# called by udev before loading evtchn kernel module - in which case
|
||||||
|
# xenstore-read fails
|
||||||
|
INTERFACE=eth0 /usr/lib/qubes/setup_ip
|
||||||
|
|
||||||
if [ -e /dev/xvdb ] ; then
|
if [ -e /dev/xvdb ] ; then
|
||||||
mount /rw
|
mount /rw
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ip=`/usr/bin/xenstore-read qubes_ip`
|
ip=`/usr/bin/xenstore-read qubes_ip 2> /dev/null`
|
||||||
netmask=`/usr/bin/xenstore-read qubes_netmask`
|
|
||||||
gateway=`/usr/bin/xenstore-read qubes_gateway`
|
|
||||||
secondary_dns=`/usr/bin/xenstore-read qubes_secondary_dns`
|
|
||||||
if [ x$ip != x ]; then
|
if [ x$ip != x ]; then
|
||||||
|
netmask=`/usr/bin/xenstore-read qubes_netmask`
|
||||||
|
gateway=`/usr/bin/xenstore-read qubes_gateway`
|
||||||
|
secondary_dns=`/usr/bin/xenstore-read qubes_secondary_dns`
|
||||||
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255
|
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255
|
||||||
/sbin/ifconfig $INTERFACE up
|
/sbin/ifconfig $INTERFACE up
|
||||||
/sbin/route add default dev $INTERFACE
|
/sbin/route add default dev $INTERFACE
|
||||||
|
Loading…
Reference in New Issue
Block a user