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



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
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!

.



Relevant Pages

  • speed up my LAN
    ... mii-tool -l -w eth0 ... Sep 25 01:09:01 dave kernel: eth1: Link changed: ... basic mode: autonegotiation enabled ... basic status: autonegotiation complete, link ok ...
    (comp.os.linux.networking)
  • Re: Problem with bonded (teaming) NICs on RHEL 4.0
    ... I think mii-tool has a problem with GIG speeds. ... When you run mii-tool for eth0 and eth1 it does not show that. ...
    (RedHat)
  • Re: setting-up a dmz
    ... Not provide any actual log messages? ... No shorewall, i prefer a own debian iptables firewall:) ... eth1: link up, 10Mbps, half-duplex, lpa 0x0000 ... ADDRCONF: eth0: link is not ready ...
    (Debian-User)
  • Re: [opensuse] Suse 10.2 +two network cards (Not yet solved)
    ... then set the eth0 as it was default from the installation. ... set eth1 DNS servers etc. so DHCP would not update them. ... Also have figure out where to put the route command ...
    (SuSE)
  • Re: DNS or network problem
    ... UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ... The first thing that leaps out at me is the fact that eth0 and eth1 ... Because all your routes passes through eth1, and not eth0, I ...
    (Fedora)