Cisco IOS IP Configuration Guide, Release 12.2
Configuring IP Addressing
Downloads: This chapterpdf (PDF - 661.0KB) The complete bookPDF (PDF - 6.41MB) | Feedback

Configuring IP Addressing

Table Of Contents

Configuring IP Addressing

IP Addressing Task List

Assigning IP Addresses to Network Interfaces

Assigning Multiple IP Addresses to Network Interfaces

Enabling Use of Subnet Zero

Disabling Classless Routing Behavior

Enabling IP Processing on a Serial Interface

Configuring Address Resolution Methods

Establishing Address Resolution

Defining a Static ARP Cache

Setting ARP Encapsulations

Enabling Proxy ARP

Configuring Local-Area Mobility

Mapping Host Names to IP Addresses

Assigning Host Names to IP Addresses

Specifying the Domain Name

Specifying a Name Server

Enabling the DNS

Using the DNS to Discover ISO CLNS Addresses

Providing Service to DNS Clients

DNS Overview

Role of the Cisco IOS DNS Server as an Authoritative Name Server

Configuring the Router as a DNS Server

Example Debugging Output

Configuring HP Probe Proxy Name Requests

Configuring the Next Hop Resolution Protocol

The Cisco Implementation of NHRP

Protocol Operation

NHRP Configuration Task List

Enabling NHRP on an Interface

Configuring a Static IP-to-NBMA Address Mapping for a Station

Statically Configuring a Next Hop Server

Configuring NHRP Authentication

Controlling the Triggering of NHRP

Triggering NHRP Based on Traffic Thresholds

Controlling the NHRP Packet Rate

Suppressing Forward and Reverse Record Options

Specifying the NHRP Responder Address

Changing the Time Period NBMA Addresses Are Advertised as Valid

Configuring a GRE Tunnel for Multipoint Operation

Configuring NHRP Server-Only Mode

Enabling IP Routing

Routing Assistance When IP Routing Is Disabled

Proxy ARP

Default Gateway

ICMP Router Discovery Protocol

Enabling IP Bridging

Enabling Integrated Routing and Bridging

Configuring a Routing Process

Configuring Broadcast Packet Handling

Enabling Directed Broadcast-to-Physical Broadcast Translation

Forwarding UDP Broadcast Packets and Protocols

Establishing an IP Broadcast Address

Flooding IP Broadcasts

Speeding Up Flooding of UDP Datagrams

Configuring Network Address Translation

NAT Applications

Benefits

NAT Terminology

NAT Configuration Task List

Translating Inside Source Addresses

Configuring Static Translation

Configuring Dynamic Translation with an Access List

Configuring Dynamic Translation with a Route Map

Overloading an Inside Global Address

Translating Overlapping Addresses

Configuring Static Translation

Configuring Dynamic Translation

Providing TCP Load Distribution

Changing Translation Timeouts

Monitoring and Maintaining NAT

Deploying NAT Between an IP Phone and Cisco CallManager

Monitoring and Maintaining IP Addressing

Clearing Caches, Tables, and Databases

Specifying the Format of Network Masks

Displaying System and Network Statistics

Monitoring and Maintaining NHRP

IP Addressing Examples

Creating a Network from Separated Subnets Example

Serial Interfaces Configuration Example

IP Domains Example

Dynamic Lookup Example

HP Hosts on a Network Segment Example

Logical NBMA Example

NHRP over ATM Example

Changing the Rate for Triggering SVCs Example

Applying NHRP Rates to Specific Destinations Example

NHRP on a Multipoint Tunnel Example

Broadcasting Examples

Flooded Broadcast Example

Flooding of IP Broadcasts Example

Helper Addresses Example

NAT Configuration Examples

Dynamic Inside Source Translation Example

Overloading Inside Global Addresses Example

Translating Overlapping Address Example

TCP Load Distribution Example

ping Command Example


Configuring IP Addressing


This chapter describes how to configure IP addressing. For a complete description of the IP addressing commands in this chapter, refer to the "IP Addressing Commands" chapter of the Cisco IOS IP Command Reference, Volume 1 of 3: Addressing and Services publication. To locate documentation of other commands that appear in this chapter, use the command reference master index, or search online.

IP Addressing Task List

A basic and required task for configuring IP is to assign IP addresses to network interfaces. Doing so enables the interfaces and allows communication with hosts on those interfaces using IP. Associated with this task are decisions about subnetting and masking the IP addresses.

To configure various IP addressing features, perform the tasks described in the following sections. The task in the first section is required; the tasks in remaining sections are optional.

Assigning IP Addresses to Network Interfaces (Required)

Configuring Address Resolution Methods (Optional)

Enabling IP Routing (Optional)

Enabling IP Bridging (Optional)

Enabling Integrated Routing and Bridging (Optional)

Configuring a Routing Process (Optional)

Configuring Broadcast Packet Handling (Optional)

Configuring Network Address Translation (Optional)

Monitoring and Maintaining IP Addressing (Optional)

At the end of this chapter, the examples in the "IP Addressing Examples" section illustrate how you might establish IP addressing in your network.

Assigning IP Addresses to Network Interfaces

An IP address identifies a location to which IP datagrams can be sent. Some IP addresses are reserved for special uses and cannot be used for host, subnet, or network addresses. Table 3 lists ranges of IP addresses, and shows which addresses are reserved and which are available for use.

Table 3 Reserved and Available IP Addresses

Class
Address or Range
Status

A

0.0.0.0
1.0.0.0 to 126.0.0.0
127.0.0.0

Reserved
Available
Reserved

B

128.0.0.0 to 191.254.0.0
191.255.0.0

Available
Reserved

C

192.0.0.0
192.0.1.0 to 223.255.254
223.255.255.0

Reserved
Available
Reserved

D

224.0.0.0 to 239.255.255.255

Multicast group addresses

E

240.0.0.0 to 255.255.255.254
255.255.255.255

Reserved
Broadcast


The official description of IP addresses is found in RFC 1166, Internet Numbers.

To receive an assigned network number, contact your Internet service provider (ISP).

An interface can have one primary IP address. To assign a primary IP address and a network mask to a network interface, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip address ip-address mask

Sets a primary IP address for an interface.


A mask identifies the bits that denote the network number in an IP address. When you use the mask to subnet a network, the mask is then referred to as a subnet mask.


Note We only support network masks that use contiguous bits that are flush left against the network field.


The tasks to enable or disable additional, optional, IP addressing features are contained in the following sections:

Assigning Multiple IP Addresses to Network Interfaces

Enabling Use of Subnet Zero

Disabling Classless Routing Behavior

Enabling IP Processing on a Serial Interface

Assigning Multiple IP Addresses to Network Interfaces

Cisco IOS software supports multiple IP addresses per interface. You can specify an unlimited number of secondary addresses. Secondary IP addresses can be used in a variety of situations. The following are the most common applications:

There might not be enough host addresses for a particular network segment. For example, suppose your subnetting allows up to 254 hosts per logical subnet, but on one physical subnet you must have 300 host addresses. Using secondary IP addresses on the routers or access servers allows you to have two logical subnets using one physical subnet.

Many older networks were built using Level 2 bridges, and were not subnetted. The judicious use of secondary addresses can aid in the transition to a subnetted, router-based network. Routers on an older, bridged segment can easily be made aware that many subnets are on that segment.

Two subnets of a single network might otherwise be separated by another network. You can create a single network from subnets that are physically separated by another network by using a secondary address. In these instances, the first network is extended, or layered on top of the second network. Note that a subnet cannot appear on more than one active interface of the router at a time.


Note If any router on a network segment uses a secondary address, all other routers on that same segment must also use a secondary address from the same network or subnet.


To assign multiple IP addresses to network interfaces, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip address ip-address mask secondary

Assigns multiple IP addresses to network interfaces.



Note IP routing protocols sometimes treat secondary addresses differently when sending routing updates. See the description of IP split horizon in the "Configuring IP Enhanced IGRP," "Configuring IGRP," or "Configuring RIP" chapters for details.


See the "Creating a Network from Separated Subnets Example" section at the end of this chapter for an example of creating a network from separated subnets.

Enabling Use of Subnet Zero

Subnetting with a subnet address of 0 is illegal and strongly discouraged (as stated in RFC 791) because of the confusion that can arise between a network and a subnet that have the same addresses. For example, if network 131.108.0.0 is subnetted as 255.255.255.0, subnet 0 would be written as 131.108.0.0—which is identical to the network address.

You can use the all 0s and all 1s subnet (131.108.255.0), even though it is discouraged. Configuring interfaces for the all 1s subnet is explicitly allowed. However, if you need the entire subnet space for your IP address, use the following command in global configuration mode to enable subnet 0:

Command
Purpose

Router(config)# ip subnet-zero

Enables the use of subnet zero for interface addresses and routing updates.


Disabling Classless Routing Behavior

By default, classless routing behavior is enabled on the router. When classless routing is in effect, if a router receives packets destined for a subnet of a network that has no network default route, the router forwards the packet to the best supernet route.

In Figure 1, classless routing is enabled in the router. Therefore, when the host sends a packet to 128.20.4.1, instead of discarding the packet, the router forwards the packet to the best supernet route.

Figure 1 IP Classless Routing

If you disable classless routing, and a router receives packets destined for a subnet of a network that has no network default route, the router discards the packet. Figure 2 shows a router in network 128.20.0.0 connected to subnets 128.20.1.0, 128.20.2.0, and 128.20.3.0. Suppose the host sends a packet to 128.20.4.1. Because there is no network default route, the router discards the packet.

Figure 2 No IP Classless Routing

To prevent the Cisco IOS software from forwarding packets destined for unrecognized subnets to the best supernet route possible, use the following command in global configuration mode:

Command
Purpose

Router(config)# no ip classless

Disables classless routing behavior.


Enabling IP Processing on a Serial Interface

You might want to enable IP processing on a serial or tunnel interface without assigning an explicit IP address to the interface. Whenever the unnumbered interface generates a packet (for example, for a routing update), it uses the address of the interface you specified as the source address of the IP packet. It also uses the specified interface address in determining which routing processes are sending updates over the unnumbered interface. Restrictions are as follows:

Serial interfaces using High-Level Data Link Control (HDLC), PPP, Link Access Procedure, Balanced (LAPB), and Frame Relay encapsulations, as well as Serial Line Internet Protocol (SLIP) tunnel interfaces, can be unnumbered. Serial interfaces using Frame Relay encapsulation can also be unnumbered, but the interface must be a point-to-point subinterface. It is not possible to use the unnumbered interface feature with X.25 or Switched Multimegabit Data Service (SMDS) encapsulations.

You cannot use the ping EXEC command to determine whether the interface is up, because the interface has no IP address. The Simple Network Management Protocol (SNMP) can be used to remotely monitor interface status.

You cannot netboot a runnable image over an unnumbered serial interface.

You cannot support IP security options on an unnumbered interface.

If you are configuring Intermediate System-to-Intermediate System (IS-IS) across a serial line, you should configure the serial interfaces as unnumbered, which allows you to conform with RFC 1195, which states that IP addresses are not required on each interface.


Note Using an unnumbered serial line between different major networks requires special care. If, at each end of the link, different major networks are assigned to the interfaces you specified as unnumbered, any routing protocols running across the serial line should be configured to not advertise subnet information.


To enable IP processing on an unnumbered serial interface, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip unnumbered type number

Enables IP processing on a serial or tunnel interface without assigning an explicit IP address to the interface.


The interface you specify must be the name of another interface in the router that has an IP address, not another unnumbered interface.

The interface you specify also must be enabled (listed as "up" in the show interfaces command display).

See the "Serial Interfaces Configuration Example" section at the end of this chapter for an example of how to configure serial interfaces.

Configuring Address Resolution Methods

The Cisco IP implementation allows you to control interface-specific handling of IP addresses by facilitating address resolution, name services, and other functions. The following sections describe how to configure address resolution methods:

Establishing Address Resolution

Mapping Host Names to IP Addresses

Providing Service to DNS Clients

Configuring HP Probe Proxy Name Requests

Configuring the Next Hop Resolution Protocol

Establishing Address Resolution

A device in the IP can have both a local address (which uniquely identifies the device on its local segment or LAN) and a network address (which identifies the network to which the device belongs). The local address is more properly known as a data link address because it is contained in the data link layer (Layer  2 of the OSI model) part of the packet header and is read by data-link devices (bridges and all device interfaces, for example). The more technically inclined person will refer to local addresses as MAC addresses, because the MAC sublayer within the data link layer processes addresses for the layer.

To communicate with a device on Ethernet, for example, the Cisco IOS software first must determine the 48-bit MAC or local data-link address of that device. The process of determining the local data-link address from an IP address is called address resolution. The process of determining the IP address from a local data-link address is called reverse address resolution.

The software uses three forms of address resolution: Address Resolution Protocol (ARP), proxy ARP, and Probe (similar to ARP). The software also uses the Reverse Address Resolution Protocol (RARP). ARP, proxy ARP, and RARP are defined in RFCs 826, 1027, and 903, respectively. Probe is a protocol developed by the Hewlett-Packard Company (HP) for use on IEEE-802.3 networks.

ARP is used to associate IP addresses with media or MAC addresses. Taking an IP address as input, ARP determines the associated media address. Once a media or MAC address is determined, the IP address or media address association is stored in an ARP cache for rapid retrieval. Then the IP datagram is encapsulated in a link-layer frame and sent over the network. Encapsulation of IP datagrams and ARP requests and replies on IEEE 802 networks other than Ethernet is specified by the Subnetwork Access Protocol (SNAP).

RARP works the same way as ARP, except that the RARP request packet requests an IP address instead of a local data-link address. Use of RARP requires a RARP server on the same network segment as the router interface. RARP often is used by diskless nodes that do not know their IP addresses when they boot. The Cisco IOS software attempts to use RARP if it does not know the IP address of an interface at startup. Also, Cisco routers can act as RARP servers by responding to RARP requests that they are able to answer. See the "Configure Additional File Transfer Functions" chapter in the Cisco IOS Configuration Fundamentals Configuration Guide to learn how to configure a router as a RARP server.

The tasks required to set address resolution are contained in the following sections:

Defining a Static ARP Cache

Setting ARP Encapsulations

Enabling Proxy ARP

Configuring Local-Area Mobility

Defining a Static ARP Cache

ARP and other address resolution protocols provide a dynamic mapping between IP addresses and media addresses. Because most hosts support dynamic address resolution, generally you need not specify static ARP cache entries. If you must define them, you can do so globally. Performing this task installs a permanent entry in the ARP cache. The Cisco IOS software uses this entry to translate 32-bit IP addresses into 48-bit hardware addresses.

Optionally, you can specify that the software respond to ARP requests as if it were the owner of the specified IP address. In case you do not want the ARP entries to be permanent, you have the option of specifying an ARP entry timeout period when you define ARP entries.

The following two tables list the tasks to provide static mapping between IP addresses and a media address.

Use either of the following commands in global configuration mode to specify that the software respond to ARP requests:

Command
Purpose

Router(config)# arp ip-address hardware-address type

Globally associates an IP address with a media (hardware) address in the ARP cache.

Router(config)# arp ip-address hardware-address type alias

Specifies that the software responds to ARP requests as if it were the owner of the specified IP address.


Use the following command in interface configuration mode to set the length of time an ARP cache entry will stay in the cache:

Command
Purpose

Router(config-if)# arp timeout seconds

Sets the length of time an ARP cache entry will stay in the cache.


To display the type of ARP being used on a particular interface and also display the ARP timeout value, use the show interfaces EXEC command. Use the show arp EXEC command to examine the contents of the ARP cache. Use the show ip arp EXEC command to show IP entries. To remove all nonstatic entries from the ARP cache, use the clear arp-cache privileged EXEC command.

Setting ARP Encapsulations

By default, standard Ethernet-style ARP encapsulation (represented by the arpa keyword) is enabled on the IP interface. You can change this encapsulation method to SNAP or HP Probe, as required by your network, to control the interface-specific handling of IP address resolution into 48-bit Ethernet hardware addresses.

When you set HP Probe encapsulation, the Cisco IOS software uses the Probe protocol whenever it attempts to resolve an IEEE-802.3 or Ethernet local data-link address. The subset of Probe that performs address resolution is called Virtual Address Request and Reply. Using Probe, the router can communicate transparently with HP IEEE-802.3 hosts that use this type of data encapsulation. You must explicitly configure all interfaces for Probe that will use Probe.

To specify the ARP encapsulation type, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# arp {arpa | probe | snap}

Specifies one of three ARP encapsulation methods for a specified interface.


Enabling Proxy ARP

The Cisco IOS software uses proxy ARP (as defined in RFC 1027) to help hosts with no knowledge of routing determine the media addresses of hosts on other networks or subnets. For example, if the router receives an ARP request for a host that is not on the same interface as the ARP request sender, and if the router has all of its routes to that host through other interfaces, then it generates a proxy ARP reply packet giving its own local data-link address. The host that sent the ARP request then sends its packets to the router, which forwards them to the intended host. Proxy ARP is enabled by default.

To enable proxy ARP if it has been disabled, use the following command in interface configuration mode (as needed) for your network:

Command
Purpose

Router(config-if)# ip proxy-arp

Enables proxy ARP on the interface.


Configuring Local-Area Mobility

Local-area mobility provides the ability to relocate IP hosts within a limited area without reassigning host IP addresses and without changes to the host software. Local-area mobility is supported on Ethernet, Token Ring, and FDDI interfaces only.

To create a mobility area with only one router, use the following commands in the interface configuration mode:

 
Command
Purpose

Step 1 

Router(config-if)# interface type number

Enters interface configuration mode.

Step 2 

Router(config-if)# ip mobile arp [timers keepalive hold-time] [access-group access-list-number | name]

Enables local-area mobility.

To create larger mobility areas, you must first redistribute the mobile routes into your Interior Gateway Protocol (IGP). The IGP must support host routes. You can use Enhanced Interior Gateway Routing Protocol (IGRP), Open Shortest Path First (OSPF), IS-IS, or RIPv2. To redistribute the mobile routes into your existing IGP configuration, use the following commands in configuration mode:

 
Command
Purpose

Step 1 

Router(config)# router {eigrp autonomous-system | isis [tag] | ospf process-id | rip}

Enters router configuration mode.

Step 2 

Router(config)# default-metric number


or


Router(config)# default-metric bandwidth delay reliability loading mtu

Sets default metric values.

Step 3 

Router(config)# redistribute mobile

Redistributes the mobile routes.

Mobile routes will always be preferred over a subnet boundary or summarized route because they are more specific. It is important to ensure that configured or redistributed static routes do not include any host routes for the potentially mobile hosts; otherwise, a longest match could come up with two routes and cause ambiguity. Mobile routes will be seen as external routes to the configured routing protocol, even within a summarization area; therefore, they will not be properly summarized by default. This is the case even when these routes are advertised at a summarization boundary, if mobile hosts are not on their home subnet.

Mapping Host Names to IP Addresses

Each unique IP address can have an associated host name. The Cisco IOS software maintains a cache of host name-to-address mappings for use by the connect, telnet, and ping EXEC commands, and related Telnet support operations. This cache speeds the process of converting names to addresses.

IP defines a naming scheme that allows a device to be identified by its location in the IP. This is a hierarchical naming scheme that provides for domains. Domain names are pieced together with periods (.) as the delimiting characters. For example, Cisco is a commercial organization that the IP identifies by a com domain name, so its domain name is cisco.com. A specific device in this domain, the File Transfer Protocol (FTP) system, for example, is identified as ftp.cisco.com.

To keep track of domain names, IP has defined the concept of a name server, whose job is to hold a cache (or database) of names mapped to IP addresses. To map domain names to IP addresses, you must first identify the host names, then specify a name server, and enable the Domain Naming System (DNS), the global naming scheme of the Internet that uniquely identifies network devices. These tasks are described in the following sections:

Assigning Host Names to IP Addresses

Specifying the Domain Name

Specifying a Name Server

Enabling the DNS

Using the DNS to Discover ISO CLNS Addresses

Assigning Host Names to IP Addresses

The Cisco IOS software maintains a table of host names and their corresponding addresses, also called a host name-to-address mapping. Higher-layer protocols such as Telnet use host names to identify network devices (hosts). The router and other network devices must be able to associate host names with IP addresses to communicate with other IP devices. Host names and IP addresses can be associated with one another through static or dynamic means.

Manually assigning host names to addresses is useful when dynamic mapping is not available.

To assign host names to addresses, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip host name [tcp-port-number] address1 [address2...address8]

Statically associates host names with IP addresses.


Specifying the Domain Name

You can specify a default domain name that the Cisco IOS software will use to complete domain name requests. You can specify either a single domain name or a list of domain names. Any IP host name that does not contain a domain name will have the domain name you specify appended to it before being added to the host table.

To specify a domain name or names, use either of the following commands in global configuration mode:

Command
Purpose

Router(config)# ip domain name name

Defines a default domain name that the Cisco IOS software will use to complete unqualified host names.

Router(config)# ip domain list name

Defines a list of default domain names to complete unqualified host names.


See the "IP Domains Example" section at the end of this chapter for an example of establishing IP domains.

Specifying a Name Server

To specify one or more hosts (up to six) that can function as a name server to supply name information for the DNS, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip name-server server-address1 [server-address2...server-address6]

Specifies one or more hosts that supply name information.


Enabling the DNS

If your network devices require connectivity with devices in networks for which you do not control name assignment, you can assign device names that uniquely identify your devices within the entire internetwork. The global naming scheme of the Internet, the DNS, accomplishes this task. This service is enabled by default.

To re-enable DNS if it has been disabled, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip domain lookup

Enables DNS-based host name-to-address translation.


See the "Dynamic Lookup Example" section at the end of this chapter for an example of enabling the DNS.

Using the DNS to Discover ISO CLNS Addresses

If your router has both IP and ISO Connectionless Network Service (ISO CLNS) enabled and you want to use ISO CLNS network service access point (NSAP) addresses, you can use the DNS to query these addresses, as documented in RFC 1348. This feature is enabled by default.

To disable DNS queries for ISO CLNS addresses, use the following command in global configuration mode:

Command
Purpose

Router(config)# no ip domain-lookup nsap

Disables DNS queries for ISO CLNS addresses.


Providing Service to DNS Clients

To configure a router as a DNS server, you should understand the following concept:

DNS Overview

Details about configuring a Cisco router as a DNS server are provided in the following sections:

Role of the Cisco IOS DNS Server as an Authoritative Name Server

Configuring the Router as a DNS Server

Example Debugging Output

DNS Overview

If your network devices require connectivity with devices in networks for which you do not control name assignment, you can assign device names that uniquely identify your devices within the entire internetwork. The global naming scheme of the Internet, the DNS, accomplishes this task. This service is enabled by default. The following sections summarize DNS concepts and function:

Host Names for Network Devices

Each unique IP address can have an associated host name. DNS uses a hierarchical scheme for establishing host names for network nodes. This allows local control of the segments of the network through a client-server scheme. The DNS system can locate a network device by translating the host name of the device into its associated IP address.

Domains Names for Groups of Networks

IP defines a naming scheme that allows a device to be identified by its location in the IP. This is a hierarchical naming scheme that provides for domains. On the Internet, a domain is a portion of the naming hierarchy tree that refers to general groupings of networks based on organization type or geography. Domain names are pieced together with periods (.) as the delimiting characters. For example, Cisco is a commercial organization that the IP identifies by a com domain name, so its domain name is cisco.com. A specific device in this domain, the File Transfer Protocol (FTP) system, for example, is identified as ftp.cisco.com.

Name Servers

To keep track of domain names, IP has defined the concept of a name server. Name servers are programs that have complete information about their namespace portion of the domain tree and may also contain pointers to other name servers that can be used to lead to information from any other part of the domain tree. Name servers know the parts of the domain tree for which they have complete information. A name server may also store information about other parts of the domain tree. To map domain names to IP addresses, you must first identify the host names, then specify a name server, and enable the DNS service.

Cache

To speed the process of converting names to addresses, the name server maintains a database, called a cache, of host name-to-address mappings for use by the connect, telnet, and ping EXEC commands, and related Telnet support operations. The cache stores the results from previous responses. Upon receiving a client-issued DNS query, it will check this local storage to see if the answer is available locally.

Name Resolvers

Name resolvers are programs that extract information from name servers in response to client requests. Resolvers must be able to access at least one name server. The resolver either uses that name server's information to answer a query directly or pursues the query using referrals to other names servers. A resolver will typically be a system routine that is directly accessible to user programs. Therefore, no protocol is necessary between the resolver and the user program.

Zones

The domain namespace is divided into areas called zones that are points of delegation in the DNS tree. A zone contains all domains from a certain point downward, except those for which other zones are authoritative.

Authoritative Name Servers

A name server is said to be an authority for the parts of the domain tree for which it has complete information. A zone usually has an authoritative name server, often more than one. An authoritative name server has been configured with host table information or has acquired host table information though a zone transfer (the action that occurs when a secondary DNS server starts up and updates itself from the primary server).

DNS Operation

Within an organization, you can have many name servers, but Internet clients can query only those that the root name servers know. The other name servers answer internal queries only.

A name server handles client-issued queries to the DNS server for locally defined hosts within a particular zone as follows:

An authoritative name server responds to DNS user queries for a domain name that is under its zone of authority by using the permanent and cached entries in its own host table. If the query is for a domain name that is under its zone of authority but for which it does not have any configuration information, the authoritative name server simply replies that no such information exists..

A name server that is not configured as the authoritative name server responds to DNS user queries by using information that it has cached from previously received query responses. If no router is configured as the authoritative name server for a zone, queries to the DNS server for locally defined hosts will receive nonauthoritative responses.

Name servers answer DNS queries (forward incoming DNS queries or resolve internally generated DNS queries) according to the forwarding and lookup parameters configured for the specific domain.

Role of the Cisco IOS DNS Server as an Authoritative Name Server

An authoritative name server usually issues zone transfers or responds to zone transfer requests from other authoritative name servers for the same zone. However, the Cisco IOS DNS server does not perform zone transfers.

When it receives a DNS query, an authoritative name server handles the query as follows:

If the query is for a domain name that is not under its zone of authority, the authoritative name server determines whether to forward the query to specific back-end name servers based on whether IP DNS-based hostname-to-address translation has been enabled via the ip domain lookup command.

If the query is for a domain name that is under its zone of authority and for which it has configuration information, the authoritative name server answers the queriy using the permanent and cached entries in its own host table.

If the query is for a domain name that is under its zone of authority but for which it does not have any configuration information, the authoritative name server does not forward the query elsewhere for a response; instead the authoritative name server simply replies that no such information exists.

Configuring the Router as a DNS Server

Perform this task to configure the router as a DNS server.

A Cisco IOS router can provide service to DNS clients, acting as both a caching name server and as an authoritative name server for its own local host table.

When configured as a caching name server, the router relays DNS requests to other name servers that that resolve network names into network addresses. The caching name server caches information learned from other name servers so that it can answer requests quickly, without having to query other servers for each transaction.

When configured as an authoritative name server for its own local host table, the router listens on port 53 for DNS queries and then answers DNS queries using the permanent and cached entries in its own host table.


Note Unless Distributed Director is enabled, the TTL on locally defined resource records will always be ten seconds, regardless of any authority record parameters that may have been specified for the DNS name server by the use of the ip dns primary command.


To configure a Cisco IOS router as a DNS server, use the following commands in global configuration mode as needed:

Command
Purpose

ip dns server

Enables the DNS server.

ip name-server server-address1
[server-address2...server-address6]

(Optional) Configures other DNS servers:

IOS resolver name servers

DNS server forwarders

Note If the IOS name server is being configured to respond only to domain names for which it is authoritative, there is no need to configure other DNS servers.

ip host [vrf vrf-name] [view view-name] hostname {address1 [address2 ... address8] | additional address9 [address10 ... addressn]}

(Optional) Configures local hosts.

ip dns primary domain-name soa primary-server-name mailbox-name [refresh-interval [retry-interval [expire-ttl [minimum-ttl]]]]

Configures the router as the primary DNS name server for a domain (zone) and as the start of authority (SOA) record source (which designates the start of a zone).

Note Unless Distributed Director is enabled, the TTL on locally defined resource records will always be ten seconds, regardless of any authority record parameters that may have been specified for the DNS name server by the use of the ip dns primary command.

ip host domain-name ns server-name

(Optional) Configures the router to create an NS resource record to be returned when the DNS server is queried for the associated domain. This configuration is needed only if the zone for which the system is authoritative will also be served by other name servers.

Example Debugging Output

This section provides examples of debugging output that is logged when a router is configured as an authoritative name server for its own local host table and the debug domain command is in effect:

Debugging Output for Relaying a DNS Query to Another Name Server: Example

Debugging Output for Servicing a DNS Query from the Local Host Table: Example


Note For DNS-based X.25 routing, the debug x25 events command supports functionality to describe the events that occur while the X.25 address is being resolved to an IP address using a DNS server. The debug domain command can be used along with debug x25 events to observe the whole DNS-based X.25 routing data flow.


Debugging Output for Relaying a DNS Query to Another Name Server: Example

The following is sample output from the debug domain command that corresponds to relaying a DNS query to another name server when the router is configured as an authoritative name server for its own local host table:

Apr  4 22:18:32.183: DNS: Incoming UDP query (id#18713)
Apr  4 22:18:32.183: DNS: Type 1 DNS query (id#18713) for host 'ns1.example.com' from 
192.0.2.120(1283)
Apr  4 22:18:32.183: DNS: Re-sending DNS query (type 1, id#18713) to 192.0.2.121 
Apr  4 22:18:32.211: DNS: Incoming UDP query (id#18713)
Apr  4 22:18:32.211: DNS: Type 1 response (id#18713) for host <ns1.example.com> from 
192.0.2.121(53)
Apr  4 22:18:32.215: DOM: dom2cache: hostname is ns1.example.com, RR type=1, class=1, 
ttl=86400, n=4
Apr  4 22:18:32.215: DNS: Forwarding back A response - no director required
Apr  4 22:18:32.215: DNS: Finished processing query (id#18713) in 0.032 secs
Apr  4 22:18:32.215: DNS: Forwarding back reply to 192.0.2.120/1283

Debugging Output for Servicing a DNS Query from the Local Host Table: Example

The following is sample output from the debug domain command that corresponds to servicing a DNS query from the local host table when the router is configured as an authoritative name server for its own local host table:

Apr  4 22:16:35.279: DNS: Incoming UDP query (id#8409)
Apr  4 22:16:35.279: DNS: Type 1 DNS query (id#8409) for host 'ns1.example.com' from 
192.0.2.120(1279)
Apr  4 22:16:35.279: DNS: Finished processing query (id#8409) in 0.000 secs

Configuring HP Probe Proxy Name Requests

HP Probe Proxy support allows the Cisco IOS software to respond to HP Probe Proxy name requests. These requests are typically used at sites that have HP equipment and are already using HP Probe Proxy. Tasks associated with HP Probe Proxy are shown in the following two tables.

To configure HP Probe Proxy, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip probe proxy

Allows the Cisco IOS software to respond to HP Probe Proxy name requests.


To configure HP Probe Proxy, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip hp-host hostname ip-address

Enters the host name of an HP host (for which the router is acting as a proxy) into the host table.


See the "HP Hosts on a Network Segment Example" section at the end of this chapter for an example of configuring HP hosts on a network segment.

Configuring the Next Hop Resolution Protocol

Routers, access servers, and hosts can use Next Hop Resolution Protocol (NHRP) to discover the addresses of other routers and hosts connected to a nonbroadcast multiaccess (NBMA) network. Partially meshed NBMA networks are typically configured with multiple logical networks to provide full network layer connectivity. In such configurations, packets might make several hops over the NBMA network before arriving at the exit router (the router nearest the destination network). In addition, such NBMA networks (whether partially or fully meshed) typically require tedious static configurations. These static configurations provide the mapping between network layer addresses (such as IP) and NBMA addresses (such as E.164 addresses for SMDS).

NHRP provides an ARP-like solution that alleviates these NBMA network problems. With NHRP, systems attached to an NBMA network dynamically learn the NBMA address of the other systems that are part of that network, allowing these systems to directly communicate without requiring traffic to use an intermediate hop.

The NBMA network is considered nonbroadcast either because it technically does not support broadcasting (for example, an X.25 network) or because broadcasting is too expensive (for example, an SMDS broadcast group that would otherwise be too large).

The Cisco Implementation of NHRP

The Cisco implementation of NHRP supports the IETF draft version 11 of NBMA Next Hop Resolution Protocol (NHRP).

The Cisco implementation of NHRP supports IP Version 4, Internet Packet Exchange (IPX) network layers, and, at the link layer, ATM, Ethernet, SMDS, and multipoint tunnel networks. Although NHRP is available on Ethernet, NHRP need not be implemented over Ethernet media because Ethernet is capable of broadcasting. Ethernet support is unnecessary (and not provided) for IPX.

Figure 3 illustrates four routers connected to an NBMA network. Within the network are ATM or SMDS switches necessary for the routers to communicate with each other. Assume that the switches have virtual circuit (VC) connections represented by hops 1, 2, and 3 of the figure. When Router A attempts to forward an IP packet from the source host to the destination host, NHRP is triggered. On behalf of the source host, Router A sends an NHRP request packet encapsulated in an IP packet, which takes three hops across the network to reach Router D, connected to the destination host. After receiving a positive NHRP reply, Router D is determined to be the "NBMA next hop," and Router A sends subsequent IP packets for the destination to Router D in one hop.

Figure 3 Next Hop Resolution Protocol

With NHRP, once the NBMA next hop is determined, the source either starts sending data packets to the destination (in a connectionless NBMA network such as SMDS) or establishes a virtual circuit VC connection to the destination with the desired bandwidth and quality of service (QoS) characteristics (in a connection-oriented NBMA network such as ATM).

Other address resolution methods can be used while NHRP is deployed. IP hosts that rely upon the Logical IP Subnet (LIS) model might require ARP servers and services over NBMA networks, and deployed hosts might not implement NHRP, but might continue to support ARP variations. NHRP is designed to eliminate the suboptimal routing that results from the LIS model, and can be deployed with existing ARP services without interfering with them.

NHRP is used to facilitate building a Virtual Private Network (VPN). In this context, a VPN consists of a virtual Layer 3 network that is built on top of an actual Layer 3 network. The topology you use over the VPN is largely independent of the underlying network, and the protocols you run over it are completely independent of it.

Connected to the NBMA network are one or more stations that implement NHRP, and are known as Next Hop Servers. All routers running Cisco IOS Release 10.3 or later releases can implement NHRP and, thus, can act as Next Hop Servers.

Each Next Hop Server serves a set of destination hosts, which might be directly connected to the NBMA network. Next Hop Servers cooperatively resolve the NBMA next hop addresses within their NBMA network. Next Hop Servers typically also participate in protocols used to disseminate routing information across (and beyond the boundaries of) the NBMA network, and might support ARP service.

A Next Hop Server maintains a "next hop resolution" cache, which is a table of network layer address to NBMA address mappings. The table is created from information gleaned from NHRP register packets extracted from NHRP request or reply packets that traverse the Next Hop Server as they are forwarded, or through other means such as ARP and preconfigured tables.

Protocol Operation

NHRP requests traverse one or more hops within an NBMA subnetwork before reaching the station that is expected to generate a response. Each station (including the source station) chooses a neighboring Next Hop Server to forward the request to. The Next Hop Server selection procedure typically involves performing a routing decision based upon the network layer destination address of the NHRP request. Ignoring error situations, the NHRP request eventually arrives at a station that generates an NHRP reply. This responding station either serves the destination, is the destination itself, or is a client that specified it should receive NHRP requests when it registered with its server. The responding station generates a reply using the source address from within the NHRP packet to determine where the reply should be sent.

NHRP Configuration Task List

To configure NHRP, perform the tasks described in the following sections. The tasks in the first section are required; the tasks in the remaining sections are optional.

Enabling NHRP on an Interface (Required)

Configuring a Static IP-to-NBMA Address Mapping for a Station (Optional)

Statically Configuring a Next Hop Server (Optional)

Configuring NHRP Authentication (Optional)

Controlling the Triggering of NHRP (Optional)

Triggering NHRP Based on Traffic Thresholds (Optional)

Controlling the NHRP Packet Rate (Optional)

Suppressing Forward and Reverse Record Options (Optional)

Specifying the NHRP Responder Address (Optional)

Changing the Time Period NBMA Addresses Are Advertised as Valid (Optional)

Configuring a GRE Tunnel for Multipoint Operation (Optional)

Configuring NHRP Server-Only Mode (Optional)

Enabling NHRP on an Interface

To enable NHRP for an interface on a router, use the following command in interface configuration mode. In general, all NHRP stations within a logical NBMA network must be configured with the same network identifier.

Command
Purpose

Router(config-if)# ip nhrp network-id number

Enables NHRP on an interface.


See the "Logical NBMA Example" section and the "NHRP over ATM Example" section at the end of this chapter for examples of enabling NHRP.

Configuring a Static IP-to-NBMA Address Mapping for a Station

To participate in NHRP, a station connected to an NBMA network should be configured with the IP and NBMA addresses of its Next Hop Servers. The format of the NBMA address depends on the medium you are using. For example, ATM uses an NSAP address, Ethernet uses a MAC address, and SMDS uses an E.164 address.

These Next Hop Servers may also be the default or peer routers of the station, so their addresses can be obtained from the network layer forwarding table of the station.

If the station is attached to several link layer networks (including logical NBMA networks), the station should also be configured to receive routing information from its Next Hop Servers and peer routers so that it can determine which IP networks are reachable through which link layer networks.

To configure static IP-to-NBMA address mapping on a station (host or router), use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp map ip-address nbma-address

Configures static IP-to-NBMA address mapping.


Statically Configuring a Next Hop Server

A Next Hop Server normally uses the network layer forwarding table to determine where to forward NHRP packets, and to find the egress point from an NBMA network. A Next Hop Server may alternately be statically configured with a set of IP address prefixes that correspond to the IP addresses of the stations it serves, and their logical NBMA network identifiers.

To statically configure a Next Hop Server, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp nhs nhs-address [net-address [netmask]]

Statically configures a Next Hop Server.


To configure multiple networks that the Next Hop Server serves, repeat the ip nhrp nhs command with the same Next Hop Server address, but different IP network addresses. To configure additional Next Hop Servers, repeat the ip nhrp nhs command.

Configuring NHRP Authentication

Configuring an authentication string ensures that only routers configured with the same string can communicate using NHRP. Therefore, if the authentication scheme is to be used, the same string must be configured in all devices configured for NHRP on a fabric. To specify the authentication string for NHRP on an interface, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp authentication string

Specifies an authentication string.


Controlling the Triggering of NHRP

On any platform, there are two ways to control when NHRP is triggered. These methods are described in the following sections:

Triggering NHRP by IP Packets

Triggering NHRP on a per-Destination Basis

Triggering NHRP by IP Packets

You can specify an IP access list that is used to decide which IP packets can trigger the sending of NHRP requests. By default, all non-NHRP packets trigger NHRP requests. To limit which IP packets trigger NHRP requests, define an access list and then apply it to the interface.

To define an access list, use the following commands in global configuration mode as needed:

Command
Purpose

Router(config)# access-list access-list-number {deny | permit} source [source-wildcard]

Defines a standard IP access list.

Router(config)# access-list access-list-number {deny | permit} protocol source source-wildcard destination destination-wildcard [precedence precedence] [tos tos] [established] [log]

Defines an extended IP access list.


To apply the IP access list to the interface, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp interest access-list-number

Specifies an IP access list that controls NHRP requests.


Triggering NHRP on a per-Destination Basis

By default, when the software attempts to send a data packet to a destination for which it has determined that NHRP can be used, it sends an NHRP request for that destination. To configure the system to wait until a specified number of data packets have been sent to a particular destination before NHRP is attempted, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp use usage-count

Specifies how many data packets are sent to a destination before NHRP is attempted.


Triggering NHRP Based on Traffic Thresholds

NHRP can run on Cisco Express Forwarding (CEF) platforms when NHRP runs with BGP over ATM media. You can configure NHRP to initiate switched virtual circuits (SVCs) once a configured traffic rate is reached. Similarly, SVCs can be torn down when traffic falls to another configured rate.

Prior to Cisco IOS Release 12.0, a single packet could trigger an SVC. Now you can configure the traffic rate that must be reached before NHRP sets up or tears down an SVC. Because SVCs are created only for burst traffic, you can conserve resources.

Restrictions

Cisco IOS releases prior to Release 12.0 implemented NHRP draft version 4. Cisco IOS Release 12.0 and later implements NHRP draft version 11. These versions are not compatible. Therefore, all routers running NHRP in a network must run the same version of NHRP in order to communicate with each other. All routers must run Cisco IOS Release 12.0 and later, or all routers must run a release prior to Release 12.0, but not a combination of the two.

Additional restrictions:

They work on CEF platforms only.

They work on ATM media only.

BGP must be configured in the network where these enhancements are running.

Prerequisites

Before you configure the feature whereby NHRP initiation is based on traffic rate, the following conditions must exist in the router:

ATM must be configured.

CEF switching or distributed CEF (dCEF) switching must be enabled.

BGP must be configured on all routers in the network.

If you have CEF switching or dCEF switching and you want NHRP to work (whether with default values or changed values), the ip cef accounting non-recursive command must be configured.

NHRP Configuration Task List

To configure the NHRP triggering and teardown of SVCs based on traffic rate, perform the tasks described in the following sections. The tasks in the first section are required, the tasks in the remaining section are optional.

Changing the Rate for Triggering SVCs (Required)

Applying the Rates to Specific Destinations (Optional)

Changing the Rate for Triggering SVCs

When NHRP runs with BGP over ATM media, there is an additional way to control the triggering of NHRP packets. This method consists of SVCs being initiated based on the input traffic rate to a given BGP next hop.

When BGP discovers a BGP next hop and enters this BGP route into the routing table, an NHRP request is sent to the BGP next hop. When an NHRP reply is received, a subsequent route is put in the NHRP cache that directly corresponds to the BGP next hop.

A new NHRP request is sent to the same BGP next hop to repopulate the NHRP cache. When an NHRP cache entry is generated, a subsequent ATM map statement to the same BGP next hop is also created.

Aggregate traffic to each BGP next hop is measured and monitored. Once the aggregate traffic has met or exceeded the configured trigger rate, NHRP creates an ATM SVC and sends traffic directly to that destination router. The router tears down the SVC to the specified destination(s) when the aggregate traffic rate falls to or below the configured teardown rate.

By default, NHRP will set up an SVC for a destination when aggregate traffic for that destination is more than 1 kbps over a running average of 30 seconds. Similarly, NHRP will tear down the SVC when the traffic for that destination drops to 0 kbps over a running average of 30 seconds. There are several ways to change the rate at which SVC set or teardown occurs. You can change the number of kbps thresholds, or the load interval, or both.

To change the number of kbps at which NHRP sets up or tears down the SVC to this destination, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp trigger-svc trigger-threshold teardown-threshold

Changes the point at which NHRP sets up or tears down SVCs.


You can change the sampling time period; that is, you can change the length of time over which the average trigger rate or teardown rate is calculated. By default, the period is 30 seconds; the range is from 30 to 300 seconds in 30-second increments. This period is for calculations of aggregate traffic rate internal to Cisco IOS software only, and it represents a worst case time period for taking action. In some cases, the software will act sooner, depending on the ramp-up and fall-off rate of the traffic.

To change the sampling time period during which threshold rates are averaged, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip cef traffic-statistics [load-interval seconds]

Changes the length of time in a sampling period during which trigger and teardown thresholds are averaged.


If your Cisco hardware has a Virtual Interface Processor, version 2 adapter, you must perform the following task to change the sampling time. By default, the port adapter sends the traffic statistics to the Route Processor every 10 seconds. If you are using NHRP in dCEF switching mode, you must change this update rate to 5 seconds. To do so, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip cef traffic-statistics [update-rate seconds]

Changes the rate at which the port adapter sends traffic statistics to the RP.


Applying the Rates to Specific Destinations

By default, all destinations are measured and monitored for NHRP triggering. However, you can choose to impose the triggering and teardown rates on certain destinations. To do so, use the following commands beginning in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# access-list access-list-number {deny | permit} source [source-wildcard]


or

access-list access-list-number {deny | permit} protocol source source-wildcard destination destination-wildcard [precedence precedence] [tos tos] [log]

Defines a standard or extended IP access list.

Step 2 

Router(config)# interface type number

Enters interface configuration mode.

Step 3 

Router(interface config)# ip nhrp interest access-list

Assigns the access list created in Step 1 that determines which destinations are included in or excluded from the SVC triggering.

For an example of setting the load interval, see the section "Changing the Rate for Triggering SVCs Example" at the end of this chapter. For an example of applying rates to destinations, see the section "Applying NHRP Rates to Specific Destinations Example" at the end of this chapter.

Controlling the NHRP Packet Rate

By default, the maximum rate at which the software sends NHRP packets is 5 packets per 10 seconds. The software maintains a per- interface quota of NHRP packets (whether generated locally or forwarded) that can be sent. To change this maximum rate, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp max-send pkt-count every interval

Changes the NHRP packet rate per interface.


Suppressing Forward and Reverse Record Options

To dynamically detect link layer filtering in NBMA networks (for example, SMDS address screens), and to provide loop detection and diagnostic capabilities, NHRP incorporates a Route Record in request and reply packets. The Route Record options contain the network (and link layer) addresses of all intermediate Next Hop Servers between source and destination (in the forward direction) and between destination and source (in the reverse direction).

By default, Forward Record options and Reverse Record options are included in NHRP request and reply packets. To suppress the use of these options, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# no ip nhrp record

Suppresses Forward and Reverse Record options.


Specifying the NHRP Responder Address

If an NHRP requester wants to know which Next Hop Server generates an NHRP reply packet, it can request that information by including the responder address option in its NHRP request packet. The Next Hop Server that generates the NHRP reply packet then complies by inserting its own IP address in the NHRP reply. The Next Hop Server uses the primary IP address of the specified interface.

To specify which interface the Next Hop Server uses for the NHRP responder IP address, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp responder type number

Specifies which interface the Next Hop Server uses to determine the NHRP responder address.


If an NHRP reply packet being forwarded by a Next Hop Server contains the IP address of that server, the Next Hop Server generates an error indication of type "NHRP Loop Detected" and discards the reply.

Changing the Time Period NBMA Addresses Are Advertised as Valid

You can change the length of time that NBMA addresses are advertised as valid in positive NHRP responses. In this context, advertised means how long the Cisco IOS software tells other routers to keep the addresses it is providing in NHRP responses. The default length of time is 7200 seconds (2 hours). To change the length of time, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp holdtime seconds

Specifies the number of seconds that NBMA addresses are advertised as valid in positive NHRP responses.


Configuring a GRE Tunnel for Multipoint Operation

You can enable a generic routing encapsulation (GRE) tunnel to operate in multipoint fashion. A tunnel network of multipoint tunnel interfaces can be thought of as an NBMA network. To configure the tunnel, use the following commands in interface configuration mode:

 
Command
Purpose

Step 1 

Router(config-if)# tunnel mode gre ip multipoint

Enables a GRE tunnel to be used in multipoint fashion.

Step 2 

Router(config-if)# tunnel key key-number

Configures a tunnel identification key.

The tunnel key should correspond to the NHRP network identifier specified in the ip nhrp network-id interface configuration command. See the "NHRP on a Multipoint Tunnel Example" section at the end of this chapter for an example of NHRP configured on a multipoint tunnel.

Configuring NHRP Server-Only Mode

You can configure an interface so that it cannot initiate NHRP requests or set up NHRP shortcut SVCs but can only respond to NHRP requests. Configure NHRP server-only mode on routers you do not want placing NHRP requests.

If an interface is placed in NHRP server-only mode, you have the option to specify the non-caching keyword. In this case, NHRP does not store information in the NHRP cache, such as NHRP responses that could be used again. To save memory, the non caching option is generally used on a router located between two other routers.

To configure NHRP server-only mode, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip nhrp server-only [non-caching]

Configures NHRP server-only mode.


Enabling IP Routing

IP routing is automatically enabled in the Cisco IOS software. If you choose to set up the router to bridge rather than route IP datagrams, you must disable IP routing. To re-enable IP routing if it has been disabled, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip routing

Enables IP routing.


When IP routing is disabled, the router will act as an IP end host for IP packets destined for or sourced by it, whether or not bridging is enabled for those IP packets not destined for the device. To re-enable IP routing, use the ip routing command.

Routing Assistance When IP Routing Is Disabled

The Cisco IOS software provides three methods by which the router can learn about routes to other networks when IP routing is disabled and the device is acting as an IP host. These methods are described in the sections that follow:

Proxy ARP

Default Gateway (also known as default router)

ICMP Router Discovery Protocol

When IP routing is disabled, the default gateway feature and the router discovery client are enabled, and proxy ARP is disabled. When IP routing is enabled, the default gateway feature is disabled and you can configure proxy ARP and the router discovery servers.

Proxy ARP

The most common method of learning about other routes is by using proxy ARP. Proxy ARP, defined in RFC 1027, enables an Ethernet host with no knowledge of routing to communicate with hosts on other networks or subnets. Such a host assumes that all hosts are on the same local Ethernet, and that it can use ARP to determine their hardware addresses.

Under proxy ARP, if a device receives an ARP request for a host that is not on the same network as the ARP request sender, the Cisco IOS software evaluates whether it has the best route to that host. If it does, the device sends an ARP reply packet giving its own Ethernet hardware address. The host that sent the ARP request then sends its packets to the device, which forwards them to the intended host. The software treats all networks as if they are local and performs ARP requests for every IP address. This feature is enabled by default. If it has been disabled, see the section "Enabling Proxy ARP" earlier in this chapter.

Proxy ARP works as long as other routers support it. Many other routers, especially those loaded with host-based routing software, do not support it.

Default Gateway

Another method for locating routes is to define a default router (or gateway). The Cisco IOS software sends all nonlocal packets to this router, which either routes them appropriately or sends an IP Control Message Protocol (ICMP) redirect message back, telling the router of a better route. The ICMP redirect message indicates which local router the host should use. The software caches the redirect messages and routes each packet thereafter as efficiently as possible. The limitations of this method are that there is no means of detecting when the default router has gone down or is unavailable, and there is no method of picking another device if one of these events should occur.

To set up a default gateway for a host, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip default-gateway ip-address

Sets up a default gateway (router).


To display the address of the default gateway, use the show ip redirects EXEC command.

ICMP Router Discovery Protocol

The Cisco IOS software provides a third method, called router discovery, by which the router dynamically learns about routes to other networks using the ICMP Router Discovery Protocol IRDP). IRDP allows hosts to locate routers. When the device operates as a client, router discovery packets are generated. When the device operates as a host, router discovery packets are received. The Cisco IRDP implementation fully conforms to the router discovery protocol outlined in RFC 1256.

The software is also capable of wire-tapping Routing Information Protocol (RIP) and Interior Gateway Routing Protocol (IGRP) routing updates and inferring the location of routers from those updates. The client/server implementation of router discovery does not actually examine or store the full routing tables sent by routing devices, it merely keeps track of which systems are sending such data.

You can configure the four protocols in any combination. We recommend that you use IRDP when possible because it allows each router to specify both a priority and the time after which a device should be assumed down if no further packets are received. Devices discovered using IGRP are assigned an arbitrary priority of 60. Devices discovered through RIP are assigned a priority of 50. For IGRP and RIP, the software attempts to measure the time between updates, and assumes that the device is down if no updates are received for 2.5 times that interval.

Each device discovered becomes a candidate for the default router. The list of candidates is scanned and a new highest-priority router is selected when any of the following events occurs:

When a higher-priority router is discovered (the list of routers is polled at 5-minute intervals).

When the current default router is declared down.

When a TCP connection is about to time out because of excessive retransmissions. In this case, the server flushes the ARP cache and the ICMP redirect cache, and picks a new default router in an attempt to find a successful route to the destination.

Enabling IRDP Processing

Only one task for configuring IRDP routing on a specified interface is required. To enable IRDP processing on an interface, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip irdp

Enables IRDP processing on an interface.


Changing IRDP Parameters

When you enable IRDP processing, the default parameters will apply. To optionally change any of these IRDP parameters, use the following commands in interface configuration mode, as needed:

Command
Purpose

Router(config-if)# ip irdp multicast

Sends IRDP advertisements to the all-systems multicast address (224.0.0.1) on a specified interface.

Router(config-if)# ip irdp holdtime seconds

Sets the IRDP period for which advertisements are valid.

Router(config-if)# ip irdp maxadvertinterval seconds

Sets the IRDP maximum interval between advertisements.

Router(config-if)# ip irdp minadvertinterval seconds

Sets the IRDP minimum interval between advertisements.

Router(config-if)# ip irdp preference number

Sets the IRDP preference level of the device.

Router(config-if)# ip irdp address address [number]

Specifies an IRDP address and preference to proxy-advertise.


The Cisco IOS software can proxy-advertise other machines that use IRDP; however, this practice is not recommended because it is possible to advertise nonexistent machines or machines that are down.

Enabling IP Bridging

To transparently bridge IP on an interface, use the following commands beginning in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# no ip routing

Disables IP routing.

Step 2 

Router(config)# interface type number

Specifies an interface and enters interface configuration mode.

Step 3 

Router(config-if)# bridge-group group

Adds the interface to a bridge group.

Enabling Integrated Routing and Bridging

With integrated routing and bridging (IRB), you can route IP traffic between routed interfaces and bridge groups, or route IP traffic between bridge groups. Specifically, local or unroutable traffic is bridged among the bridged interfaces in the same bridge group, while routable traffic is routed to other routed interfaces or bridge groups. IRB can be used to switch packets in the following ways:

From a bridged interface to a routed interface

From a routed interface to a bridged interface

Within the same bridge group

For more information about configuring integrated routing and bridging, refer to the "Configuring Transparent Bridging" chapter in the Cisco IOS Bridging and IBM Networking Configuration Guide.

Configuring a Routing Process

At this point in the configuration process, you can choose to configure one or more of the many routing protocols that are available, based on your individual network needs. Routing protocols provide topology information of an internetwork. Refer to subsequent chapters in this document for the tasks involved in configuring IP routing protocols such as BGP, On-Demand Routing (ODR), RIP, IGRP, OSPF, IP Enhanced IGRP, Integrated IS-IS, and IP multicast routing. If you want to continue to perform IP addressing tasks, continue reading the following sections.

Configuring Broadcast Packet Handling

A broadcast is a data packet destined for all hosts on a particular physical network. Network hosts recognize broadcasts by special addresses. Broadcasts are heavily used by some protocols, including several important Internet protocols. Control of broadcast messages is an essential responsibility of the IP network administrator.

The Cisco IOS software supports two kinds of broadcasting: directed broadcasting and flooding. A directed broadcast is a packet sent to a specific network or series of networks, while a flooded broadcast packet is sent to every network. A directed broadcast address includes the network or subnet fields.

Several early IP implementations do not use the current broadcast address standard. Instead, they use the old standard, which calls for all 0s instead of all 1s to indicate broadcast addresses. Many of these implementations do not recognize an all-1s broadcast address and fail to respond to the broadcast correctly. Others forward all-1s broadcasts, which causes a serious network overload known as a broadcast storm. Implementations that exhibit these problems include systems based on versions of Berkeley Standard Distribution (BSD) UNIX prior to Version 4.3.

Routers provide some protection from broadcast storms by limiting their extent to the local cable. Bridges (including intelligent bridges), because they are Layer 2 devices, forward broadcasts to all network segments, thus propagating all broadcast storms.

The best solution to the broadcast storm problem is to use a single broadcast address scheme on a network. Most modern IP implementations allow the network manager to set the address to be used as the broadcast address. Many implementations, including the one in the Cisco IOS software, accept and interpret all possible forms of broadcast addresses.

For detailed discussions of broadcast issues in general, see RFC 919, Broadcasting Internet Datagrams, and RFC 922, Broadcasting IP Datagrams in the Presence of Subnets. The support for Internet broadcasts generally complies with RFC 919 and RFC 922; it does not support multisubnet broadcasts as defined in RFC 922.

The current broadcast address standard provides specific addressing schemes for forwarding broadcasts. To enable these schemes, perform the tasks described in the following sections. The task in the first section is required; the tasks in the remaining sections are optional.

Enabling Directed Broadcast-to-Physical Broadcast Translation (Required)

Forwarding UDP Broadcast Packets and Protocols (Optional)

Establishing an IP Broadcast Address (Optional)

Flooding IP Broadcasts (Optional)

See the "Broadcasting Examples" section at the end of this chapter for broadcasting configuration examples.

Enabling Directed Broadcast-to-Physical Broadcast Translation

By default, IP directed broadcasts are dropped; they are not forwarded. Dropping IP directed broadcasts makes routers less susceptible to denial-of-service attacks.

You can enable forwarding of IP directed broadcasts on an interface where the broadcast becomes a physical broadcast. If such forwarding is enabled, only those protocols configured using the ip forward-protocol global configuration command are forwarded.

You can specify an access list to control which broadcasts are forwarded. When an access list is specified, only those IP packets permitted by the access list are eligible to be translated from directed broadcasts to physical broadcasts.

To enable forwarding of IP directed broadcasts, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip directed-broadcast [access-list-number]

Enables directed broadcast-to-physical broadcast translation on an interface.


Forwarding UDP Broadcast Packets and Protocols

Network hosts occasionally use User Datagram Protocol (UDP) broadcasts to determine address, configuration, and name information. If such a host is on a network segment that does not include a server, UDP broadcasts normally are not forwarded. You can remedy this situation by configuring the interface of your router to forward certain classes of broadcasts to a helper address. You can use more than one helper address per interface.

You can specify a UDP destination port to control which UDP services are forwarded. You can specify multiple UDP protocols. You can also specify the Network Disk (ND) protocol, which is used by older diskless Sun workstations, and you can specify the network security protocol, Software Defined Network Service (SDNS). By default, both UDP and ND forwarding are enabled if a helper address has been defined for an interface. The description for the ip forward-protocol global configuration command in the Cisco IOS IPCommand Reference, Volume 1 of 3: Addressing and Services publication lists the ports that are forwarded by default if you do not specify any UDP ports.

If you do not specify any UDP ports when you configure the forwarding of UDP broadcasts, you are configuring the router to act as a BOOTP forwarding agent. BOOTP packets carry Dynamic Host Configuration Protocol (DHCP) information, which means that the Cisco IOS software is compatible with DHCP clients. (DHCP is defined in RFC 1531.)

To enable forwarding and to specify the destination address, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip helper-address address

Enables forwarding and specifies the destination address for forwarding UDP broadcast packets, such as BOOTP and DHCP.


To specify which protocols will be forwarded, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip forward-protocol {udp [port] | nd | sdns}

Specifies which protocols will be forwarded over which ports.


See the "Helper Addresses Example" section at the end of this chapter for an example of how to configure helper addresses.

Establishing an IP Broadcast Address

The Cisco IOS software supports IP broadcasts on both LANs and WANs. There are several ways to indicate an IP broadcast address. Currently, the most popular way, and the default, is an address consisting of all 1s (255.255.255.255), although the software can be configured to generate any form of IP broadcast address. Cisco software can receive and understand any form of IP broadcast.

To set the IP broadcast address, use the following command in interface configuration mode:

Command
Purpose

Router(config-if)# ip broadcast-address [ip-address]

Establishes a different broadcast address (other than 255.255.255.255).


If the router does not have nonvolatile memory, and you need to specify the broadcast address to use before the software is configured, you must change the IP broadcast address by setting jumpers in the processor configuration register. Setting bit 10 causes the device to use all 0s. Bit 10 interacts with bit 14, which controls the network and subnet portions of the broadcast address. Setting bit 14 causes the device to include the network and subnet portions of its address in the broadcast address. Table 4 shows the combined effect of setting bits 10 and 14.

Table 4 Configuration Register Settings for Broadcast Address Destination

Bit 14
Bit 10
Address (<net><host>)

Out

Out

<ones><ones>

Out

In

<zeros><zeros>

In

In

<net><zeros>

In

Out

<net><ones>


Some router platforms allow the configuration register to be set through the software; see the "Rebooting" chapter of the Cisco IOS Configuration Fundamentals Configuration Guide for details. For other router platforms, the configuration register must be changed through hardware; see the appropriate hardware installation and maintenance manual for your system.

Flooding IP Broadcasts

You can allow IP broadcasts to be flooded throughout your internetwork in a controlled fashion using the database created by the bridging spanning-tree protocol. Turning on this feature also prevents loops. In order to support this capability, the routing software must include the transparent bridging, and bridging must be configured on each interface that is to participate in the flooding. If bridging is not configured on an interface, it still will be able to receive broadcasts. However, the interface will never forward broadcasts it receives, and the router will never use that interface to send broadcasts received on a different interface.

Packets that are forwarded to a single network address using the IP helper address mechanism can be flooded. Only one copy of the packet is sent on each network segment.

In order to be considered for flooding, packets must meet the following criteria. (Note that these are the same conditions used to consider packet forwarding using IP helper addresses.)

The packet must be a MAC-level broadcast.

The packet must be an IP-level broadcast.

The packet must be a Trivial File Transfer Protocol (TFTP), DNS, Time, NetBIOS, ND, or BOOTP packet, or a UDP protocol specified by the ip forward-protocol udp global configuration command.

The time-to-live (TTL) value of the packet must be at least two.

A flooded UDP datagram is given the destination address you specified with the ip broadcast-address command in the interface configuration mode on the output interface. The destination address can be set to any desired address. Thus, the destination address may change as the datagram propagates through the network. The source address is never changed. The TTL value is decremented.

After a decision has been made to send the datagram out on an interface (and the destination address possibly changed), the datagram is handed to the normal IP output routines and is, therefore, subject to access lists, if they are present on the output interface.

To use the bridging spanning-tree database to flood UDP datagrams, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip forward-protocol spanning-tree

Uses the bridging spanning-tree database to flood UDP datagrams.


If no actual bridging is desired, you can configure a type-code bridging filter that will deny all packet types from being bridged. Refer to the "Configuring Transparent Bridging" chapter of the Cisco IOS Bridging and IBM Networking Configuration Guide for more information about using access lists to filter bridged traffic. The spanning-tree database is still available to the IP forwarding code to use for the flooding.

Speeding Up Flooding of UDP Datagrams

You can speed up flooding of UDP datagrams using the spanning-tree algorithm. Used in conjunction with the ip forward-protocol spanning-tree command in global configuration mode, this feature boosts the performance of spanning tree-based UDP flooding by a factor of about four to five times. The feature, called turbo flooding, is supported over Ethernet interfaces configured for Advanced Research Projects Agency (ARPA) encapsulated, FDDI, and HDLC-encapsulated serial interfaces. However, it is not supported on Token Ring interfaces. As long as the Token Rings and the non-HDLC serial interfaces are not part of the bridge group being used for UDP flooding, turbo flooding will behave normally.

To enable turbo flooding, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip forward-protocol turbo-flood

Uses the bridging spanning-tree database to speed up flooding of UDP datagrams.


Configuring Network Address Translation

Two key problems facing the Internet are depletion of IP address space and scaling in routing. Network Address Translation (NAT) is a feature that allows the IP network of an organization to appear from the outside to use different IP address space than what it is actually using. Thus, NAT allows an organization with nonglobally routable addresses to connect to the Internet by translating those addresses into globally routable address space. NAT also allows a more graceful renumbering strategy for organizations that are changing service providers or voluntarily renumbering into classless interdomain routing (CIDR) blocks. NAT is also described in RFC 1631.

Beginning with Cisco IOS Release 12.1(5)T, NAT supports all H.225 and H.245 message types, including FastConnect and Alerting as part of the H.323 version 2 specification. Any product that makes use of these message types will be able to pass through a Cisco IOS NAT configuration without any static configuration. Full support for NetMeeting Directory (Internet Locator Service) is also provided through Cisco IOS NAT.

NAT Applications

NAT has several applications. Use it for the following purposes:

You want to connect to the Internet, but not all your hosts have globally unique IP addresses. NAT enables private IP internetworks that use nonregistered IP addresses to connect to the Internet. NAT is configured on the router at the border of a stub domain (referred to as the inside network) and a public network such as the Internet (referred to as the outside network). NAT translates the internal local addresses to globally unique IP addresses before sending packets to the outside network.

You must change your internal addresses. Instead of changing them, which can be a considerable amount of work, you can translate them by using NAT.

You want to do basic load sharing of TCP traffic. You can map a single global IP address to many local IP addresses by using the TCP load distribution feature.

As a solution to the connectivity problem, NAT is practical only when relatively few hosts in a stub domain communicate outside of the domain at the same time. When this is the case, only a small subset of the IP addresses in the domain must be translated into globally unique IP addresses when outside communication is necessary, and these addresses can be reused when no longer in use.

Benefits

A significant advantage of NAT is that it can be configured without requiring changes to hosts or routers other than those few routers on which NAT will be configured. As discussed previously, NAT may not be practical if large numbers of hosts in the stub domain communicate outside of the domain. Furthermore, some applications use embedded IP addresses in such a way that it is impractical for a NAT device to translate. These applications may not work transparently or at all through a NAT device. NAT also hides the identity of hosts, which may be an advantage or a disadvantage.

A router configured with NAT will have at least one interface to the inside and one to the outside. In a typical environment, NAT is configured at the exit router between a stub domain and backbone. When a packet is leaving the domain, NAT translates the locally significant source address into a globally unique address. When a packet is entering the domain, NAT translates the globally unique destination address into a local address. If more than one exit point exists, each NAT must have the same translation table. If the software cannot allocate an address because it has run out of addresses, it drops the packet and sends an ICMP host unreachable packet.

A router configured with NAT must not advertise the local networks to the outside. However, routing information that NAT receives from the outside can be advertised in the stub domain as usual.

NAT Terminology

As mentioned previously, the term inside refers to those networks that are owned by an organization and that must be translated. Inside this domain, hosts will have addresses in the one address space, while on the outside, they will appear to have addresses in another address space when NAT is configured. The first address space is referred to as the local address space and the second is referred to as the global address space.

Similarly, outside refers to those networks to which the stub network connects, and which are generally not under the control of the organization. Hosts in outside networks can be subject to translation also, and can thus have local and global addresses.

To summarize, NAT uses the following definitions:

Inside local address—The IP address that is assigned to a host on the inside network. The address is probably not a legitimate IP address assigned by the Network Information Center (NIC) or service provider.

Inside global address—A legitimate IP address (assigned by the NIC or service provider) that represents one or more inside local IP addresses to the outside world.

Outside local address—The IP address of an outside host as it appears to the inside network. Not necessarily a legitimate address, it was allocated from address space routable on the inside.

Outside global address—The IP address assigned to a host on the outside network by the owner of the host. The address was allocated from globally routable address or network space.

NAT Configuration Task List

Before configuring any NAT translation, you must know your inside local addresses and inside global addresses. To configure NAT, perform the optional tasks described in the following sections:

Translating Inside Source Addresses (Optional)

Overloading an Inside Global Address Optional)

Translating Overlapping Addresses (Optional)

Providing TCP Load Distribution (Optional)

Changing Translation Timeouts (Optional)

Monitoring and Maintaining NAT(Optional)

Deploying NAT Between an IP Phone and Cisco CallManager (Optional)

Translating Inside Source Addresses

You can translate your own IP addresses into globally unique IP addresses when communicating outside of your network. You can configure static or dynamic inside source translation as follows:

Static translation establishes a one-to-one mapping between your inside local address and an inside global address. Static translation is useful when a host on the inside must be accessible by a fixed address from the outside.

Dynamic translation establishes a mapping between an inside local address and a pool of global addresses. An access-list or a route-map can be specified for dynamic translations. Route maps allow you to match any combination of access-list, new-hop IP address, and output interface to determine which pool to use.

Figure 4 illustrates a router that is translating a source address inside a network to a source address outside the network.

Figure 4 NAT Inside Source Translation

The following process describes inside source address translation, as shown in Figure 4:

1. The user at host 1.1.1.1 opens a connection to host B.

2. The first packet that the router receives from host 1.1.1.1 causes the router to check its NAT table:

If a static translation entry was configured, the router goes to Step 3.

If no translation entry exists, the router determines that Source-Address (SA) 1.1.1.1 must be translated dynamically, selects a legal, global address from the dynamic address pool, and creates a translation entry. This type of entry is called a simple entry.

3. The router replaces the inside local source address of host 1.1.1.1 with the global address of the translation entry and forwards the packet.

4. Host B receives the packet and responds to host 1.1.1.1 by using the inside global IP Destination- Address (DA) 2.2.2.2.

5. When the router receives the packet with the inside global IP address, it performs a NAT table lookup by using the inside global address as a key. It then translates the address to the inside local address of host 1.1.1.1 and forwards the packet to host 1.1.1.1.

Host 1.1.1.1 receives the packet and continues the conversation. The router performs Steps 2 through 5 for each packet.

Configuring Static Translation

To configure static inside source address translation, use the following commands in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip nat inside source static local-ip global-ip

Establishes static translation between an inside local address and an inside global address.

Step 2 

Router(config)# interface type number

Specifies the inside interface and enters interface configuration mode.

Step 3 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 4 

Router(config)# interface type number

Specifies the outside interface and enters interface configuration mode.

Step 5 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.

The previous steps are the minimum you must configure. You could also configure multiple inside and outside interfaces.

Configuring Dynamic Translation with an Access List

To configure dynamic inside source address translation with an access list, use the following commands in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}

Defines a pool of global addresses to be allocated as needed.

Step 2 

Router(config)# access-list access-list-number permit source [source-wildcard]

Defines a standard access list permitting those addresses that are to be translated.

Step 3 

Router(config)# ip nat inside source list access-list-number pool name

Establishes dynamic source translation, specifying the access list defined in the prior step.

Step 4 

Router(config)# interface type number

Specifies the inside interface and enters interface configuration mode.

Step 5 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 6 

Router(config)# interface type number

Specifies the outside interface and enters interface configuration mode.

Step 7 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.


Note The access list must permit only those addresses that are to be translated. (Remember that there is an implicit "deny all" at the end of each access list.) An access list that is too permissive can lead to unpredictable results.
Packets that enter the router through the inside interface and packets sourced from the router are checked against the access list for possible NAT candidates. The access list is used to specify which traffic is to be translated.


Configuring Dynamic Translation with a Route Map

To configure dynamic inside source address translation with a route map, use the following commands in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}

Defines a pool of global addresses to be allocated as needed.

Step 2 

Router(config)# route-map name permit sequence

Defines a route map permitting those addresses that are to be translated.

Step 3 

Router(config)# ip nat inside source route-map name pool name

Establishes dynamic source translation, specifying the route map defined in the prior step.

Step 4 

Router(config)# interface type number

Specifies the inside interface and enters interface configuration mode.

Step 5 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 6 

Router(config)# interface type number

Specifies the outside interface and enters interface configuration mode.

Step 7 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.

See the "Dynamic Inside Source Translation Example" section at the end of this chapter for examples of dynamic inside source translation.

Overloading an Inside Global Address

You can conserve addresses in the inside global address pool by allowing the router to use one global address for many local addresses. When this overloading is configured, the router maintains enough information from higher-level protocols (for example, TCP or UDP port numbers) to translate the global address back to the correct local address. When multiple local addresses map to one global address, the TCP or UDP port numbers of each inside host distinguish between the local addresses.

Figure 5 illustrates NAT operation when one inside global address represents multiple inside local addresses. The TCP port numbers act as differentiators.

Figure 5 NAT Overloading Inside Global Addresses

The router performs the following process in overloading inside global addresses, as shown in Figure 5. Both host B and host C believe they are communicating with a single host at address 2.2.2.2. They are actually communicating with different hosts; the port number is the differentiator. In fact, many inside hosts could share the inside global IP address by using many port numbers.

1. The user at host 1.1.1.1 opens a connection to host B.

2. The first packet that the router receives from host 1.1.1.1 causes the router to check its NAT table:

If no translation entry exists, the router determines that address 1.1.1.1 must be translated, and sets up a translation of inside local address 1.1.1.1 to a legal global address.

If overloading is enabled, and another translation is active, the router reuses the global address from that translation and saves enough information to be able to translate back. This type of entry is called an extended entry.

3. The router replaces the inside local source address 1.1.1.1 with the selected global address and forwards the packet.

4. Host B receives the packet and responds to host 1.1.1.1 by using the inside global IP address 2.2.2.2.

5. When the router receives the packet with the inside global IP address, it performs a NAT table lookup, using the protocol, inside global address and port, and outside address and port as a key; translates the address to inside local address 1.1.1.1; and forwards the packet to host 1.1.1.1.

Host 1.1.1.1 receives the packet and continues the conversation. The router performs Steps 2 through 5 for each packet.

To configure overloading of inside global addresses, use the following commands in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}

Defines a pool of global addresses to be allocated as needed.

Step 2 

Router(config)# access-list access-list-number permit source [source-wildcard]

Defines a standard access list.

Step 3 

Router(config)# ip nat inside source list access-list-number pool name overload

Establishes dynamic source translation, specifying the access list defined in the prior step.

Step 4 

Router(config)# interface type number

Specifies the inside interface.

Step 5 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 6 

Router(config)# interface type number

Specifies the outside interface.

Step 7 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.


Note The access list must permit only those addresses that are to be translated. (Remember that there is an implicit "deny all" at the end of each access list.) An access list that is too permissive can lead to unpredictable results.
Packets that enter the router through the inside interface and packets sourced from the router are checked against the access list for possible NAT candidates. The access list is used to specify which traffic is to be translated.


See the "Overloading Inside Global Addresses Example" section at the end of this chapter for an example of overloading inside global addresses.

Translating Overlapping Addresses

The NAT overview discusses translating IP addresses, which could occur because your IP addresses are not legal, officially assigned IP addresses. Perhaps you chose IP addresses that officially belong to another network. The case of an address used both illegally and legally is called overlapping. You can use NAT to translate inside addresses that overlap with outside addresses. Use this feature if your IP addresses in the stub network are legitimate IP addresses belonging to another network, and you want to communicate with those hosts or routers.

Figure 6 shows how NAT translates overlapping networks.

Figure 6 NAT Translating Overlapping Addresses

The router performs the following process when translating overlapping addresses:

1. The user at host 1.1.1.1 opens a connection to host C by name, requesting a name-to-address lookup from a DNS server.

2. The router intercepts the DNS reply and translates the returned address if there is an overlap (that is, the resulting legal address resides illegally in the inside network). To translate the return address, the router creates a simple translation entry mapping the overlapping address 1.1.1.3 to an address from a separately configured, outside local address pool.

The router examines every DNS reply from everywhere, ensuring that the IP address is not in the stub network. If it is, the router translates the address.

3. Host 1.1.1.1 opens a connection to 3.3.3.3.

4. The router sets up translations mapping inside local and global addresses to each other, and outside global and local addresses to each other.

5. The router replaces the SA with the inside global address and replaces the DA with the outside global address.

6. Host C receives the packet and continues the conversation.

7. The router does a lookup, replaces the DA with the inside local address, and replaces the SA with the outside local address.

8. Host 1.1.1.1 receives the packet and the conversation continues, using this translation process.

Configuring Static Translation

To configure static SA address translation, use the following commands in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip nat outside source static global-ip local-ip

Establishes static translation between an outside local address and an outside global address.

Step 2 

Router(config)# interface type number

Specifies the inside interface.

Step 3 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 4 

Router(config)# interface type number

Specifies the outside interface.

Step 5 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.

Configuring Dynamic Translation

To configure dynamic outside source address translation, use the following commands in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}

Defines a pool of local addresses to be allocated as needed.

Step 2 

Router(config)# access-list access-list-number permit source [source-wildcard]

Defines a standard access list.

Step 3 

Router(config)# ip nat outside source list access-list-number pool name

Establishes dynamic outside source translation, specifying the access list defined in the prior step.

Step 4 

Router(config)# interface type number

Specifies the inside interface.

Step 5 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 6 

Router(config)# interface type number

Specifies the outside interface.

Step 7 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.


Note The access list must permit only those addresses that are to be translated. (Remember that there is an implicit "deny all" at the end of each access list.) An access list that is too permissive can lead to unpredictable results.


See the "Translating Overlapping Address Example" section at the end of this chapter for an example of translating an overlapping address.

Providing TCP Load Distribution

Another use of NAT is unrelated to Internet addresses. Your organization may have multiple hosts that must communicate with a heavily used host. Using NAT, you can establish a virtual host on the inside network that coordinates load sharing among real hosts. DAs that match an access list are replaced with addresses from a rotary pool. Allocation is done on a round-robin basis, and only when a new connection is opened from the outside to the inside. Non-TCP traffic is passed untranslated (unless other translations are in effect). Figure 7 illustrates this feature.

Figure 7 NAT TCP Load Distribution

The router performs the following process when translating rotary addresses:

1. The user on host B (9.6.7.3) opens a connection to the virtual host at 1.1.1.127.

2. The router receives the connection request and creates a new translation, allocating the next real host (1.1.1.1) for the inside local IP address.

3. The router replaces the destination address with the selected real host address and forwards the packet.

4. Host 1.1.1.1 receives the packet and responds.

5. The router receives the packet, performs a NAT table lookup using the inside local address and port number, and the outside address and port number as the key. The router then translates the source address to the address of the virtual host and forwards the packet.

The next connection request will cause the router to allocate 1.1.1.2 for the inside local address.

To configure destination address rotary translation, use the following commands beginning in global configuration mode. These commands allow you to map one virtual host to many real hosts. Each new TCP session opened with the virtual host will be translated into a session with a different real host.

 
Command
Purpose

Step 1 

Router(config)# ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} type rotary

Defines a pool of addresses containing the addresses of the real hosts.

Step 2 

Router(config)# access-list access-list-number permit source [source-wildcard]

Defines an access list permitting the address of the virtual host.

Step 3 

Router(config)# ip nat inside destination list access-list-number pool name

Establishes dynamic inside destination translation, specifying the access list defined in the prior step.

Step 4 

Router(config)# interface type number

Specifies the inside interface.

Step 5 

Router(config-if)# ip nat inside

Marks the interface as connected to the inside.

Step 6 

Router(config)# interface type number

Specifies the outside interface.

Step 7 

Router(config-if)# ip nat outside

Marks the interface as connected to the outside.


Note The access list must permit only those addresses that are to be translated. (Remember that there is an implicit "deny all" at the end of each access list.) An access list that is too permissive can lead to unpredictable results.


See the "ping Command Example" section at the end of this chapter for an example of rotary translation.

Changing Translation Timeouts

By default, dynamic address translations time out after some period of nonuse. You can change the default values on timeouts, if necessary. When overloading is not configured, simple translation entries time out after 24 hours. To change this value, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip nat translation timeout seconds

Changes the timeout value for dynamic address translations that do not use overloading.


If you have configured overloading, you have more control over translation entry timeout, because each entry contains more context about the traffic using it. To change timeouts on extended entries, use the following commands in global configuration mode as needed:

Command
Purpose

Router(config)# ip nat translation udp-timeout seconds

Changes the UDP timeout value from 5 minutes.

Router(config)# ip nat translation dns-timeout seconds

Changes the DNS timeout value from 1 minute.

Router(config)# ip nat translation tcp-timeout seconds

Changes the TCP timeout value from 24 hours.

Router(config)# ip nat translation finrst-timeout seconds

Changes the Finish and Reset timeout value from 1 minute.

Router(config)# ip nat translation icmp-timeout seconds

Changes the ICMP timeout value from 1 minute.

Router(config)# ip nat translation syn-timeout seconds

Changes the Synchronous (SYN) timeout value from 1 minute.


Monitoring and Maintaining NAT

By default, dynamic address translations will time out from the NAT translation table at some point. To clear the entries before the timeout, use the following commands in EXEC mode as needed:

Command
Purpose

Router# clear ip nat translation *

Clears all dynamic address translation entries from the NAT translation table.

Router# clear ip nat translation inside global-ip local-ip [outside local-ip global-ip]

Clears a simple dynamic translation entry containing an inside translation, or both inside and outside translation.

Router# clear ip nat translation outside local-ip global-ip

Clears a simple dynamic translation entry containing an outside translation.

Router# clear ip nat translation protocol inside global-ip global-port local-ip local-port [outside local-ip local-port global-ip global-port]

Clears an extended dynamic translation entry.


To display translation information, use either of the following commands in EXEC mode:

Command
Purpose

Router# show ip nat translations [verbose]

Displays active translations.

Router# show ip nat statistics

Displays translation statistics.


Deploying NAT Between an IP Phone and Cisco CallManager

Cisco IP phones use the Selsius Skinny Station Protocol to connect with and register to the Cisco CallManager (CCM). Messages flow back and forth that include IP address and port information used to identify other IP phone users with which a call can be placed.

To be able to deploy Cisco IOS NAT between the IP phone and CCM in a scalable environment, NAT needs to be able to detect the Selsius Skinny Station Protocol and understand the information passed within the messages.

When an IP phone attempts to connect to the CCM and it matches the configured NAT translation rules, NAT will translate the original source IP address and replace it with one from the configured pool. This new address will be reflected in the CCM and be visible to other IP phone users.

To specify a port other than the default port, use the following command in global configuration mode:

Command
Purpose

Router(config)# ip nat service skinny tcp port number

Displays port number on which the CCM is listening for skinny messages.


Monitoring and Maintaining IP Addressing

To monitor and maintain your network, perform the tasks described in the following sections. The tasks in the first section are required; the tasks in the remaining sections are optional.

Clearing Caches, Tables, and Databases (Required)

Specifying the Format of Network Masks (Optional)

Displaying System and Network Statistics (Optional)

Monitoring and Maintaining NHRP (Optional)

Clearing Caches, Tables, and Databases

You can remove all contents of a particular cache, table, or database. Clearing a cache, table, or database can become necessary when the contents of the particular structure have become or are suspected to be invalid.

To clear caches, tables, and databases, use the following commands in EXEC mode, as needed:

Command
Purpose

Router# clear arp-cache

Clears the IP ARP cache and the fast-switching cache.

Router# clear host {name | *}

Removes one or all entries from the host name and address cache.

Router# clear ip route {network [mask] | *}

Removes one or more routes from the IP routing table.


Specifying the Format of Network Masks

IP uses a 32-bit mask, called a netmask, that indicates which address bits belong to the network and subnetwork fields, and which bits belong to the host field. This is called a netmask. By default, show commands display an IP address and then its netmask in dotted decimal notation. For example, a subnet would be displayed as 131.108.11.55 255.255.255.0.

You might find it more convenient to display the network mask in hexadecimal format or bit count format instead. The hexadecimal format is commonly used on UNIX systems. The previous example would be displayed as 131.108.11.55 0XFFFFFF00.

The bit count format for displaying network masks is to append a slash (/) and the total number of bits in the netmask to the address itself. The previous example would be displayed as 131.108.11.55/24.

To specify the format in which netmasks appear for the current session, use the following command in EXEC mode:

Command
Purpose

Router# term ip netmask-format {bitcount | decimal | hexadecimal}

Specifies the format of network masks for the current session.


To configure the format in which netmasks appear for an individual line, use the following command in line configuration mode:

Command
Purpose

Router(config-line)# ip netmask-format {bitcount | decimal | hexadecimal}

Configures the format of network masks for a line.


Displaying System and Network Statistics

You can display specific statistics such as the contents of IP routing tables, caches, and databases. The resulting information can be used to determine resource utilization and to solve network problems. You also can display information about node reachability and discover the routing path that the packets of your device are taking through the network.

These tasks are summarized in the table that follows. See the "IP Addressing Commands" chapter in the Cisco IOS IP Command Reference, Volume 1 of 3: Addressing and Services publication for details about the commands listed in these tasks. Use the following commands in privileged EXEC mode to display specific statistics, as needed:

Command
Purpose

Router# show arp

Displays the entries in the ARP table.

Router# show hosts

Displays the default domain name, style of lookup service, the name server hosts, and the cached list of host names and addresses.

Router# show ip aliases

Displays IP addresses mapped to TCP ports (aliases).

Router# show ip arp

Displays the IP ARP cache.

Router# show ip interface [type number]

Displays the usability status of interfaces.

Router# show ip irdp

Displays IRDP values.

Router# show ip masks address

Displays the masks used for network addresses and the number of subnets using each mask.

Router# show ip redirects

Displays the address of a default gateway.

Router# show ip route [address [mask] [longer-prefixes]] | [protocol [process-id]]

Displays the current state of the routing table.

Router# show ip route summary

Displays the current state of the routing table in summary form.

Router# ping [protocol] {host | address}

Tests network node reachability (privileged mode).

Router# ping [protocol] {host | address}

Tests network node reachability using a simple ping facility (user mode).

Router# trace [destination]

Traces packet routes through the network (privileged mode).

Router# trace ip destination

Traces packet routes through the network (user mode).


See the "ping Command Example" section at the end of this chapter for an example of pinging.

Monitoring and Maintaining NHRP

To monitor the NHRP cache or traffic, use either of the following commands in EXEC mode:

Command
Purpose

Router# show ip nhrp [dynamic | static] [type number]

Displays the IP NHRP cache, optionally limited to dynamic or static cache entries for a specific interface.

Router# show ip nhrp traffic

Displays NHRP traffic statistics.


The NHRP cache can contain static entries caused by statically configured addresses and dynamic entries caused by the Cisco IOS software learning addresses from NHRP packets. To clear static entries, use the no ip nhrp map command in interface configuration mode. To clear the NHRP cache of dynamic entries, use the following command in EXEC mode:

Command
Purpose

Router# clear ip nhrp

Clears the IP NHRP cache of dynamic entries.


In a dual hub Dynamic Multipoint VPN (DMVPN) environment, when using the clear ip nhrp command on the hub, you may see the following error message on the spokes:

%NHRP-3-PAKERROR: Receive Error Indication for our Error Indication, code: protocol 
generic error(7), offset: 0, data: 00 01 08 00 00 00 00 00 00 FF 00 44 5F F6 00 34 

This is only an informational message generated as a part of the NHRP purge notification processing and will not cause any other issues.

IP Addressing Examples

The following sections provide IP configuration examples:

Creating a Network from Separated Subnets Example

Serial Interfaces Configuration Example

IP Domains Example

Dynamic Lookup Example

HP Hosts on a Network Segment Example

Logical NBMA Example

NHRP over ATM Example

Changing the Rate for Triggering SVCs Example

Applying NHRP Rates to Specific Destinations Example

NHRP on a Multipoint Tunnel Example

Broadcasting Examples

NAT Configuration Examples

ping Command Example

Creating a Network from Separated Subnets Example

In the following example, subnets 1 and 2 of network 131.108.0.0 are separated by a backbone, as shown in Figure 8. The two networks are brought into the same logical network through the use of secondary addresses.

Figure 8 Creating a Network from Separated Subnets

The following examples show the configurations for routers B and C:

Router B Configuration

interface ethernet 2
 ip address 192.5.10.1 255.255.255.0
 ip address 131.108.3.1 255.255.255.0 secondary

Router C Configuration

interface ethernet 1
 ip address 192.5.10.2 255.255.255.0
 ip address 131.108.3.2 255.255.255.0 secondary

Serial Interfaces Configuration Example

In the following example, the second serial interface (serial 1) is given the address of Ethernet interface 0. The serial interface is unnumbered.

interface ethernet 0
 ip address 145.22.4.67 255.255.255.0
interface serial 1
 ip unnumbered ethernet 0

IP Domains Example

The following example establishes a domain list with several alternate domain names:

ip domain list csi.com
ip domain list telecomprog.edu
ip domain-list merit.edu

Dynamic Lookup Example

A cache of host name-to-address mappings is used by connect, telnet, ping, trace, write net, and configure net EXEC commands to speed the process of converting names to addresses. The commands used in this example specify the form of dynamic name lookup to be used. Static name lookup also can be configured.

The following example configures the host name-to-address mapping process. IP DNS-based translation is specified, the addresses of the name servers are specified, and the default domain name is given.

! IP Domain Name System (DNS)-based host name-to-address translation is enabled
ip domain lookup
! Specifies host 131.108.1.111 as the primary name server and host 131.108.1.2 
! as the secondary server
ip name-server 131.108.1.111 131.108.1.2
! Defines cisco.com as the default domain name the router uses to complete 
! unqualified host names
ip domain name cisco.com

HP Hosts on a Network Segment Example

The following example has a network segment with HP devices on it. The commands in this example customize the first Ethernet port to respond to Probe name requests for the host name, and to use Probe and ARP.

ip hp-host bl4zip 131.24.6.27
interface ethernet 0
arp probe
ip probe proxy

Logical NBMA Example

A logical NBMA network is considered the group of interfaces and hosts participating in NHRP and having the same network identifier. Figure 9 illustrates two logical NBMA networks (shown as circles) configured over a single physical NBMA network. Router A can communicate with routers B and C because they share the same network identifier (2). Router C can also communicate with routers D and E because they share network identifier 7. After address resolution is complete, router A can send IP packets to router C in one hop, and router C can send them to router E in one hop, as shown by the dotted lines.

Figure 9 Two Logical NBMA Networks over One Physical NBMA Network

The physical configuration of the five routers in Figure 9 might actually be that shown in Figure 10. The source host is connected to Router A and the destination host is connected to Router E. The same switch serves all five routers, making one physical NBMA network.

Figure 10 Physical Configuration of a Sample NBMA Network

Refer again to Figure 9. Initially, before NHRP has resolved any NBMA addresses, IP packets from the source host to the destination host travel through all five routers connected to the switch before reaching the destination. When Router A first forwards the IP packet toward the destination host, Router A also generates an NHRP request for the IP address of the destination host. The request is forwarded to Router C, whereupon a reply is generated. Router C replies because it is the egress router between the two logical NBMA networks.

Similarly, Router C generates an NHRP request of its own, to which Router E replies. In this example, subsequent IP traffic between the source and the destination still requires two hops to traverse the NBMA network, because the IP traffic must be forwarded between the two logical NBMA networks. Only one hop would be required if the NBMA network were not logically divided.

NHRP over ATM Example

The following example shows a configuration of three routers using NHRP over ATM. Subinterfaces and dynamic routing also are used. Router A obtains an OSPF route that it can use to reach the LIS where Router B resides. Router A can then initially reach Router B through Router C. Router A and Router B are able to directly communicate without Router C once NHRP has resolved the respective NSAP addresses of Router A and Router C.

The significant portions of the configurations for routers A, B, and C follow:

Router A Configuration

interface ATM0/0
 ip address 10.1.0.1 255.255.0.0
 ip nhrp network-id 1
 map-group a
 atm nsap-address 11.1111.11.111111.1111.1111.1111.1111.1111.1111.11
 atm rate-queue 1 10
 atm pvc 1 0 5 qsaal

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0

map-list a
 ip 10.1.0.3 atm-nsap 33.3333.33.333333.3333.3333.3333.3333.3333.3333.33

Router B Configuration

interface ATM0/0
 ip address 10.2.0.2 255.255.0.0
 ip nhrp network-id 1
 map-group a
 atm nsap-address 22.2222.22.222222.2222.2222.2222.2222.2222.2222.22
 atm rate-queue 1 10
 atm pvc 2 0 5 qsaal

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0

map-list a
 ip 10.2.0.3 atm-nsap 33.3333.33.333333.3333.3333.3333.3333.3333.3333.33

Router C Configuration

interface ATM0/0
 no ip address
 atm rate-queue 1 10
 atm pvc 2 0 5 qsaal

interface ATM0/0.1 multipoint
 ip address 10.1.0.3 255.255.0.0
 ip nhrp network-id 1
 map-group a
 atm nsap-address 33.3333.33.333333.3333.3333.3333.3333.3333.3333.33
 atm rate-queue 1 10

interface ATM0/0.2 multipoint
 ip address 10.2.0.3 255.255.0.0
 ip nhrp network-id 1
 map-group b
 atm nsap-address 33.3333.33.333333.3333.3333.3333.3333.3333.3333.33
 atm rate-queue 1 10

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0
 neighbor 10.1.0.1 priority 1
 neighbor 10.2.0.2 priority 1

map-list a
 ip 10.1.0.1 atm-nsap 11.1111.11.111111.1111.1111.1111.1111.1111.1111.11

map-list b
ip 10.2.0.2 atm-nsap 22.2222.22.222222.2222.2222.2222.2222.2222.2222.22

Changing the Rate for Triggering SVCs Example

Figure 11 and the example configuration following it show how to configure a threshold of 100 kbps for triggering SVCs and 50 kbps for tearing down SVCs.

Figure 11 Using NHRP and Triggering SVCs

Router A Configuration

ip cef 
ip cef accounting non-recursive 
!
interface Loopback0
 ip address 140.206.58.130 255.255.255.255
 no ip directed-broadcast
 no ip mroute-cache
!
interface ATM0/1/0
 no ip address
 no ip directed-broadcast
 no ip mroute-cache
 atm pvc 5 0 5 qsaal
 atm pvc 16 0 16 ilmi
!
interface ATM0/1/0.1 multipoint
 ip address 140.206.58.55 255.255.255.192
 no ip directed-broadcast
 ip nhrp network-id 1
 ip ospf network point-to-multipoint
 atm pvc 102 0 40 aal5snap inarp 5
 atm esi-address 525354555355.01
!
interface Fddi1/0/0
 ip address 10.2.1.55 255.255.255.0
 no ip directed-broadcast
 no ip mroute-cache
 no keepalive
!
router ospf 1
 passive-interface Fddi1/0/0
 network 10.2.1.0 0.0.0.255 area 1
 network 140.206.58.0 0.0.0.255 area 1
!
router bgp 7170
 no synchronization
 network 140.206.0.0
 neighbor 10.2.1.36 remote-as 102
 neighbor 140.206.59.130 remote-as 7170
 neighbor 140.206.59.130 update-source Loopback0
 neighbor 140.206.59.130 next-hop-self

Router B Configuration

ip cef
ip cef accounting non-recursive 
!
interface Loopback0
 ip address 140.206.59.130 255.255.255.255
 no ip directed-broadcast
 no ip mroute-cache
!
interface ATM0/0
 no ip address
 no ip directed-broadcast
 no ip mroute-cache
 atm pvc 5 0 5 qsaal
 atm pvc 16 0 16 ilmi
!
interface ATM0/0.1 multipoint
 ip address 140.206.58.54 255.255.255.192
 no ip directed-broadcast
 ip nhrp network-id 1
 ip nhrp server-only non-caching
 ip route-cache same-interface
 ip ospf network point-to-multipoint
 atm pvc 102 0 40 aal5snap inarp 5
 atm pvc 111 0 85 aal5snap inarp 5
 atm esi-address 525354555354.01
!
router ospf 1
 network 140.206.58.0 0.0.0.255 area 1
 network 140.206.59.0 0.0.0.255 area 0
 area 0 range 140.206.59.0 255.255.255.0
!
router bgp 7170
 no synchronization
 bgp cluster-id 1
 network 140.206.0.0
 aggregate-address 140.206.0.0 255.255.0.0 summary-only
 neighbor 140.206.58.130 remote-as 7170
 neighbor 140.206.58.130 route-reflector-client
 neighbor 140.206.58.130 update-source Loopback0
 neighbor 140.206.58.131 remote-as 7170
 neighbor 140.206.58.131 route-reflector-client
 neighbor 140.206.58.131 update-source Loopback0

Router C Configuration

ip cef
ip cef accounting non-recursive 
!
interface Loopback0
 ip address 140.206.58.131 255.255.255.255
 no ip directed-broadcast
 no ip mroute-cache
!
interface ATM0/0
 no ip address
 no ip directed-broadcast
 no ip mroute-cache
 atm pvc 5 0 5 qsaal
 atm pvc 16 0 16 ilmi
!
interface ATM0/0.1 multipoint
 ip address 140.206.58.56 255.255.255.192
 no ip directed-broadcast
 ip nhrp network-id 1
 ip nhrp trigger-svc 100 50 
 ip ospf network point-to-multipoint
 atm pvc 111 0 85 aal5snap inarp 5
 atm esi-address 525354555356.01
!
!
interface Fddi4/0/0
 ip address 10.3.1.56 255.255.255.0
 no ip directed-broadcast
 no ip mroute-cache
 no keepalive
!
!
router ospf 1
 passive-interface Fddi4/0/0
 network 10.3.1.0 0.0.0.255 area 1
 network 140.206.58.0 0.0.0.255 area 1
!
router bgp 7170
 no synchronization
 network 140.206.0.0
 neighbor 10.3.1.45 remote-as 103
 neighbor 140.206.59.130 remote-as 7170
 neighbor 140.206.59.130 update-source Loopback0
 neighbor 140.206.59.130 next-hop-self

Applying NHRP Rates to Specific Destinations Example

In the following example, only the packets that pass extended access list 101 are subject to the default SVC triggering and teardown rates:

interface atm0/0/0.1 multipoint
 ip nhrp interest 101
!
access-list 101 permit ip any any
access-list 101 deny ip any 10.3.0.0 0.0.255.255

NHRP on a Multipoint Tunnel Example

With multipoint tunnels, a single tunnel interface may be connected to multiple neighboring routers. Unlike point-to-point tunnels, a tunnel destination need not be configured. In fact, if configured, the tunnel destination must correspond to an IP multicast address. Broadcast or multicast packets to be sent over the tunnel interface can then be sent by sending the GRE packet to the multicast address configured as the tunnel destination.

Multipoint tunnels require that you configure a tunnel key. Otherwise, unexpected GRE traffic could easily be received by the tunnel interface. For simplicity, we recommend that the tunnel key correspond to the NHRP network identifier.

In the following example, routers A, B, C, and D all share a common Ethernet segment. Minimal connectivity over the multipoint tunnel network is configured, thus creating a network that can be treated as a partially meshed NBMA network. Due to the static NHRP map entries, Router A knows how to reach Router B, Router B knows how to reach Router C, Router C knows how to reach Router D, and Router D knows how to reach Router A.

When Router A initially attempts to send an IP packet to Router D, the packet is forwarded through Routers B and C. Through NHRP, the routers quickly learn the NBMA addresses of each other (in this case, IP addresses assigned to the underlying Ethernet network). The partially meshed tunnel network readily becomes fully meshed, at which point any of the routers can directly communicate over the tunnel network without their IP traffic requiring an intermediate hop.

The significant portions of the configurations for routers A, B, C, and D follow:

Router A Configuration

interface tunnel 0
 no ip redirects
 ip address 11.0.0.1 255.0.0.0
 ip nhrp map 11.0.0.2 10.0.0.2
 ip nhrp network-id 1
 ip nhrp nhs 11.0.0.2
 tunnel source ethernet 0
 tunnel mode gre multipoint
 tunnel key 1

interface ethernet 0
 ip address 10.0.0.1 255.0.0.0

Router B Configuration

interface tunnel 0
 no ip redirects
 ip address 11.0.0.2 255.0.0.0
 ip nhrp map 11.0.0.3 10.0.0.3
 ip nhrp network-id 1
 ip nhrp nhs 11.0.0.3
 tunnel source ethernet 0
 tunnel mode gre multipoint
 tunnel key 1

interface ethernet 0
 ip address 10.0.0.2 255.0.0.0

Router C Configuration

interface tunnel 0
 no ip redirects
 ip address 11.0.0.3 255.0.0.0
 ip nhrp map 11.0.0.4 10.0.0.4
 ip nhrp network-id 1
 ip nhrp nhs 11.0.0.4
 tunnel source ethernet 0
 tunnel mode gre multipoint
 tunnel key 1

interface ethernet 0
 ip address 10.0.0.3 255.0.0.0

Router D Configuration

interface tunnel 0
 no ip redirects
 ip address 11.0.0.4 255.0.0.0
 ip nhrp map 11.0.0.1 10.0.0.1
 ip nhrp network-id 1
 ip nhrp nhs 11.0.0.1
 tunnel source ethernet 0
 tunnel mode gre multipoint
 tunnel key 1

interface ethernet 0
 ip address 10.0.0.4 255.0.0.0

Broadcasting Examples

The Cisco IOS software supports two types of broadcasting: directed broadcasting and flooding. A directed broadcast is a packet sent to a specific network or series of networks, and a flooded broadcast is a packet sent to every network. The following sections describe configurations for both types of broadcasting.

Flooded Broadcast Example

Figure 12 shows a flooded broadcast packet being sent to every network. The packet that is incoming from Ethernet interface 0 is flooded to Ethernet interfaces 1 and 2, and to serial interface 0.

Figure 12 IP Flooded Broadcast

A directed broadcast address includes the network or subnet fields. For example, if the network address is 128.1.0.0, the address 128.1.255.255 indicates all hosts on network 128.1.0.0, which would be a directed broadcast. If network 128.1.0.0 has a subnet mask of 255.255.255.0 (the third octet is the subnet field), the address 128.1.5.255 specifies all hosts on subnet 5 of network 128.1.0.0—another directed broadcast.

Flooding of IP Broadcasts Example

In the following example, flooding of IP broadcasts is enabled on all interfaces (two Ethernet and two serial). No specific UDP protocols are listed by a separate ip forward-protocol udp interface configuration command, so the default protocols (TFTP, DNS, Time, NetBIOS, and BOOTP) will be flooded.

ip forward-protocol spanning-tree
 bridge 1 protocol dec
access-list 201 deny 0x0000 0xFFFF
 interface ethernet 0
 bridge-group 1
 bridge-group 1 input-type-list 201
 bridge-group 1 input-lsap-list 201
interface ethernet 1
 bridge-group 1
 bridge-group 1 input-type-list 201
 bridge-group 1 input-lsap-list 201
interface serial 0
 bridge-group 1
 bridge-group 1 input-type-list 201
 bridge-group 1 input-lsap-list 201
interface serial 1
 bridge-group 1
 bridge-group 1 input-type-list 201
 bridge-group 1 input-lsap-list 201

Helper Addresses Example

In the following example, one router is on network 192.168.1.0 and the other is on network 10.44.0.0, and you want to permit IP broadcasts from hosts on either network segment to reach both servers. Figure 13 illustrates how to configure the router that connects network 10.44.0.0 to network 192.168.1.0.

Figure 13 IP Helper Addresses

The following example shows the configuration:

ip forward-protocol udp
!
interface ethernet 1
 ip helper-address 10.44.23.7
interface ethernet 2
 ip helper-address 192.168.1.19

NAT Configuration Examples

The following sections show NAT configuration examples.

Dynamic Inside Source Translation Example

The following example translates all source addresses passing access list 1 (having a source address from 192.168.1.0/24) to an address from the pool named net-208. The pool contains addresses from 171.69.233.208 to 171.69.233.223.

ip nat pool net-208 171.69.233.208 171.69.233.223 netmask 255.255.255.240
ip nat inside source list 1 pool net-208
!
interface serial 0
 ip address 171.69.232.182 255.255.255.240
 ip nat outside
!
interface ethernet 0
 ip address 192.168.1.94 255.255.255.0
 ip nat inside
!
access-list 1 permit 192.168.1.0 0.0.0.255

The following example translates all source addresses using a route map.

ip nat pool provider1-space 171.69.232.1 171.69.232.254 prefix-length 24
ip nat pool provider2-space 131.108.43.1 131.108.43.254 prefix-length 24
ip nat inside source route-map provider1-map pool provider1-space
ip nat inside source route-map provider2-map pool providere2-space
!
interface Serial0/0
ip nat outside
!
interface Serial0/1
ip nat outside
!
route-map provider1-map permit 10
match ip address 1
match interface Serial0/0
!
route-map provider2-map permit 10
match ip address 1
match interface Serial0/1

Overloading Inside Global Addresses Example

The following example creates a pool of addresses named net-208. The pool contains addresses from 171.69.233.208 to 171.69.233.223. Access list 1 allows packets having the SA from 192.168.1.0 to 192.168.1.255. If no translation exists, packets matching access list 1 are translated to an address from the pool. The router allows multiple local addresses (192.168.1.0 to 192.168.1.255) to use the same global address. The router retains port numbers to differentiate the connections.

ip nat pool net-208 171.69.233.208 171.69.233.223 netmask 255.255.255.240
ip nat inside source list 1 pool net-208 overload
!
interface serial0
 ip address 171.69.232.182 255.255.255.240
 ip nat outside
!
interface ethernet0
 ip address 192.168.1.94 255.255.255.0
 ip nat inside
!
access-list 1 permit 192.168.1.0 0.0.0.255

Translating Overlapping Address Example

In the following example, the addresses in the local network are being used legitimately by someone else on the Internet. An extra translation is required to access that external network. Pool net-10 is a pool of outside local IP addresses. The statement, ip nat outside source list 1 pool net-10, translates the addresses of hosts from the outside overlapping network to addresses in that pool.

ip nat pool net-208 171.69.233.208 171.69.233.223 prefix-length 28
ip nat pool net-10 10.0.1.0 10.0.1.255 prefix-length 24
ip nat inside source list 1 pool net-208
ip nat outside source list 1 pool net-10
!
interface serial 0
 ip address 171.69.232.192 255.255.255.240
 ip nat outside
!
interface ethernet0
 ip address 192.168.1.94 255.255.255.0
 ip nat inside
!
access-list 1 permit 192.168.1.0 0.0.0.255

TCP Load Distribution Example

In the following example, the goal is to define a virtual address, connections to which are distributed among a set of real hosts. The pool defines the addresses of the real hosts. The access list defines the virtual address. If a translation does not already exist, TCP packets from serial interface 0 (the outside interface) whose destination matches the access list are translated to an address from the pool.

ip nat pool real-hosts 192.168.15.2 192.168.15.15 prefix-length 28 type rotary
ip nat inside destination list 2 pool real-hosts
!
interface serial 0
 ip address 192.168.15.129 255.255.255.240
 ip nat outside
!
interface ethernet 0
 ip address 192.168.15.17 255.255.255.240
 ip nat inside
!
access-list 2 permit 192.168.15.1

ping Command Example

You can specify the address to use as the source address for ping packets. In the following example, the address is 131.108.105.62:

Sandbox# ping
Protocol [ip]:
Target IP address: 131.108.1.111
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: yes
Source address: 131.108.105.62
Type of service [0]:
Set DF bit in IP header? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 131.108.1.111, timeout is 2 seconds:
!!!!!
Success rate is 100 percent, round-trip min/avg/max = 4/4/4 ms