1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-03-09 15:50:00 +00:00

Update Linux Kernel and add gre-tunnels creation

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-07-23 17:01:34 +02:00
parent ff74a1b298
commit 129e6a9ae4
5 changed files with 21 additions and 2 deletions

View file

@ -50,11 +50,28 @@ _lan_route() {
done
}
_gre_tunnels() {
. "$(readlink -f "/etc/shorewall/params.vpn")"
for intf in /etc/openmptcprouter-vps-admin/intf/*; do
. "$(readlink -f "$intf")"
iface="$(basename $intf)"
if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then
ip tunnel del $iface 2>&1 >/dev/null
ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR
ip link set $iface up
ip addr add $LOCALIP dev $iface
ip route add $NETWORK dev $iface 2>&1 >/dev/null
fi
done
}
while true; do
_glorytun_udp
_glorytun_tcp
_multipath
_omr_api
_lan_route
_gre_tunnels
sleep 10
done