One Network Adapter Two Diferent Gateways

Posted on 2004-11-03
Last Modified: 2013-11-09
In windows XP this is possible but sometimes it doesn't work right, what's the right configuration when using two diferent networks. One is for our Intranet the other for Internet Access.

Kind regards
Question by:cuadrag_oscar
    LVL 4

    Accepted Solution

    You should just use a single default gateway and let the routers do their jobs. I've not looked at it on XP but you can set up routing  specifications on *nix boxes. With these you can specify routes to networks and hosts. You'll just create yourself an unnecessary headache by doing something like this when there are changes to the network infrastructure. Routers use dynamic routing protocols and have people who's job it is to babysit them. Let them do their jobs and you worry about something else.
    LVL 5

    Assisted Solution

    you can use the route command from the command line.

    C:\>route /?

    Manipulates network routing tables.

    ROUTE [-f] [-p] [command [destination]
                      [MASK netmask]  [gateway] [METRIC metric]  [IF interface]

      -f           Clears the routing tables of all gateway entries.  If this is
                   used in conjunction with one of the commands, the tables are
                   cleared prior to running the command.
      -p           When used with the ADD command, makes a route persistent across
                   boots of the system. By default, routes are not preserved
                   when the system is restarted. Ignored for all other commands,
                   which always affect the appropriate persistent routes. This
                   option is not supported in Windows 95.
      command      One of these:
                     PRINT     Prints  a route
                     ADD       Adds    a route
                     DELETE    Deletes a route
                     CHANGE    Modifies an existing route
      destination  Specifies the host.
      MASK         Specifies that the next parameter is the 'netmask' value.
      netmask      Specifies a subnet mask value for this route entry.
                   If not specified, it defaults to
      gateway      Specifies gateway.
      interface    the interface number for the specified route.
      METRIC       specifies the metric, ie. cost for the destination.

    All symbolic names used for destination are looked up in the network database
    file NETWORKS. The symbolic names for gateway are looked up in the host name
    database file HOSTS.

    If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
    (wildcard is specified as a star '*'), or the gateway argument may be omitted.

    If Dest contains a * or ?, it is treated as a shell pattern, and only
    matching destination routes are printed. The '*' matches any string,
    and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
    Diagnostic Notes:
        Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
        Example> route ADD MASK IF 1
                 The route addition failed: The specified mask parameter is invalid.
     (Destination & Mask) != Destination.


        > route PRINT
        > route ADD MASK METRIC 3 IF 2
                 destination^      ^mask      ^gateway     metric^    ^
          If IF is not given, it tries to find the best interface for a given
        > route PRINT
        > route PRINT 157*          .... Only prints those matching 157*
        > route CHANGE MASK METRIC 2 IF 2

          CHANGE is used to modify gateway and/or metric only.
        > route PRINT
        > route DELETE
        > route PRINT

    you can keep adding gateways to whatevr network you want to go to but whats the point, as tmcguiness said use a router..
    LVL 15

    Expert Comment

    tmcguiness is correct.  A gateway is just a catch-all for routes not specified.  There should be only one.  Much like the highlander.
    LVL 5

    Expert Comment

    First regarding gateways and static routs:

    1. Gateway is an essential part of any route.
    2. The amount of gateways is not limited.
    3. For internal access, in case u have only 1 subnet - you don't need a gateway, since you are in the same subnet.
    4. "Default Gateway" says go through me in case u didn't find any appropriate route in a routing table. But you can have more tha 1 default gateway, since you have another parameter called "metric" which can be assigned to a default gateway or a static route: The machine will try to use gateways in the table according to the metric: 1 first, 2 second, etc.

    5.NOTE: u can also use metric for regular static routes.

    I think accoring to the question, you'll need only 1 default route - the one that will help u access the Inet.
    For internal, no need - or just define a static route. (Don't forget to add "-p" to make it persistent).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now