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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gateway of Last Resort

Status
Not open for further replies.

PinkLips

ISP
Jan 27, 2004
75
US
When I do a #show ip route on a route, I get a
"gateway of last resort x.x.x.x"

1. What is the purpose of the "gateway of last resort?"
2. How can I configure a "gateway of last resort?"

Thanks,
Nicole
 
Gateway of last resort is referred to as the default gateway as well. What the router does, is say if I don't have a route in my routing table for the incoming packet then use this route (insert default route aka last resort).

You can easily spot this route out, but it will have all zeros for the ip and subnet fields (0.0.0.0 0.0.0.0). You can receive a default route from either a routing protocol (rip, eigrp, ospf, bgp, etc.) or from a static route entered by hand.

To add a static default route, you would type this:
ip route 0.0.0.0 0.0.0.0 xxx.xxx.xxx.xxx

Replace xxx.xxx.xxx.xxx with a smarter router (generally your isp).

To remove a static route, you would repeat the same command but with a "no" in front of it.
 
I'm a little confused now. So the Gateway of Last Resort will always be 0.0.0.0 0.0.0.0 x.x.x.x? Some of my routers don't have a GLR, is that ok? Sorry..I'm new to routing.

Thanks,
Nicole
 
Yes... Gateway of last resort will always have a destination of 0.0.0.0 0.0.0.0. The router to handle that route, is the x.x.x.x.

You don't need a default gateway though. In fact it's pretty common not to have one. Without a default gateway (gateway of last resort), you router will drop the incoming packet that is for a destination that your router doesn't know.

Example:

Image your network consists of (3) subnets (192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24). On your router, your routing table might look something like this...


C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Serial0
C 192.168.3.0/24 is directly connected, Serial1

Now with the router in this state, it knows how to get to hosts on those three subnets only. If your want to connect to a host not on these subnets (like a website or something), your router wouldn't know where to send the packet and would drop it.

To get around this, we use a default route so that your router doesn't have to know every public network in the world. :)
 
thanks for the explanation baddos...

Thanks,
Nicole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top