Re: How to set default gw not by route command in linux?



"ChaoZhang" <chaozh@xxxxxxxxxx> writes:

My linux pc has two adapters, eth0 is 192.168.1.2 and eth1 is
172.16.2.100. I manually set these ip addresses in ifcfg-eth0 and
ifcfg-eth1 files. I also set 192.168.1.1 and 172.16.2.1 as gateways for
eth0 and eth1. After this, I found the default gw is 172.16.2.1 not

Why do you set gateways for both? Gateways are for default routes. You can
only have one default route. The last one set.

192.168.1.1. I know I can change it through route command. But I think
there must be another way for system to set the default gw is
192.168.1.1. Could you please tell me how to configure it? many thanks!

Get rid of the GATEWAY option for the address you do not want.

.



Relevant Pages

  • Re: How to set default gw not by route command in linux?
    ... I manually set these ip addresses in ifcfg-eth0 and ... ifcfg-eth1 files. ... I also set 192.168.1.1 and 172.16.2.1 as gateways for ... applicable only for manually configured interfaces. ...
    (comp.os.linux.networking)
  • VPN Routing Issues
    ... I had a VPN set up with automatic keying between two OpenBSD machines, ... The setup ... order for the gateways to be able to communicate to the remote networks. ... If I remove those two routes and try to ping, I get "sendto: ...
    (comp.unix.bsd.openbsd.misc)
  • defaultrouter configuration
    ... Their default gateways have the same routes to other ... networks. ... Actually what is the correct configuration in this ...
    (SunManagers)
  • weird. LOL
    ... a truck driver on some freeway. ... 90 are routes or paths ... or gateways or tunnels!!! ...
    (microsoft.public.win2000.group_policy)
  • Weird. LOL
    ... a truck driver on some freeway. ... 90 are routes or paths ... or gateways or tunnels!!! ...
    (microsoft.public.win2000.networking)