P. 1
gateway of Last Resort -- Cisco

gateway of Last Resort -- Cisco

|Views: 4|Likes:
Published by kokobhai
hwo to set gateway fo last rsort on Cisco devices
hwo to set gateway fo last rsort on Cisco devices

More info:

Published by: kokobhai on Jan 16, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/16/2013

pdf

text

original

Configuring a Gateway of Last Resort Using IP Commands

Document ID: 16448
Introduction Prerequisites Requirements Components Used Conventions ip default−gateway ip default−network Flag a Default Network Use Different Routing Protocols ip route 0.0.0.0 0.0.0.0 Summary Related Information

Introduction
Default routes are used to direct packets addressed to networks not explicitly listed in the routing table. Default routes are invaluable in topologies where learning all the more specific networks is not desirable, as in case of stub networks, or not feasible due to limited system resources such as memory and processing power. This document explains how to configure a default route, or gateway of last resort. These IP commands are used: • ip default−gateway • ip default−network • and ip route 0.0.0.0 0.0.0.0

Prerequisites
Requirements
There are no specific requirements for this document.

Components Used
This document is not restricted to specific software and hardware versions. The command outputs shown are from the Cisco 2500 Series routers running Cisco IOS® Software Release 12.2(24a). The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If you are working in a live network, ensure that you understand the potential impact of any command before using it.

Conventions
For more information on document conventions, see the Cisco Technical Tips Conventions.

0/24 [1/0] via 161. E − EGP i − IS−IS. It should only be used when ip routing is disabled on the Cisco router. N2 − OSPF NSSA external type 2 E1 − OSPF external type 1. S − static.10. E2 − OSPF external type 2. * − candidate default. L2 − IS−IS level−2 ia − IS−IS inter area. You might also use this command when your low end Cisco router is in boot mode in order to TFTP a Cisco IOS® Software image to the router. 1 subnets 161. IA − OSPF inter area N1 − OSPF NSSA external type 1.ip default−gateway The ip default−gateway command differs from the other two commands.0 is directly connected.10.192. if a router has a route to that network.2 C C S Note the static route to 198. O − OSPF. In boot mode.44. L1 − IS−IS level−1. Serial0 198. M − mobile.99.2 and that the gateway of last resort is not set. If you configure ip default−network 198.108. that route is flagged as a candidate default route.1. Ethernet0 131.4 as the default route: ip default−gateway 172.16.1. U − per−user static route o − ODR. R − RIP. su − IS−IS summary.0.0/24 is subnetted.0/24 is subnetted.44.192.44. This example defines the router on IP address 172.10. For every network configured with ip default−network.15. 1 subnets 131. B − BGP D − EIGRP. the router does not have ip routing enabled.4 ip default−network Unlike the ip default−gateway command. For instance. if the router is a host in the IP world.0 via 161.192. This network diagram displays the routing table taken from router 2513: 2513#show ip route Codes: C − connected.1. P − periodic downloaded static route Gateway of last resort is not set 161. you can use ip default−network when ip routing is enabled on the Cisco router.0. the routing table changes to this: . When you configure ip default−network the router considers routes to that network for installation as the gateway of last resort on the router.15.0. EX − EIGRP external.0 is directly connected. I − IGRP.108. you can use this command to define a default gateway for it.16.44.

2 S S C C S* After the ip default−network command was entered in the output above.24. L2 − IS−IS level−2 ia − IS−IS inter area.2 to network 198.10. Ethernet0 131. 2 subnets.99.44.0.0 2513(config)#^Z 2513#show ip route Codes: C − connected.0 is directly connected.0/16 [1/0] via 171.1. using the major net.99. This result is independent of any routing protocol.44. the network was not flagged as a default network. Serial0 198.44.10. * − candidate default.255.192.1. it installs the route to the major net.192.2 C C S* R1# 2513#show ip protocols 2513# The gateway of last resort is now set as 161. 1 subnets 131. 2513(config)#ip route 171. EX − EIGRP external.99.108.0 131.192. B − BGP D − EIGRP.10. O − OSPF. 1 subnets 131.0 171.0.0 is directly connected. 2 masks 171.24.70.10. E2 − OSPF external type 2. You can add another candidate default route by configuring another instance of ip default−network: 2513#configure terminal Enter configuration commands.108. N2 − OSPF NSSA external type 2 E1 − OSPF external type 1.192. S − static. O − OSPF.108.44.108. R − RIP. su − IS−IS summary.0/24 is subnetted. P − periodic downloaded static route Gateway of last resort is 161.99. M − mobile. M − mobile.1. R − RIP.192.0 255.2513#show ip route Codes: C − connected.24.2 2513(config)#ip default−network 171. one per line.0/24 [1/0] via 161. I − IGRP. . L1 − IS−IS level−1. 1 subnets 161.0/16 is variably subnetted.0/24 is subnetted. N2 − OSPF NSSA external type 2 E1 − OSPF external type 1.44.0 171.2 to network 198.24. IA − OSPF inter area N1 − OSPF NSSA external type 1. The Flag a Default Network section explains why. Serial0 198.0.0 is directly connected. E − EGP i − IS−IS.44. Ethernet0 131.0/24 [1/0] via 161. The ip default−network command must be issued again. L1 − IS−IS level−1. This means that if the router has a route to the subnet indicated by this command. U − per−user static route o − ODR.0. su − IS−IS summary.44.0.70. U − per−user static route o − ODR. B − BGP D − EIGRP.44. Flag a Default Network Note: The ip default−network command is classful.70.255.108. I − IGRP.2. IA − OSPF inter area N1 − OSPF NSSA external type 1.0/24 is subnetted. End with CNTL/Z. S − static.0.0/24 [1/0] via 131.0 161.0 is directly connected. 1 subnets 161. L2 − IS−IS level−2 ia − IS−IS inter area.2 161.192. P − periodic downloaded static route Gateway of last resort is 161. EX − EIGRP external.192. E − EGP i − IS−IS.70. At this point neither network has been flagged as the default network. E2 − OSPF external type 2.70.70.0/24 is subnetted.108. in order to flag the candidate default route. * − candidate default.1.44. as shown by the show ip protocols command at the bottom of the output.

192.108. The ip default−network command allows you to configure robustness into the selection of a gateway of last resort.0. * − candidate default.0 to network 171. EX − EIGRP external. * − candidate default. Rather than configuring static routes to specific next−hops.24.0 171. Ethernet0 131.0.24.1. L1 − IS−IS level−1.0 2513(config)#^Z 2513#show ip route Codes: C − connected.0 255. N2 − OSPF NSSA external type 2 E1 − OSPF external type 1. su − IS−IS summary. N2 − OSPF NSSA external type 2 E1 − OSPF external type 1.0.192. 2 masks 171. R − RIP.44.0.2 to network 198.0/24 is subnetted.2 161. 2513(config)#no ip route 171.192. L2 − IS−IS level−2 ia − IS−IS inter area.0.0 is directly connected. End with CNTL/Z.0/16 [1/0] via 171. one per line. There are still no IP protocols running here.2 2513(config)#^Z 2513# %SYS−5−CONFIG_I: Configured from console by console After you remove the static route to the default network. P − periodic downloaded static route Gateway of last resort is 161. I − IGRP.108.0/16 is variably subnetted. you can have the router choose a default route to a particular network by checking in the routing table. S − static.0/0. the routing table looks like this: 2513#show ip route Codes: C − connected.70. Without any dynamic protocols running.70. M − mobile. S − static. Ethernet0 131.0 is directly connected.108.44.1.70. End with CNTL/Z.0. 1 subnets C . R − RIP.70.0.70.99. P − periodic downloaded static route Gateway of last resort is 171. L2 − IS−IS level−2 ia − IS−IS inter area. 2 subnets. U − per−user static route o − ODR.44.0/24 is subnetted.10.0 161.255.0 131. Serial0 198.0 is directly connected.0/24 [1/0] via 161. U − per−user static route o − ODR.10. one per line. L1 − IS−IS level−1. 2513(config)#ip default−network 171.44. EX − EIGRP external. E2 − OSPF external type 2. O − OSPF. If you lose the route to a particular network. the extra step of configuring the default network twice would not have been necessary.99. B − BGP D − EIGRP. M − mobile. E2 − OSPF external type 2. E − EGP i − IS−IS.2513#configure terminal Enter configuration commands.108.44.70.24.70. You can remove the lost route by removing the static route in the configuration as follows: 2513#configure terminal Enter configuration commands.24. you can configure your router to choose from a number of candidate default routes based on whether the routing table has routes to networks other than 0. E − EGP i − IS−IS.0/24 [1/0] via 131. 1 subnets 161.0. IA − OSPF inter area N1 − OSPF NSSA external type 1.2 If the original static route had been to the major network. IA − OSPF inter area N1 − OSPF NSSA external type 1.99. 1 subnets 131.70.192.0/24 is subnetted. I − IGRP.44. B − BGP D − EIGRP.0 * S* S C C S* 171.0. the router selects the other candidate default. su − IS−IS summary.108.0.255. 1 subnets 161. O − OSPF.0/24 is subnetted.

1) RIP: build update entries subnet 0.108. Serial0 S* 198.0. RIP does not advertise the default route if the route is not learned via RIP.0. This network specified in the ip default−network command need not be explicitly advertised under RIP.512: 07:39:35.0.C 131. Note: IGRP does not understand a route to 0. This means the network must be an IGRP− or EIGRP−derived network in the routing table.255 via Ethernet0 (161. It may be necessary to redistribute the route into RIP.0.255 via Serial0 (131. note that the gateway of last resort on this router was learned using the combination of the ip route and ip default−network commands.192.0.0.0 is another way to set the gateway of last resort on a router.0 (although not to the Ethernet0 network because of split−horizon): 2513(config)#router rip 2513(config−router)#network 161.0.0. or advertised into these protocols using the network command.0 0.0. EIGRP propagates a route to network 0.44.0. ip route 0.10.0 Creating a static route to network 0. .508: 07:39:35. The default route announced using the ip default−network command is not propagated by IS−IS. As with the ip default−network command.0T and later.1 RIP: build update entries network 131.0 0. If you enable RIP on this router.192.108.99.0.0.0.0.0.0. Therefore.0.2 2513# Use Different Routing Protocols Gateways of last resort selected using the ip default−network command are propagated differently depending on which routing protocol is propagating the default route.0.0.255.0.0 metric 1 network 161. refer to How Does OSPF Generate Default Routes?.0. the default route created using the ip route 0.0. In Cisco IOS Software Release 12.0.0. For example. However.0 0.0/24 [1/0] via 161.108. it cannot propagate default routes created using the ip route 0.108.0. For IGRP and EIGRP to propagate the route.0.44.0 metric 1 RIP: sending v1 update to 255.0 is not dependent on any routing protocols.0 metric 1 The default route announced using the ip default−network command is not propagated by Open Shortest Path First (OSPF).0 2513(config−router)#network 131.255. ip routing must be enabled on the router.0 if a gateway of last resort is selected using the ip default−network command.0.508: 07:39:35.0.0 2513(config−router)#^Z 2513# %SYS−5−CONFIG_I: Configured from console by console 2513#debug ip rip *Mar *Mar *Mar *Mar *Mar *Mar *Mar 2 2 2 2 2 2 2 07:39:35.0. the network specified by the ip default−network command must be known to IGRP or EIGRP.0 0.524: RIP: sending v1 update to 255.504: 07:39:35. or the static route used to generate the route to the network must be redistributed into IGRP or EIGRP. RIP advertises a route to 0. RIP advertises a route to 0.0. Use the ip default−network command to have IGRP propagate a default route.99.0 command.0 was automatically advertised by RIP routers.44. but the static route must be redistributed into the routing protocol.255.0.0. using the static route to 0.0.44.516: 07:39:35.0 is directly connected. In earlier versions of RIP. For more detailed information on behavior of default routes with OSPF.0.1.255.520: 07:39:35.

0.0. Use the ip default−network and ip route 0.0 170.0 0.0.170. Serial0 C 170.The default routes created using the ip route 0.0. Summary Use the ip default−gateway command when ip routing is disabled on a Cisco router.0/0 [1/0] via 170.0.0.0.0. which has a lower administrative distance. one per line. O − OSPF.0.0 is directly connected.0.0.4 to network 0.0/24 is subnetted. End with CNTL/Z. 2 subnets C 170.4 router−3(config)#^Z router−3# router−3#show ip route Codes: C − connected.0. the network defined with the ip default−network command takes precedence and is chosen for the gateway of last resort.0 command. o − ODR Gateway of last resort is 170.3. For more detailed information on behavior of default routes with OSPF.0. * − candidate default U − per−user static route.170.0.0.0 commands to configure a default route.0.0.0 command: router−3#configure terminal Enter configuration commands.2. Ethernet0 S* 0. traffic is load−balanced over the multiple routes. EX − EIGRP external.0. B − BGP D − EIGRP.0 170.0.0 0.170.0. the network that has the lowest administrative distance is chosen as the network for the gateway of last resort. If you use both the ip default−network and ip route 0. L2 − IS−IS level−2. router−3(config)#ip route 0.0 command are not propagated by OSPF and IS−IS.0 0.0 commands to configure candidate default networks.0.0.3. If all the networks have the same administrative distance then the network listed first in the routing table (show ip route lists the routing table) is chosen as the network for the gateway of last resort.0. Additionally.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled.0 0. IA − OSPF inter area N1 − OSPF NSSA external type 1.0 0. The way in which routing protocols propagate the default route information varies for each protocol. M − mobile. Related Information • IP Routed Protocols Technology Support Page • Technical Support − Cisco Systems Contacts & Feedback | Help | Site Map .0. and the network used by the ip default−network command is known statically. N2 − OSPF NSSA external type 2 E1 − OSPF external type 1. the ip route 0.0.0 0. E − EGP i − IS−IS. takes precedence and is chosen for the gateway of last resort. R − RIP.170. If you use multiple ip route 0.0. refer to How Does OSPF Generate Default Routes? This is an example of configuring a gateway of last resort using the ip route 0.0.0.0 0.170. E2 − OSPF external type 2. L1 − IS−IS level−1.0.0 is directly connected. Otherwise if the network used by the ip default−network command is derived by a routing protocol.3. Use the default−information originate command to generate a default route into an IS−IS or OSPF routing domain.0.0.4 router−3# router−3# Note: If you configure multiple networks as candidate default routes using the ip default−network command.3.0. S − static.170. I − IGRP.0. this default cannot be redistributed into OSPF or IS−IS using the redistribute command.

Updated: Aug 10. All rights reserved. Inc.© 2009 − 2010 Cisco Systems. 2005 Document ID: 16448 . Terms & Conditions | Privacy Statement | Cookie Policy | Trademarks of Cisco Systems. Inc.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->