diff options
-rw-r--r-- | rc.inet1 | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -357,18 +357,29 @@ if_down() { gateway_up() { # Bring up the IPv4 gateway: if [ -n "$GATEWAY" ]; then - if ! /sbin/ip -4 route show | grep -wq default ; then + if ! /sbin/ip -4 route show | grep -wq default; then echo "/etc/rc.d/rc.inet1: /sbin/ip -4 route add default via ${GATEWAY}" | $LOGGER /sbin/ip -4 route add default via ${GATEWAY} fi fi + # Bring up the IPv6 gateway: + if [ -n "$GATEWAY6" ]; then + if ! /sbin/ip -6 route show | grep -wq default; then + echo "/etc/rc.d/rc.inet1: /sbin/ip -6 route add default via ${GATEWAY6}" | $LOGGER + /sbin/ip -6 route add default via ${GATEWAY6} + fi + fi } # Function to take down an existing default gateway: gateway_down() { - if /sbin/ip route show | grep -wq default ; then - echo "/etc/rc.d/rc.inet1: /sbin/ip route del default" | $LOGGER - /sbin/ip route del default + if /sbin/ip -4 route show | grep -wq default ; then + echo "/etc/rc.d/rc.inet1: /sbin/ip -4 route del default" | $LOGGER + /sbin/ip -4 route del default + fi + if /sbin/ip -6 route show | grep -wq default ; then + echo "/etc/rc.d/rc.inet1: /sbin/ip -6 route del default" | $LOGGER + /sbin/ip -6 route del default fi } |