fix set routes
This commit is contained in:
parent
f4a4854f3e
commit
c9047101bf
@ -7,8 +7,8 @@ add_route4() {
|
||||
|
||||
if has route; then
|
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
route del -net "$subnet" "$gateway" netmask "$netmask" "$interface" || true
|
||||
route add -net "$subnet" "$gateway" netmask "$netmask" "$interface"
|
||||
route -n del -net "$subnet" "$gateway" netmask "$netmask" "$interface" || true
|
||||
route -n add -net "$subnet" "$gateway" netmask "$netmask" "$interface"
|
||||
else
|
||||
route -n del -net "$subnet/$prefixlen" "$gateway" || true
|
||||
route -n add -net "$subnet/$prefixlen" "$gateway"
|
||||
@ -29,8 +29,8 @@ add_route6() {
|
||||
|
||||
if has route; then
|
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
route del -A inet6 "$subnet/$prefixlen" gw "$gateway" "$interface" || true
|
||||
route add -A inet6 "$subnet/$prefixlen" gw "$gateway" "$interface"
|
||||
route -n del -A inet6 "$subnet/$prefixlen" gw "$gateway" "$interface" || true
|
||||
route -n add -A inet6 "$subnet/$prefixlen" gw "$gateway" "$interface"
|
||||
else
|
||||
if [[ "$gateway" == fe80* ]]; then
|
||||
gateway="$gateway%$interface"
|
||||
|
4
tinc-up
4
tinc-up
@ -52,8 +52,8 @@ ula_ip6="$(format_ip6_from_mac $ULA_IP6_TEMPLATE $MAC_ADDRESS)"
|
||||
add_ip6 "$INTERFACE" "$public_ip6" "80"
|
||||
add_ip6 "$INTERFACE" "$ula_ip6" "64"
|
||||
|
||||
add_route6 "$INTERFACE" "fc00::" "fe80::1" "7"
|
||||
add_route6 "$INTERFACE" "fc00::" "fe80::1" "7"
|
||||
add_route6 "$INTERFACE" "fc00::" "fe80::3" "7"
|
||||
add_route6 "$INTERFACE" "$PUBLIC_IP6_PREFIX::" "fe80::3" "64"
|
||||
|
||||
if [ -n "$SUBNET" ]; then
|
||||
IFS=' ' read ip netmask <<< "$SUBNET"
|
||||
|
Loading…
Reference in New Issue
Block a user