summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-08-13 18:42:02 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-25 19:58:43 -0600
commitfa3bb0bc48de1b717bbd8721b40c9dff73a069ed (patch)
treedbe73b3d95c3c5e7863ce9c6d43f1e934fb71956 /rc.inet1
parente296e830894fa98c872479f9f80117899469a397 (diff)
downloadslacknetsetup-fa3bb0bc48de1b717bbd8721b40c9dff73a069ed.tar.xz
Added ipv6 gateway up/down function
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet119
1 files changed, 15 insertions, 4 deletions
diff --git a/rc.inet1 b/rc.inet1
index a919e28..5b210a0 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -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
}