Configuring a Gateway of Last Resort Using IP Commands



Similar documents
Table of Contents. Cisco How Does Load Balancing Work?

How To Configure InterVLAN Routing on Layer 3 Switches

Objectives. Router as a Computer. Router components and their functions. Router components and their functions

IOS NAT Load Balancing for Two ISP Connections

BGP Best Path Selection Algorithm

Understanding Route Aggregation in BGP

Cisco Configuring Commonly Used IP ACLs

Router and Routing Basics

IOS NAT Load Balancing with Optimized Edge Routing for Two Internet Connections

Sample Configuration Using the ip nat outside source static

Table of Contents. Cisco Configuring a Basic MPLS VPN

Introduction to Dynamic Routing Protocols

O /27 [110/129] via , 00:00:05, Serial0/0/1

Configuring Static and Dynamic NAT Simultaneously

CCNA2 Chapter 11 Practice

Sample Configuration Using the ip nat outside source list C

Cisco - Configure the 1721 Router for VLANs Using a Switch Module (WIC-4ESW)

Cisco Router Configuration Tutorial

Administrative Distance

OSPF Configuring Multi-Area OSPF

Document ID: Introduction

Chapter 2 Lab 2-2, EIGRP Load Balancing

Route Optimization. rek Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks 1

Using the Border Gateway Protocol for Interdomain Routing

Lab Load Balancing Across Multiple Paths Instructor Version 2500

Distance Vector Routing Protocols. Routing Protocols and Concepts Ola Lundh

Configuring DNS on Cisco Routers

Layer 3 Routing User s Manual

Configuring a Basic MPLS VPN

Configuring RIP. Overview. Routing Update Process CHAPTER

Introduction to Routing and Packet Forwarding. Routing Protocols and Concepts Chapter 1

How To Understand Bg

Link-State Routing Protocols

Network Simulator Lab Study Plan

During this lab time you will configure the routing protocol OSPF with IPv4 addresses.

ASA 9.x EIGRP Configuration Example

BRI to PRI Connection Using Data Over Voice

Angelos Stavrou. OF COURSE there is no Magic so lets see show things work in practice...

Cisco CCNP Optimizing Converged Cisco Networks (ONT)

Cisco Configuring Basic MPLS Using OSPF

IPv6 over MPLS VPN. Contents. Prerequisites. Document ID: Requirements

Troubleshooting Load Balancing Over Parallel Links Using Cisco Express Forwarding

Lab 2 - Basic Router Configuration

Configuring a Leased Line

Packet Tracer 3 Lab VLSM 2 Solution

- Classful vs. Classless Routing -

Microsoft Windows 2003 DNS Server for Wireless LAN Controller (WLC) Discovery Configuration Example

CCNP CISCO CERTIFIED NETWORK PROFESSIONAL LAB MANUAL

Cisco Certified Network Associate (CCNA) 120 Hours / 12 Months / Self-Paced WIA Fee: $

Cisco Certified Network Associate Exam. Operation of IP Data Networks. LAN Switching Technologies. IP addressing (IPv4 / IPv6)

CCNA Exploration 4.0: (II) Routing Protocols and Concepts. Chapter 1: Introduction to Routing and Packet Forwarding

Lab: Basic Router Configuration

Note: This case study utilizes Packet Tracer. Please see the Chapter 5 Packet Tracer file located in Supplemental Materials.

Lab Creating a Logical Network Diagram

Lab Load Balancing Across Multiple Paths

Chapter 7 Lab 7-1, Configuring Switches for IP Telephony Support

Configuration Examples. D-Link Switches L3 Features and Examples IP Multicast Routing

Switching Basics and Intermediate Routing CCNA 3 Labs and Study Guide Allan Johnson

Using OSPF in an MPLS VPN Environment

ISOM3380 Advanced Network Management. Spring Course Description

Brocade to Cisco Comparisons

ASA 8.3 and Later: Mail (SMTP) Server Access on Inside Network Configuration Example

CCNA 2 v5.0 Routing Protocols Final Exam Answers

HOW TO CONFIGURE CISCO FIREWALL PART I

IP Addressing and Subnetting for New Users

Chapter 4. Distance Vector Routing Protocols

CCIE R&S Lab Workbook Volume I Version 5.0

Introduction about cisco company and its products (network devices) Tell about cisco offered courses and its salary benefits (ccna ccnp ccie )

Lab Configuring OSPF with Loopback Addresses

- Enhanced Interior Gateway Routing Protocol -

Dynamic Routing Protocols II OSPF. Distance Vector vs. Link State Routing

How To Learn Cisco Cisco Ios And Cisco Vlan

Chapter 10 Link-State Routing Protocols

COURSE AGENDA. Lessons - CCNA. CCNA & CCNP - Online Course Agenda. Lesson 1: Internetworking. Lesson 2: Fundamentals of Networking

Routing with OSPF. Introduction

Lab 7-1 Configuring Switches for IP Telephony Support

EIGRP Commands. Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols IP2R-141

- Route Filtering and Route-Maps -

Configuring EtherChannel and 802.1Q Trunking Between Catalyst L2 Fixed Configuration Switches and Catalyst Switches Running CatOS

Interconnecting Cisco Networking Devices Part 2

: Interconnecting Cisco Networking Devices Part 1 v2.0 (ICND1)

Working knowledge of TCP/IP protocol Suite IPX/SPX protocols Suite, MCSE or CNE or experienced in supporting a LAN environment.

Building a Network in GNS3

"Charting the Course...

Interconnecting Cisco Network Devices 1 Course, Class Outline

GregSowell.com. Mikrotik Routing

Comparison of RIP, EIGRP, OSPF, IGRP Routing Protocols in Wireless Local Area Network (WLAN) By Using OPNET Simulator Tool - A Practical Approach

Cisco Discovery 3: Introducing Routing and Switching in the Enterprise hours teaching time

The Purpose and Use of the Configuration Register on All Cisco Routers

LAB MANUAL for Computer Network

Password Recovery Procedure for the Cisco 3600 and 3800 Series Routers

Configuring Enhanced Object Tracking

- IGRP - IGRP v1.22 Aaron Balchunas

ICS 351: Today's plan

PIX/ASA 7.x and above : Mail (SMTP) Server Access on Inside Network Configuration Example

How To Configure A Cisco Router With A Cio Router

APNIC elearning: BGP Attributes

PIX/ASA 7.x and above: Mail (SMTP) Server Access on the DMZ Configuration Example

PIX/ASA: Allow Remote Desktop Protocol Connection through the Security Appliance Configuration Example

Transcription:

Configuring a Gateway of Last Resort Using IP Commands Document ID: 16448 Contents 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. ip default gateway The ip default gateway command differs from the other two commands. It should only be used when ip routing is disabled on the Cisco router. For instance, if the router is a host in the IP world, you can use this command to define a default gateway for it. 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. In boot mode, the router does not have ip routing enabled. This example defines the router on IP address 172.16.15.4 as the default route: ip default gateway 172.16.15.4 ip default network Unlike the ip default gateway command, you can use ip default network when ip routing is enabled on the Cisco router. When you configure ip default network the router considers routes to that network for installation as the gateway of last resort on the router. For every network configured with ip default network, if a router has a route to that network, that route is flagged as a candidate default route. This network diagram displays the routing table taken from router 2513: Gateway of last resort is not set C C 161.44.192.0 is directly connected, Ethernet0 131.108.99.0 is directly connected, Serial0

S 198.10.1.0/24 [1/0] via 161.44.192.2 Note the static route to 198.10.1.0 via 161.44.192.2 and that the gateway of last resort is not set. If you configure ip default network 198.10.1.0, the routing table changes to this: Gateway of last resort is 161.44.192.2 to network 198.10.1.0 R1# show ip protocols The gateway of last resort is now set as 161.44.192.2. This result is independent of any routing protocol, as shown by the show ip protocols command at the bottom of the output. You can add another candidate default route by configuring another instance of ip default network: configure terminal 2513(config)#ip route 171.70.24.0 255.255.255.0 131.108.99.2 2513(config)#ip default network 171.70.24.0 2513(config)#^Z Gateway of last resort is 161.44.192.2 to network 198.10.1.0 171.70.0.0/16 is variably subnetted, 2 subnets, 2 masks S 171.70.0.0/16 [1/0] via 171.70.24.0 S 171.70.24.0/24 [1/0] via 131.108.99.2 After the ip default network command was entered in the output above, the network was not flagged as a default network. The Flag a Default Network section explains why.

Flag a Default Network Note: The ip default network command is classful. This means that if the router has a route to the subnet indicated by this command, it installs the route to the major net. At this point neither network has been flagged as the default network. The ip default network command must be issued again, using the major net, in order to flag the candidate default route. configure terminal 2513(config)#ip default network 171.70.0.0 2513(config)#^Z Gateway of last resort is 171.70.24.0 to network 171.70.0.0 * 171.70.0.0/16 is variably subnetted, 2 subnets, 2 masks S* 171.70.0.0/16 [1/0] via 171.70.24.0 S 171.70.24.0/24 [1/0] via 131.108.99.2 If the original static route had been to the major network, the extra step of configuring the default network twice would not have been necessary. There are still no IP protocols running here. Without any dynamic protocols running, 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.0.0.0/0. The ip default network command allows you to configure robustness into the selection of a gateway of last resort. Rather than configuring static routes to specific next hops, you can have the router choose a default route to a particular network by checking in the routing table. If you lose the route to a particular network, the router selects the other candidate default. You can remove the lost route by removing the static route in the configuration as follows: configure terminal 2513(config)#no ip route 171.70.24.0 255.255.255.0 131.108.99.2 2513(config)#^Z %SYS 5 CONFIG_I: Configured from console by console After you remove the static route to the default network, the routing table looks like this:

Gateway of last resort is 161.44.192.2 to network 198.10.1.0 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. For IGRP and EIGRP to propagate the route, the network specified by the ip default network command must be known to IGRP or EIGRP. This means the network must be an IGRP or EIGRP derived network in the routing table, or the static route used to generate the route to the network must be redistributed into IGRP or EIGRP, or advertised into these protocols using the network command. RIP advertises a route to 0.0.0.0 if a gateway of last resort is selected using the ip default network command. This network specified in the ip default network command need not be explicitly advertised under RIP. For example, note that the gateway of last resort on this router was learned using the combination of the ip route and ip default network commands. If you enable RIP on this router, RIP advertises a route to 0.0.0.0 (although not to the Ethernet0 network because of split horizon): 2513(config)#router rip 2513(config router)#network 161.44.0.0 2513(config router)#network 131.108.0.0 2513(config router)#^z %SYS 5 CONFIG_I: Configured from console by console debug ip rip *Mar 2 07:39:35.504: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (161.44.192.1 *Mar 2 07:39:35.508: RIP: build update entries *Mar 2 07:39:35.508: network 131.108.0.0 metric 1 *Mar 2 07:39:35.512: RIP: sending v1 update to 255.255.255.255 via Serial0 (131.108.99.1) *Mar 2 07:39:35.516: RIP: build update entries *Mar 2 07:39:35.520: subnet 0.0.0.0 metric 1 *Mar 2 07:39:35.524: network 161.44.0.0 metric 1 The default route announced using the ip default network command is not propagated by Open Shortest Path First (OSPF). For more detailed information on behavior of default routes with OSPF, refer to How Does OSPF Generate Default Routes?. The default route announced using the ip default network command is not propagated by IS IS. ip route 0.0.0.0 0.0.0.0 Creating a static route to network 0.0.0.0 0.0.0.0 is another way to set the gateway of last resort on a router. As with the ip default network command, using the static route to 0.0.0.0 is not dependent on any routing protocols. However, ip routing must be enabled on the router. Note: IGRP does not understand a route to 0.0.0.0. Therefore, it cannot propagate default routes created using the ip route 0.0.0.0 0.0.0.0 command. Use the ip default network command to have IGRP propagate a

default route. EIGRP propagates a route to network 0.0.0.0, but the static route must be redistributed into the routing protocol. In earlier versions of RIP, the default route created using the ip route 0.0.0.0 0.0.0.0 was automatically advertised by RIP routers. In Cisco IOS Software Release 12.0T and later, RIP does not advertise the default route if the route is not learned via RIP. It may be necessary to redistribute the route into RIP. The default routes created using the ip route 0.0.0.0 0.0.0.0 command are not propagated by OSPF and IS IS. Additionally, this default cannot be redistributed into OSPF or IS IS using the redistribute command. Use the default information originate command to generate a default route into an IS IS or OSPF routing domain. For more detailed information on behavior of default routes with OSPF, 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.0.0.0 command: router 3#configure terminal router 3(config)#ip route 0.0.0.0 0.0.0.0 170.170.3.4 router 3(config)#^Z router 3# router 3#show ip route i IS IS, L1 IS IS level 1, L2 IS IS level 2, * candidate default U per user static route, o ODR Gateway of last resort is 170.170.3.4 to network 0.0.0.0 170.170.0.0/24 is subnetted, 2 subnets C 170.170.2.0 is directly connected, Serial0 C 170.170.3.0 is directly connected, Ethernet0 S* 0.0.0.0/0 [1/0] via 170.170.3.4 router 3# router 3# Note: If you configure multiple networks as candidate default routes using the ip default network command, the network that has the lowest administrative distance is chosen as the network for the gateway of last resort. 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. If you use both the ip default network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default network command is known statically, the network defined with the ip default network command takes precedence and is chosen for the gateway of last resort. Otherwise if the network used by the ip default network command is derived by a routing protocol, the ip route 0.0.0.0 0.0.0.0 command, which has a lower administrative distance, takes precedence and is chosen for the gateway of last resort. If you use multiple ip route 0.0.0.0 0.0.0.0 commands to configure a default route, traffic is load balanced over the multiple routes. Summary Use the ip default gateway command when ip routing is disabled on a Cisco router. Use the ip default network and ip route 0.0.0.0 0.0.0.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled. The way in which routing protocols propagate the default route information varies for each protocol.

Related Information IP Routed Protocols Technology Support Page Technical Support Cisco Systems Contacts & Feedback Help Site Map 2014 2015 Cisco Systems, Inc. All rights reserved. Terms & Conditions Privacy Statement Cookie Policy Trademarks of Cisco Systems, Inc. Updated: Aug 10, 2005 Document ID: 16448