From 510edfb0716b73fe81099ab9169b480ad45415b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 22 May 2014 01:36:15 +0200 Subject: [PATCH] network: setup NM connection when its active in the ProxyVM --- network/network-manager-prepare-conf-dir | 7 ++++--- network/setup-ip | 12 +++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/network/network-manager-prepare-conf-dir b/network/network-manager-prepare-conf-dir index 1704b01..c068bab 100755 --- a/network/network-manager-prepare-conf-dir +++ b/network/network-manager-prepare-conf-dir @@ -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 diff --git a/network/setup-ip b/network/setup-ip index 77b55af..a99fc77 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -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