diff --git a/scripts/inner.sh b/scripts/inner.sh index f558070..171e3cd 100644 --- a/scripts/inner.sh +++ b/scripts/inner.sh @@ -12,18 +12,28 @@ ip link set dev vpn up ip addr flush dev vpn ip route flush dev vpn -echo ${VPN_IPV4_ADDRESS} -echo ${VPN_IPV6_ADDRESS} +echo "-- inner.sh --" + +echo "VPN_IPV4_ADDRESS=${VPN_IPV4_ADDRESS}" +echo "VPN_IPV6_ADDRESS=${VPN_IPV6_ADDRESS}" + +echo "OUTER_ROUTE_V4=${OUTER_ROUTE_V4}" +echo "OUTER_GATEWAY_V4=${OUTER_GATEWAY_V4}" + +echo "OUTER_ROUTE_V6=${OUTER_ROUTE_V6}" +echo "OUTER_GATEWAY_V6=${OUTER_GATEWAY_V6}" + +echo "-- inner.sh --" ip addr add ${VPN_IPV4_ADDRESS} dev vpn ip addr add ${VPN_IPV6_ADDRESS} dev vpn -if [ -z ${OUTER_ROUTE_V4+x} ] +if [ -n "${OUTER_ROUTE_V4}" && -n "${OUTER_GATEWAY_V4}" ] then ip -4 route add "${OUTER_ROUTE_V4}" via "${OUTER_GATEWAY_V4}" fi -if [ -z ${OUTER_ROUTE_V6+x} ] +if [ -n "${OUTER_ROUTE_V6}" && -n "${OUTER_GATEWAY_V6}" ] then ip -6 route add "${OUTER_ROUTE_V6}" via "${OUTER_GATEWAY_V6}" fi diff --git a/scripts/outer.sh b/scripts/outer.sh index e75f1bd..8f8ea6b 100644 --- a/scripts/outer.sh +++ b/scripts/outer.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash + +echo "-- outer.sh --" + +echo "VPN_IPV4_ADDRESS=${VPN_IPV4_ADDRESS}" +echo "VPN_IPV6_ADDRESS=${VPN_IPV6_ADDRESS}" + +echo "OUTER_ROUTE_V4=${OUTER_ROUTE_V4}" +echo "OUTER_GATEWAY_V4=${OUTER_GATEWAY_V4}" + +echo "OUTER_ROUTE_V6=${OUTER_ROUTE_V6}" +echo "OUTER_GATEWAY_V6=${OUTER_GATEWAY_V6}" + +echo "-- outer.sh --" + ip link set dev veth-outer up ip addr add ${VETH_IPV4_ADDRESS} dev veth-outer ip addr add ${VETH_IPV6_ADDRESS} dev veth-outer