From: Zoltán Felleg Date: Thu, 17 Oct 2024 10:20:50 +0000 (+0200) Subject: Updated kea.in (disabled NetworkManager boot time connection creating). X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=eb37a5957d443a9c6458ed4d93427ef2d96af02c;p=user-lxc.git Updated kea.in (disabled NetworkManager boot time connection creating). --- diff --git a/sources/kea.in/c3d/firstboot/scripts/01_setupnetworking.sh b/sources/kea.in/c3d/firstboot/scripts/01_setupnetworking.sh index d95fb34..1b9eb70 100755 --- a/sources/kea.in/c3d/firstboot/scripts/01_setupnetworking.sh +++ b/sources/kea.in/c3d/firstboot/scripts/01_setupnetworking.sh @@ -34,6 +34,7 @@ while [ $CONNECTION_DEVICES_UP -lt 2 ] do if [ $CYCLES_WAITED -ge 10 ] then + echo nmcli connection show exit 1 fi @@ -56,15 +57,16 @@ then exit 1 fi -CONNECTION_LINE=$(nmcli --terse connection show | grep ':eth0$') +CONNECTION_DEVICE="eth0" +CONNECTION_ID="internal" +CONNECTION_LINE=$(nmcli --terse connection show | grep ":${CONNECTION_DEVICE}$") CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ connection.autoconnect yes \ - connection.id internal \ + connection.id $CONNECTION_ID \ connection.interface-name $CONNECTION_DEVICE \ connection.type 802-3-ethernet \ ipv4.addresses "10.228.109.127/16" \ @@ -75,6 +77,13 @@ nmcli connection add \ ipv6.method "disabled" \ save yes +cat </etc/NetworkManager/conf.d/${CONNECTION_DEVICE}.conf +[device] +match-device=interface-name:$CONNECTION_DEVICE +allowed-connections=id:$CONNECTION_ID +keep-configuration=no +EOF + nmcli connection show hostnamectl hostname kea.in.useribm.hu