|
|
@ -124,15 +124,15 @@ gen_iface_conf()
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Add static routes
|
|
|
|
# Add static routes
|
|
|
|
if [ -n "${ROUTES}" ]; then
|
|
|
|
# static_routes="lan mumoffice foo"
|
|
|
|
# static_routes="lan mumoffice foo"
|
|
|
|
# route_lan="-net 192.168.1.0/24 192.168.1.254"
|
|
|
|
# route_lan="-net 192.168.1.0/24 192.168.1.254"
|
|
|
|
# route_mumoffice="-net 10.0.0.0/8 10.30.110.5"
|
|
|
|
# route_mumoffice="-net 10.0.0.0/8 10.30.110.5"
|
|
|
|
# route_foo="-host 169.254.1.1 -iface lo0"
|
|
|
|
# route_foo="-host 169.254.1.1 -iface lo0"
|
|
|
|
route_names=""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "${ROUTES}" ]; then
|
|
|
|
IFS=',' read -r -a routes <<< "$ROUTES"
|
|
|
|
IFS=',' read -r -a routes <<< "$ROUTES"
|
|
|
|
|
|
|
|
|
|
|
|
route_names=""
|
|
|
|
|
|
|
|
routes_conf=()
|
|
|
|
routes_conf=()
|
|
|
|
|
|
|
|
|
|
|
|
for index in "${!routes[@]}"
|
|
|
|
for index in "${!routes[@]}"
|
|
|
@ -160,6 +160,17 @@ gen_iface_conf()
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add ONEGATE Proxy static route
|
|
|
|
|
|
|
|
if is_link_local "${ONEGATE_ENDPOINT}"; then
|
|
|
|
|
|
|
|
route_name="onegateproxy"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sed -i "s/${route_names}/${route_names} ${route_name}/g" "$routes_conf_path"
|
|
|
|
|
|
|
|
# ip route replace 169.254.16.9/32 via eth0
|
|
|
|
|
|
|
|
route_conf="route_${route_name}=\"-host ${ONEGATE_ENDPOINT} -iface ${dev}\""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo -e "$route_conf\n" >> $routes_conf_path
|
|
|
|
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gen_dhcp_conf()
|
|
|
|
gen_dhcp_conf()
|
|
|
|