Added store.in.
authorZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Mon, 10 Jun 2024 11:39:23 +0000 (13:39 +0200)
committerZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Mon, 10 Jun 2024 11:39:23 +0000 (13:39 +0200)
sources/store.in/01_setupnetworking.sh [new file with mode: 0755]

diff --git a/sources/store.in/01_setupnetworking.sh b/sources/store.in/01_setupnetworking.sh
new file mode 100755 (executable)
index 0000000..17787c7
--- /dev/null
@@ -0,0 +1,85 @@
+#!/bin/sh
+set -x
+
+# network interfaces are:
+# network interfaces are:
+#   eno1: port 1 of sysplanar Intel I350, used for internal network
+#   eno2: port 2 of sysplanar Intel I350, unused
+#   eno3: port 3 of sysplanar Intel I350, unused
+#   eno4: port 4 of sysplanar Intel I350, unused
+#   ens1:   port 1 of Mellanox ConnectX-3 Pro, used for 10g network
+#   ens1d1: port 2 of Mellanox ConnectX-3 Pro, unused
+
+
+INTERNAL_BOND_NAME=bondi
+INTERNAL_BOND_DEVICE=${INTERNAL_BOND_NAME}-dev
+INTERNAL_BOND_SLAVE_1_NAME=${INTERNAL_BOND_NAME}-slave-1
+INTERNAL_BOND_SLAVE_1_DEVICE=eno1
+INTERNAL_BOND_SLAVE_2_NAME=${INTERNAL_BOND_NAME}-slave-2
+INTERNAL_BOND_SLAVE_2_DEVICE=ens2f0
+
+TENG_CONNECTION_NAME=10g
+TENG_CONNECTION_DEVICE=ens4
+
+
+CONNECTIONS=$(nmcli --terse connection show | wc -l)
+while [ $CONNECTIONS -gt 1 ]
+do
+    CONNECTION_LINE=$(nmcli --terse connection show \
+                          | grep --invert-match '^lo:' | head -n 1)
+    CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':')
+    nmcli connection delete uuid "$CONNECTION_UUID"
+    CONNECTIONS=$(nmcli --terse connection show | wc -l)
+done
+
+
+nmcli connection add \
+    connection.autoconnect yes \
+    connection.id $INTERNAL_BOND_NAME \
+    connection.interface-name $INTERNAL_BOND_DEVICE \
+    connection.type bond \
+    bond.options "mode=802.3ad,lacp_rate=fast,miimon=100,xmit_hash_policy=layer2+3" \
+    ipv4.addresses "10.228.109.229/16" \
+    ipv4.dns "10.228.109.159, 10.228.92.159" \
+    ipv4.dns-search "in.useribm.hu" \
+    ipv4.gateway "10.228.109.254" \
+    ipv4.method "manual" \
+    ipv4.route-metric "100" \
+    ipv6.addresses "2001:1aa1:000a:7dae:d89d:67ff:fe63:dc68/64" \
+    ipv6.dns "2001:1aa1:000a:7dae:000c:18ff:fe03:5c9f, 2001:1aa1:000a:7dae:000c:18ff:fe03:6d9f" \
+    ipv6.dns-search "in.useribm.hu" \
+    ipv6.gateway "2001:1aa1:000a:7dae:000c:18ff:fe03:6dfe" \
+    ipv6.method "manual" \
+    ipv6.route-metric "100" \
+    save yes
+
+nmcli connection add \
+    connection.autoconnect yes \
+    connection.id $INTERNAL_BOND_SLAVE_1_NAME \
+    connection.interface-name $INTERNAL_BOND_SLAVE_1_DEVICE \
+    connection.master $INTERNAL_BOND_DEVICE \
+    connection.slave-type bond \
+    connection.type 802-3-ethernet \
+    save yes
+
+nmcli connection add \
+    connection.autoconnect yes \
+    connection.id $INTERNAL_BOND_SLAVE_2_NAME \
+    connection.interface-name $INTERNAL_BOND_SLAVE_2_DEVICE \
+    connection.master $INTERNAL_BOND_DEVICE \
+    connection.slave-type bond \
+    connection.type 802-3-ethernet \
+    save yes
+
+nmcli connection add \
+    connection.autoconnect yes \
+    connection.id $TENG_CONNECTION_NAME \
+    connection.interface-name $TENG_CONNECTION_DEVICE \
+    connection.type 802-3-ethernet \
+    ipv4.addresses "172.24.107.229/24" \
+    ipv4.method "manual" \
+    ipv6.addresses "2001:1aa1:000a:006b:7cfe:90ff:febc:d540/64" \
+    ipv6.dns "2001:1aa1:000a:7dae:000c:18ff:fe03:5c9f, 2001:1aa1:000a:7dae:000c:18ff:fe03:6d9f" \
+    ipv6.dns-search "in.useribm.hu" \
+    ipv6.method "manual" \
+    save yes