summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-08-06 22:18:24 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-25 19:49:52 -0600
commit01c5ea1f994b9003cc17aca2db2ec3c9755a9e3c (patch)
treef3fdb4f1f2226e43624828ac843f872f58fa7df2
parent287fda1e7803e757047e49d4deef423bb05faa41 (diff)
downloadslacknetsetup-01c5ea1f994b9003cc17aca2db2ec3c9755a9e3c.tar.xz
Use -4 when querying/setting routes
Signed-off-by: Robby Workman <rworkman@slackware.com>
-rw-r--r--rc.inet19
1 files changed, 5 insertions, 4 deletions
diff --git a/rc.inet1 b/rc.inet1
index 10f97d8..367aaca 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -350,10 +350,11 @@ if_down() {
# Function to bring up the gateway if there is not yet a default route:
gateway_up() {
- if ! /sbin/ip route show | grep -wq default ; then
- if [ -n "$GATEWAY" ]; then
- echo "/etc/rc.d/rc.inet1: /sbin/ip route add default via ${GATEWAY}" | $LOGGER
- /sbin/ip route add default via ${GATEWAY} | $LOGGER
+ # Bring up the IPv4 gateway:
+ if [ -n "$GATEWAY" ]; 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
}