Add log statement when LOCAL_NETWORK specified

This commit is contained in:
Jordan Potter 2021-03-06 22:48:51 -06:00
parent dda803d040
commit 6f7a3426dd

View file

@ -31,13 +31,14 @@ iptables -I OUTPUT ! -o $interface -m mark ! --mark $(wg show $interface fwmark)
docker6_network="$(ip -o addr show dev eth0 | awk '$3 == "inet6" {print $4}')" docker6_network="$(ip -o addr show dev eth0 | awk '$3 == "inet6" {print $4}')"
if [[ -z "$docker6_network" ]]; then if [[ -z "$docker6_network" ]]; then
echo "Skipping ipv6 killswitch setup since ipv6 interface was not found..." >&2 echo "Skipping ipv6 kill switch setup since ipv6 interface was not found" >&2
else else
docker6_network_rule=$([ ! -z "$docker6_network" ] && echo "! -d $docker6_network" || echo "") docker6_network_rule=$([ ! -z "$docker6_network" ] && echo "! -d $docker6_network" || echo "")
ip6tables -I OUTPUT ! -o $interface -m mark ! --mark $(wg show $interface fwmark) -m addrtype ! --dst-type LOCAL $docker6_network_rule -j REJECT ip6tables -I OUTPUT ! -o $interface -m mark ! --mark $(wg show $interface fwmark) -m addrtype ! --dst-type LOCAL $docker6_network_rule -j REJECT
fi fi
if [[ "$LOCAL_NETWORK" ]]; then if [[ "$LOCAL_NETWORK" ]]; then
echo "Allowing traffic to local network ${LOCAL_NETWORK}" >&2
ip route add $LOCAL_NETWORK via $default_route_ip ip route add $LOCAL_NETWORK via $default_route_ip
iptables -I OUTPUT -d $LOCAL_NETWORK -j ACCEPT iptables -I OUTPUT -d $LOCAL_NETWORK -j ACCEPT
fi fi