network: setup NM connection when its active in the ProxyVM

This commit is contained in:
Marek Marczykowski-Górecki 2014-05-22 01:36:15 +02:00
parent 486b148a08
commit 510edfb071
2 changed files with 15 additions and 4 deletions

View File

@ -10,9 +10,10 @@ fi
# Do not manage xen-provided network devices
unmanaged_devices=mac:fe:ff:ff:ff:ff:ff
for mac in `xenstore-ls device/vif | grep mac | cut -d= -f2 | tr -d '" '`; do
unmanaged_devices="$unmanaged_devices;mac:$mac"
done
#for mac in `xenstore-ls device/vif | grep mac | cut -d= -f2 | tr -d '" '`; do
# unmanaged_devices="$unmanaged_devices;mac:$mac"
#done
sed -i -e "s/^unmanaged-devices=.*/unmanaged-devices=$unmanaged_devices/" /etc/NetworkManager/NetworkManager.conf
sed -i -e "s/^plugins=.*/plugins=keyfile,ifcfg-rh/" /etc/NetworkManager/NetworkManager.conf
exit 0

View File

@ -25,5 +25,15 @@ if [ x$ip != x ]; then
# XXX: Backward compatibility
[ -x /rw/config/qubes_ip_change_hook ] && /rw/config/qubes_ip_change_hook
fi
if [ -f /var/run/qubes-service/network-manager ]; then
cat > /etc/sysconfig/network-scripts/ifcfg-$INTERFACE <<__EOF__
DEVICE=$INTERFACE
IPADDR=$ip
NETMASK=255.255.255.255
NETWORK=$ip
ONBOOT=yes
GATEWAYDEV=$INTERFACE
GATEWAY=$gateway
__EOF__
fi
fi