Home > Uncategorized > Manually selecting a default gateway

Manually selecting a default gateway

March 29, 2010

Do you have two or more Ethernet adapters in your machine and find that the wrong one is being selected when routing to the Internet or elsewhere?

When using multiple Ethernet adapters, with default IP gateway’s defined for each adapter, the OS may choose a default route that you don’t wish to use. 

A quick fix for this is to ensure that only one adapter has a Default gateway defined.  However; if modifying the default gateway definitions isn’t possible, you’ll need to adjust the metric that is associated with the adapter that you wish to use.

Windows:

To view the current routes in use, from the Windows cmd prompt:

> route print

To assign a manual metric for your preferred adapter:

Vista:

  1. Control Panel –> Network and Internet –> Network and Sharing Center –> Manage network connections.
  2. Right click on the adapter to adjust and select Properties.
  3. Click on Internet Protocol Version 4 (TCP/IPv4) and select Properties button.
  4. Click the Advanced button.
  5. Un-check the “Automatic metric” check box and enter a new Interface metric value.  Lower metric values are given preference.
  6. Press OK.

Linux (Debian/Ubuntu)

To view the current routines in use and to list the metric for each available adapter, from a Linux command shell:

$ route
$ ifconfig

To assign a manual metric for your preferred adapter:

  1. Edit /etc/network/interfaces
  2. Add a metric definition for your preferred network adapter.
  3. See man interfaces for more info.

Reference:

Advertisements
Categories: Uncategorized
%d bloggers like this: