2011-04-23 02:31:54 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-07-13 20:16:04 +02:00
|
|
|
ip=`/usr/bin/xenstore-read qubes_ip 2> /dev/null`
|
2011-04-23 02:31:54 +02:00
|
|
|
if [ x$ip != x ]; then
|
2011-07-13 20:16:04 +02:00
|
|
|
netmask=`/usr/bin/xenstore-read qubes_netmask`
|
|
|
|
gateway=`/usr/bin/xenstore-read qubes_gateway`
|
|
|
|
secondary_dns=`/usr/bin/xenstore-read qubes_secondary_dns`
|
2011-04-23 02:32:54 +02:00
|
|
|
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255
|
|
|
|
/sbin/ifconfig $INTERFACE up
|
2011-09-16 00:06:14 +02:00
|
|
|
/sbin/route add -host $gateway dev $INTERFACE
|
|
|
|
/sbin/route add default gw $gateway
|
2011-08-02 19:27:45 +02:00
|
|
|
/sbin/ethtool -K $INTERFACE sg off
|
2013-01-08 03:03:44 +01:00
|
|
|
/sbin/ethtool -K $INTERFACE tx off
|
2011-04-23 02:31:54 +02:00
|
|
|
echo "nameserver $gateway" > /etc/resolv.conf
|
|
|
|
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
2011-08-01 15:06:01 +02:00
|
|
|
network=$(/usr/bin/xenstore-read qubes_netvm_network 2>/dev/null)
|
|
|
|
if [ "x$network" != "x" ]; then
|
|
|
|
gateway=$(/usr/bin/xenstore-read qubes_netvm_gateway)
|
|
|
|
netmask=$(/usr/bin/xenstore-read qubes_netvm_netmask)
|
|
|
|
secondary_dns=$(/usr/bin/xenstore-read qubes_netvm_secondary_dns)
|
|
|
|
echo "NS1=$gateway" > /var/run/qubes/qubes_ns
|
|
|
|
echo "NS2=$secondary_dns" >> /var/run/qubes/qubes_ns
|
|
|
|
/usr/lib/qubes/qubes_setup_dnat_to_ns
|
2011-08-18 15:49:49 +02:00
|
|
|
[ -x /rw/config/qubes_ip_change_hook ] && /rw/config/qubes_ip_change_hook
|
2011-08-01 15:06:01 +02:00
|
|
|
fi
|
|
|
|
|
2011-04-23 02:31:54 +02:00
|
|
|
fi
|