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! Make sure interface is coming up!
```python ```python
tee -a /etc/network/if-up.d/restart-frr <<EOF tee -a /usr/local/bin/restart-frr.sh <<EOF
#!/bin/sh #!/bin/sh
# Delayed start script to tell frr to reload ensuring that it sees thunderbolt links towards other nodes.
# Check if the interface is either en05 or en06 # condition: is there any tbt network interface and frr service up
if [ "$IFACE" = "en05" ] || [ "$IFACE" = "en06" ]; then COUNTER=0
# Restart the frr service while [ ${COUNTER} -lt 5 ]; do
/usr/bin/systemctl restart frr.service sleep 1;
fi 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 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! ## Different settings per Node!