浏览代码

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.
Marek Marczykowski-Górecki 10 年之前
父节点
当前提交
7027633e80
共有 2 个文件被更改,包括 18 次插入9 次删除
  1. 1 1
      network/network-manager-prepare-conf-dir
  2. 17 8
      network/setup-ip

+ 1 - 1
network/network-manager-prepare-conf-dir

@@ -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

+ 17 - 8
network/setup-ip

@@ -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