diff --git a/xCAT/postscripts/routeop b/xCAT/postscripts/routeop index b90e447a6..236453aab 100755 --- a/xCAT/postscripts/routeop +++ b/xCAT/postscripts/routeop @@ -269,7 +269,7 @@ replace_persistent_route() redhat) #echo "rh/fedora/centos" - if [ -z "$ifname" ]; then + if [ -z "$ifname" -a "$net" != "default" ]; then echo "Error: the device name is necessary to configure static route." return 1 fi @@ -296,6 +296,12 @@ replace_persistent_route() route1="$net\/$mask via $gw" fi fi + # default route is handled separately + if [ "$net" = "default" ]; then + filename="/etc/sysconfig/network" + route="GATEWAY=$gw" + routedest="$route" + fi if [ -f $filename ]; then egrep "^$routedest" $filename 2>&1 1>/dev/null if [ $? -ne 0 ]; then #route does not exist