network: do not use ifcfg-rh NM plugin

Apparently eth0 in ProxyVM can be configured using plain keyfile plugin,
which is present on all distributions.
This commit is contained in:
Marek Marczykowski-Górecki 2014-11-09 05:31:22 +01:00
parent cadb102781
commit 7027633e80
2 changed files with 18 additions and 9 deletions

View File

@ -14,6 +14,6 @@ unmanaged_devices=mac:fe:ff:ff:ff:ff:ff
# 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
sed -i -e "s/^plugins=.*/plugins=keyfile/" /etc/NetworkManager/NetworkManager.conf
exit 0

View File

@ -32,14 +32,23 @@ if [ x$ip != x ]; then
[ -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
cat > /etc/NetworkManager/system-connections/qubes-uplink-$INTERFACE <<__EOF__
[802-3-ethernet]
duplex=full
[connection]
id=VM uplink $INTERFACE
uuid=de85f79b-8c3d-405f-a652-cb4c10b4f9ef
type=802-3-ethernet
[ipv6]
method=ignore
[ipv4]
method=manual
dns=$gateway;$secondary_dns
address1=$ip/32,$gateway
may-fail=false
__EOF__
fi
fi