From 635005ff85e36feed57d7a33fce2d6155b413a17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Fri, 18 Oct 2024 20:40:21 +0200 Subject: [PATCH] Updated efg.pm (disabled NetworkManager boot time connection creating). --- .../firstboot/scripts/01_setupnetworking.sh | 32 +++++++++++++------ .../usr/local/bin/setuprouting.sh | 14 -------- 2 files changed, 23 insertions(+), 23 deletions(-) delete mode 100755 sources/efg.pm/c3d/postinstall/install-data/usr/local/bin/setuprouting.sh diff --git a/sources/efg.pm/c3d/firstboot/scripts/01_setupnetworking.sh b/sources/efg.pm/c3d/firstboot/scripts/01_setupnetworking.sh index 689c2fa..34a803c 100755 --- a/sources/efg.pm/c3d/firstboot/scripts/01_setupnetworking.sh +++ b/sources/efg.pm/c3d/firstboot/scripts/01_setupnetworking.sh @@ -35,6 +35,7 @@ while [ $CONNECTION_DEVICES_UP -lt 3 ] do if [ $CYCLES_WAITED -ge 10 ] then + echo nmcli connection show exit 1 fi @@ -57,19 +58,21 @@ then exit 1 fi -CONNECTION_LINE_PM=$(nmcli --terse connection show | grep ':eth0$') -CONNECTION_LINE_EX=$(nmcli --terse connection show | grep ':eth1$') +CONNECTION_DEVICE_PM="eth0" +CONNECTION_DEVICE_EX="eth1" +CONNECTION_ID_PM="perimeter" +CONNECTION_ID_EX="external" +CONNECTION_LINE_PM=$(nmcli --terse connection show | grep ":${CONNECTION_DEVICE_PM}$") +CONNECTION_LINE_EX=$(nmcli --terse connection show | grep ":${CONNECTION_DEVICE_EX}$") CONNECTION_UUID_PM=$(echo $CONNECTION_LINE_PM | cut -f 2 -d ':') -CONNECTION_DEVICE_PM=$(echo $CONNECTION_LINE_PM | cut -f 4 -d ':') CONNECTION_UUID_EX=$(echo $CONNECTION_LINE_EX | cut -f 2 -d ':') -CONNECTION_DEVICE_EX=$(echo $CONNECTION_LINE_EX | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID_PM" nmcli connection delete uuid "$CONNECTION_UUID_EX" nmcli connection add \ connection.autoconnect yes \ - connection.id perimeter \ + connection.id $CONNECTION_ID_PM \ connection.interface-name $CONNECTION_DEVICE_PM \ connection.type 802-3-ethernet \ ipv4.addresses "192.168.173.254/24" \ @@ -86,9 +89,16 @@ nmcli connection add \ ipv6.routes "2001:1aa1:000a:7dae::/64 2001:1aa1:000a:7c0c:000c:18ff:fe03:ad01" \ save yes +cat </etc/NetworkManager/conf.d/${CONNECTION_DEVICE_PM}.conf +[device] +match-device=interface-name:$CONNECTION_DEVICE_PM +allowed-connections=id:$CONNECTION_ID_PM +keep-configuration=no +EOF + nmcli connection add \ connection.autoconnect yes \ - connection.id external \ + connection.id $CONNECTION_ID_EX \ connection.interface-name $CONNECTION_DEVICE_EX \ connection.type 802-3-ethernet \ ipv4.addresses "213.253.216.162/28, 213.253.216.163/28, \ @@ -104,10 +114,14 @@ nmcli connection add \ ipv6.route-metric 100 \ save yes +cat </etc/NetworkManager/conf.d/${CONNECTION_DEVICE_EX}.conf +[device] +match-device=interface-name:$CONNECTION_DEVICE_EX +allowed-connections=id:$CONNECTION_ID_EX +keep-configuration=no +EOF + nmcli connection show hostnamectl hostname efg.pm.useribm.hu hostnamectl - -#echo "@reboot root /usr/local/bin/setuprouting.sh" >>/etc/crontab -#/usr/local/bin/setuprouting.sh diff --git a/sources/efg.pm/c3d/postinstall/install-data/usr/local/bin/setuprouting.sh b/sources/efg.pm/c3d/postinstall/install-data/usr/local/bin/setuprouting.sh deleted file mode 100755 index 593169b..0000000 --- a/sources/efg.pm/c3d/postinstall/install-data/usr/local/bin/setuprouting.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - - -exit 0 -# the mail server, the nameservers and the vpn server and everything -# from the perimeter network are routed via ACE -ip rule add priority 64 from 10.228.92.159/32 lookup 30 -ip rule add priority 65 from 10.228.109.154/32 lookup 30 -ip rule add priority 66 from 10.228.109.159/32 lookup 30 -ip rule add priority 67 from 10.228.109.236/32 lookup 30 -ip rule add priority 128 from 192.168.173.0/24 lookup 30 - -# everything else is routed via Telekom (which is the default) -#ip rule add priority 256 from 10.228.0.0/16 lookup 150 -- 2.54.0