On 02/02/18 21:42, Terry Barnaby wrote:
> A strange one this. I was trying to change the default route of a machine for
> testing a different gateway.
>
> I ran:
>
> route del default gw <gateway1>
>
> route add default gw <gateway2>
>
> However the second command did not add the route and I could not add the old
> default route back. There were no errors on stdout or in /var/log/messages.
>
> Now I found that if there is already a default route you can add another one, 
> so
> could do a:
>
> route add default gw <gateway2>
>
> route del default gw <gateway2>
>
> And these worked fine. It seems you cannot set a default route if there isn't 
> one set.
>
> Any ideas ? 

If you use the route command to add a route you must also specify the netmask.

So, you'll need to use....

route add default netmask x.x.x.x gw <gateway>

Look at the man page for route.....

      netmask NM
              when adding a network route, the netmask to be used.

-- 
A motto of mine is: When in doubt, try it out

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

Reply via email to