diff options
Diffstat (limited to 'sysconfig/network-scripts/ifup-aliases')
-rwxr-xr-x | sysconfig/network-scripts/ifup-aliases | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index f65d5956..239c9775 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -266,8 +266,11 @@ function new_interface () if [ "${GATEWAY}" != "" ]; then if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then - # set up default gateway - route add default gw ${GATEWAY} ${DEVICE} + # set up default gateway, if it isn't already there + CURGW=`route -n | grep ^0\.0\.0\.0 | awk '{ print $2 }'` + if [ "$CURGW" != "$GATEWAY" ]; then + route add default gw ${GATEWAY} ${DEVICE} + fi fi fi |