fix set routes

This commit is contained in:
Jörg Thalheim 2015-02-19 17:55:45 +01:00
parent f4a4854f3e
commit c9047101bf
2 changed files with 6 additions and 6 deletions

View File

@ -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"

View File

@ -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"