From 01c5ea1f994b9003cc17aca2db2ec3c9755a9e3c Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Mon, 6 Aug 2018 22:18:24 +0100 Subject: Use -4 when querying/setting routes Signed-off-by: Robby Workman --- rc.inet1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'rc.inet1') 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 } -- cgit v1.2.3