357759147f
Apparently vif frontend has broken sg implementation; we already worked around it in init.d script via ethtool; now do the same in setup_ip. It is relevant when attaching firewallvm to a different netvm on the fly.
25 lines
960 B
Bash
Executable File
25 lines
960 B
Bash
Executable File
#!/bin/sh
|
|
|
|
ip=`/usr/bin/xenstore-read qubes_ip 2> /dev/null`
|
|
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 up
|
|
/sbin/route add default dev $INTERFACE
|
|
/sbin/ethtool -K $INTERFACE sg off
|
|
echo "nameserver $gateway" > /etc/resolv.conf
|
|
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
|
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
|
|
fi
|
|
|
|
fi
|