Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gateways and Metrics 5

Status
Not open for further replies.
May 21, 2003
15
0
0
PH
Hi All.

Can anyone help me understand the relationship between gateways and metrics with regards to routing?

Also is it possible to have two gateways on one pc?

Thanks.
 
Sure it is. Metrics are assigned when you have more than one, and it just determines which is first on the list.

Metric Gateway
------ -------
1 192.168.0.1
2 192.168.0.2


This says, in a nutshell, first try the .1 gateway, and if it doesn't work, move to the next one -- .2 in this example.

To look at this stuff in XP, right-click your network adaptor, hit properties, highlight TCP/IP, hit Settings, click Advanced, and you'll see a bunch of cool stuff.

Standard disclaimer: If you break it, you own both parts.
 
To view from dos, type route print from the prompt. (This is from my home network)
C:\>route print
================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 04 e2 46 a6 ba ...... SMC2632W V.2 Wireless PC Card
================================
================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.2.1 192.168.2.148 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.2.0 255.255.255.0 192.168.2.148 192.168.2.148 1
192.168.2.148 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.2.255 255.255.255.255 192.168.2.148 192.168.2.148 1
224.0.0.0 224.0.0.0 192.168.2.148 192.168.2.148 1
255.255.255.255 255.255.255.255 192.168.2.148 192.168.2.148 1
Default Gateway: 192.168.2.1
=======================================
Persistent Routes:
None


To add gateways use the command
route add -p (Destinationip) mask 255.255.255.0 (Ipaddress of first router) metric 1
route add -p (Destinationip) mask 255.255.255.0 (Ipaddress of second router) metric 2

This help?

Glen A. Johnson
Johnson Computer Consulting
MCP W2K
glen@johnsoncomputers.us

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
"Watson, the game is afoot!" [pipe]
 
Metrics provide a priority for the routing table. The larger the metric, the less preferred that particular route is. A route is generally less preferred if there are too many hops in it, but it may also be given a higher metric if the cost of using that route is higher (back in the good ol' days we paid for many links by the packet), or if the delay is significant (like a satellite hop).

If you have two or more gateways (or routes) to a given location, then the metric will help you (your computer) determine which path to try first. This allows for transparent failover if a link were to become unavailable or congested.


pansophic
 
Thank you guys for giving a very direct and concise explaination about my question.

That being said I believe that you guys deserve your respective stars.

My thanks for attending to my question.

:)

 
Ok so if metric gives a fail over ability, how does it know when the 1st gateway is back online?
 
It discovers the less costly (quicker) route.
 
I'm trying something similar, but we have two gateways that are ours and will always be running, but connected to two different ISP's - so that our website is always available even when one ISP goes down.

So, what I need to know is, using metrics, will the fact that my gateway is up and running still cause it to failover to the second gateway if something beyond the first gateway is down, or will the fact that our gateway is running mean it will never failover?

Thanks,
LHL Tech

LHLTech

IBM Certified ATE
 
LHL,
I think you may be getting into BGP routing etc with two ISPs as the metric is only out bound traffic. I worked for a web host a year ago and when I left they were just starting to roll on this. Not sure what happened. I know CW and Worldcom (old UU net) can and do do this for customers.

Scott Heath
AIM: orange7288
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top