Commit 2c30c7a6 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Add VPN hub subnets to ip routes if available

parent 62ccdf4c
......@@ -62,6 +62,11 @@ case "$${PLUTO_VERB}" in
ip link set "$${VTI_IF}" up
ip addr add "$${PLUTO_MY_SOURCEIP}" dev "$${VTI_IF}"
ip route add "$${PLUTO_PEER_CLIENT}" dev "$${VTI_IF}" table 220
SUBNET=`/sbin/uci -q get vpn.hub.subnet`
IFS=',' read -ra SUBNETS <<< "$${SUBNET// /}"
for net in "$${SUBNETS[@]}"; do
ip route add "$net" dev "$${VTI_IF}" 2> /dev/null
done
sysctl -w "net.ipv4.conf.$${VTI_IF}.disable_policy=1"
networks=`printf %s "$$(ip route list proto kernel scope link | awk -F " " "{ print \\$$1 }")" | tr '\\n' ','`
if [ ! -z "$$networks" ] ; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment