Update Proxmox/ThunderboltNetwork.md

This commit is contained in:
2024-06-18 19:18:28 +00:00
parent 8911c13193
commit 7daa1a7c4e

View File

@@ -87,16 +87,42 @@ systemctl restart frr
Make sure interface is coming up!
```python
tee -a /etc/network/if-up.d/restart-frr <<EOF
tee -a /usr/local/bin/restart-frr.sh <<EOF
#!/bin/sh
# Check if the interface is either en05 or en06
if [ "$IFACE" = "en05" ] || [ "$IFACE" = "en06" ]; then
# Restart the frr service
/usr/bin/systemctl restart frr.service
fi
# Delayed start script to tell frr to reload ensuring that it sees thunderbolt links towards other nodes.
# condition: is there any tbt network interface and frr service up
COUNTER=0
while [ ${COUNTER} -lt 5 ]; do
sleep 1;
TEST=$(ip a | grep ": en0" | grep "UP" | awk 'BEGIN { ORS=""}; {print $2}')
if [ ${#TEST} -ge 2 ]; then
TEST_SVC=$(service frr status | grep "active (running)")
if [ ${#TEST_SVC} -ge 2 ]; then
service frr reload;
echo "frr service reload request sent"
exit 0;
fi
fi
COUNTER=$((COUNTER+1));
done
echo "Failed to request frr service reload: request NOT sent"
exit 1;
EOF
chmod +x /etc/network/if-up.d/restart-frr
chmod +x /usr/local/bin/restart-frr.sh
tee -a /etc/systemd/system/frr-restarter.service <<EOF
[Unit]
After=network.target
[Service]
ExecStart=/usr/local/bin/restart-frr.sh
[Install]
WantedBy=default.target
EOF
systemctl daemon-reload
systemctl enable frr-restarter
```
## Different settings per Node!