Add support for subnet routing

This commit is contained in:
sump pump 2020-04-28 00:17:03 +00:00
parent 7f22586960
commit 685695cb56
3 changed files with 15 additions and 2 deletions

View File

@ -11,10 +11,11 @@ find /etc/tinc/ -type f -name '*.tmpl' -exec sh -c 'sigil -f {} -p $(cat /etc/li
find /etc/tinc/ -type f -name '*.tmpl' | xargs -I '{}' rm -f {}
# Copy private key
cp /etc/lixonet/tinc.key /etc/tinc/rsa_key.priv
# Set permissions
# Set permissions for tinc scripts
chmod +x /etc/tinc/lixonet/tinc-up
chmod +x /etc/tinc/lixonet/tinc-down
chmod +x /etc/tinc/lixonet/subnet-up
chmod +x /etc/tinc/lixonet/subnet-down
# Bird
rm -rf /etc/bird/*

View File

@ -0,0 +1,6 @@
#!/bin/ash
if [ ! $NAME != $NODE ]; then
echo "Route down: $SUBNET"
ip route del $SUBNET
fi

View File

@ -0,0 +1,6 @@
#!/bin/ash
if [ ! $NAME != $NODE ]; then
echo "Route up: $SUBNET via $INTERFACE"
ip route add $SUBNET dev $INTERFACE
fi