Update subnet-up.tmpl

This commit is contained in:
Manevolent 2023-04-12 22:46:39 -06:00 committed by GitHub
parent f252a38d97
commit 7c67102934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,11 +6,13 @@ if [ -z "\$nonMACChars" ]; then
# This subnet is a MAC
echo "\$SUBNET" > \$macFile
else
if echo "\$SUBNET" | grep -q -E ".+/32$"; then
if echo "\$SUBNET" | grep -q -E ".+/32\$"; then
# This subnet is likely an IP address, add it to the ARP table
if test -f "\$macFile"; then
mac=`cat \$macFile`
arp -s "\$SUBNET" "\$mac"
address=`echo "\$SUBNET" | cut -d '/' -f 1`
echo "Mapping \$address <=> \$mac in ARP table"
arp -s "\$address" "\$mac"
else
echo "[WARNING] No MAC known for node \$NODE, can't route \$SUBNET. This is only a problem if this is a remote route."
fi