diff options
author | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2018-08-13 18:42:02 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-11-25 19:58:43 -0600 |
commit | fa3bb0bc48de1b717bbd8721b40c9dff73a069ed (patch) | |
tree | dbe73b3d95c3c5e7863ce9c6d43f1e934fb71956 | |
parent | e296e830894fa98c872479f9f80117899469a397 (diff) | |
download | slacknetsetup-fa3bb0bc48de1b717bbd8721b40c9dff73a069ed.tar.xz |
Added ipv6 gateway up/down function
Signed-off-by: Robby Workman <rworkman@slackware.com>
-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 } |