![]() |
IP Routing: Protocol-Independent Configuration Guide, Cisco IOS Release 12.4T
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Configuring IP Routing Protocol-Independent Features
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contents
Configuring IP Routing Protocol-Independent FeaturesLast Updated: October 25, 2011
The Configuring IP Routing Protocol-Independent Features module describes how to configure IP routing protocol-independent features. For a complete description of the IP routing protocol-independent commands in this chapter, see the Cisco IOS IP Routing: Protocol-Independent Command Reference. To locate documentation of other commands in this chapter, use the command reference master index or search online.
Finding Feature InformationYour software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document. Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required. Information About Configuring IP Routing Protocol-Independent FeaturesTo configure optional protocol-independent features, perform any of the tasks described in the following sections.
Variable-Length Subnet MasksEnhanced Interior Gateway Routing Protocol (EIGRP), Intermediate System-to-Intermediate System (IS-IS), Open Shortest Path First (OSPF), Routing Information Protocol (RIP) Version 2, and static routes support variable-length subnet masks (VLSMs). With VLSMs, you can use different masks for the same network number on different interfaces, which allows you to conserve IP addresses and more efficiently use available address space. However, using VLSMs also presents address assignment challenges for the network administrator and ongoing administrative challenges. Refer to RFC 1219 for detailed information about VLSMs and how to correctly assign addresses.
Static RoutesStatic routes are user-defined routes that cause packets moving between a source and a destination to take a specified path. Static routes can be important if the router cannot build a route to a particular destination. They are also useful for specifying a gateway of last resort to which all unroutable packets will be sent. To configure a static route, use the ip route prefix mask{ip-address| interface-type interface-number[ip-address]}[distance] [name] [permanent | track number] [tag tag] command in global configuration mode. See the Controlling the Advertising of Routes in Routing Updates for an example of configuring static routes. Static routes remains in the router configuration until you remove them (using the no form of the ip route global configuration command). However, you can override static routes with dynamic routing information through prudent assignment of administrative distance values. Each dynamic routing protocol has a default administrative distance, as listed in the table below. If you would like a static route to be overridden by information from a dynamic routing protocol, simply ensure that the administrative distance of the static route is higher than that of the dynamic protocol.
Static routes that point to an interface will be advertised via RIP, EIGRP, and other dynamic routing protocols, regardless of whether redistribute static router configuration commands were specified for those routing protocols. These static routes are advertised because static routes that point to an interface are considered in the routing table to be connected and hence lose their static nature. However, if you define a static route to an interface that is not one of the networks defined in a network command, no dynamic routing protocols will advertise the route unless a redistribute static command is specified for these protocols. When an interface goes down, all static routes through that interface are removed from the IP routing table. Also, when the software can no longer find a valid next hop for the address specified as the address of the forwarding router in a static route, the static route is removed from the IP routing table. Default RoutesA router might not be able to determine the routes to all other networks. To provide complete routing capability, the common practice is to use some routers as smart routers and give the remaining routers default routes to the smart router. (Smart routers have routing table information for the entire internetwork.) These default routes can be passed along dynamically, or can be configured into the individual routers. Most dynamic interior routing protocols include a mechanism for causing a smart router to generate dynamic default information that is then passed along to other routers. Default NetworkIf a router has a directly connected interface onto the specified default network, the dynamic routing protocols running on that device will generate or source a default route. In the case of RIP, the router will advertise the pseudonetwork 0.0.0.0. In the case of EIGRP, the network itself is advertised and flagged as an external route. A router that is generating the default for a network also may need a default of its own. One way a router can generate its own default is to specify a static route to the network 0.0.0.0 through the appropriate device. To define a static route to a network as the static default route, use the ip default-network network-numbercommand in global configuration mode. Gateway of Last ResortWhen default information is being passed along through a dynamic routing protocol, no further configuration is required. The system periodically scans its routing table to choose the optimal default network as its default route. In the case of RIP, there is only one choice, network 0.0.0.0. In the case of EIGRP, there might be several networks that can be candidates for the system default. Cisco IOS software uses both administrative distance and metric information to determine the default route (gateway of last resort). The selected default route appears in the gateway of last resort display of the show ip route EXEC command. If dynamic default information is not being passed to the software, candidates for the default route are specified with the ip default-network global configuration command. In this usage, the ip default-network command takes an unconnected network as an argument. If this network appears in the routing table from any source (dynamic or static), it is flagged as a candidate default route and is a possible choice as the default route. If the router has no interface on the default network, but does have a route to it, it considers this network as a candidate default path. The route candidates are examined and the best one is chosen, based on administrative distance and metric. The gateway to the best default path becomes the gateway of last resort. Maximum Number of PathsBy default, most IP routing protocols install a maximum of four parallel routes in a routing table. Static routes always install six routes. The exception is BGP, which by default allows only one path (the best path) to a destination. However, BGP can be configured to use equal and unequal cost multipath load sharing. See the "BGP Multipath Load Sharing for Both eBGP and iBGP in an MPLS-VPN" feature of the Cisco IOS IP Routing: BGP Configuration Guide for more information. The number of parallel routes that you can configure to be installed in the routing table is dependent on the installed version of Cisco IOS software. To change the maximum number of parallel paths allowed, use the maximum-paths number-paths command in router configuration mode. Multi-Interface Load SplittingMulti-interface load splitting allows you to efficiently control traffic that travels across multiple interfaces to the same destination. The traffic-share min router configuration command specifies that if multiple paths are available to the same destination, only paths with the minimum metric will be installed in the routing table. The number of paths allowed is never more than six. For dynamic routing protocols, the number of paths is controlled by the maximum-paths router configuration command. The static route source can always install six paths. If more paths are available, the extra paths are discarded. If some installed paths are removed from the routing table, pending routes are added automatically. When the traffic-share min command is used with the across-interfaces keyword, an attempt is made to use as many different interfaces as possible to forward traffic to the same destination. When the maximum path limit has been reached and a new path is installed, the router compares the installed paths. For example, if path X references the same interface as path Y and the new path uses a different interface, path X is removed and the new path is installed. To configure traffic that is distributed among multiple routes of unequal cost for equal cost paths across multiple interfaces, use the traffic-share min across-interfaces command in router configuration mode. Routing Information RedistributionIn addition to running multiple routing protocols simultaneously, Cisco IOS software can be configured to redistribute information from one routing protocol to another. For example, you can configure a router to readvertise EIGRP-derived routes using RIP, or to readvertise static routes using the EIGRP protocol. Redistribution from one routing protocol to another can be configured in all of the IP-based routing protocols. You also can conditionally control the redistribution of routes between routing domains by configuring route maps between the two domains. A route map is a route/ packet filter that is configured with permit and deny statements, match and set clauses, and sequence numbers. The following four tables list tasks associated with route redistribution. Although redistribution is a protocol-independent feature, some of the match and set commands are specific to a particular protocol. To define a route map for redistribution, use the route-map map-tag [permit | deny] [sequence-number] command in global configuration mode. One or more match commands and one or more set commands are configured in route map configuration mode. If there are no match commands, then everything matches. If there are no set commands, then no set action is performed. To define conditions for redistributing routes from one routing protocol into another, see the Configuring Redistribution Routing Information See the "Connecting to a Service Provider Using External BGP" module of the Cisco IOS IP Routing: BGP Configuration Guide for examples of BGP route map configuration tasks and configuration examples. See the "Configuring BGP Cost Community" feature of the Cisco IOS IP Routing: BGP Configuration Guide for examples of BGP communities and route maps. The metrics of one routing protocol do not necessarily translate into the metrics of another. For example, the RIP metric is a hop count and the EIGRP metric is a combination of five metric values. In such situations, a dynamic metric is assigned to the redistributed route. Redistribution in these cases should be applied consistently and carefully in conjunction with inbound filtering to avoid routing loops. Removing options that you have configured for the redistribute command requires careful use of the no form of the redistribute command to ensure that you obtain the result that you are expecting. Supported Metric TranslationsThis section describes supported automatic metric translations between the routing protocols. The following descriptions assume that you have not defined a default redistribution metric that replaces metric conversions:
Default Passive InterfacesIn Internet service provider (ISP) and large enterprise networks, many of the distribution routers have more than 200 interfaces. Before the introduction of the Default Passive Interface feature, there were two possibilities for obtaining routing information from these interfaces:
Network operators may not always be able to summarize type 5 link-state advertisements (LSAs) at the router level where redistribution occurs, as in the first possibility. Thus, a large number of type 5 LSAs can be flooded over the domain. In the second possibility, large type 1 LSAs might be flooded into the area. The Area Border Router (ABR) creates type 3 LSAs, one for each type 1 LSA, and floods them to the backbone. It is possible, however, to have unique summarization at the ABR level, which will inject only one summary route into the backbone, thereby reducing processing overhead. The prior solution to this problem was to configure the routing protocol on all interfaces and manually set the passive-interface router configuration command on the interfaces where adjacency was not desired. But in some networks, this solution meant coding 200 or more passive interface statements. With the Default Passive Interface feature, this problem is solved by allowing all interfaces to be set as passive by default using a single passive-interface default command, then configuring individual interfaces where adjacencies are desired using the no passive-interface command. Thus, the Default Passive Interface feature simplifies the configuration of distribution routers and allows the network manager to obtain routing information from the interfaces in large ISP and enterprise networks. To set all interfaces as passive by default and then activate only those interfaces that must have adjacencies set, see the Configuring Default Passive Interfaces. Sources of Routing Information FilteringFiltering sources of routing information prioritizes routing information from different sources because some pieces of routing information may be more accurate than others. An administrative distance is a rating of the trustworthiness of a routing information source, such as an individual router or a group of routers. In a large network, some routing protocols and some routers can be more reliable than others as sources of routing information. Also, when multiple routing processes are running in the same router for IP, it is possible for the same route to be advertised by more than one routing process. By specifying administrative distance values, you enable the router to intelligently discriminate between sources of routing information. The router will always pick the route whose routing protocol has the lowest administrative distance. To filter sources of routing information, see the Filtering Sources of Routing Information. There are no general guidelines for assigning administrative distances because each network has its own requirements. You must determine a reasonable matrix of administrative distances for the network as a whole. Sources of Routing Information Filtering shows the default administrative distance for various routing information sources. For example, consider a router using EIGRP and RIP. Suppose you trust the EIGRP-derived routing information more than the RIP-derived routing information. In this example, because the default EIGRP administrative distance is lower than the default RIP administrative distance, the router uses the EIGRP-derived information and ignores the RIP-derived information. However, if you lose the source of the EIGRP-derived information (because of a power shutdown at the source network, for example), the router uses the RIP-derived information until the EIGRP-derived information reappears. For an example of filtering on sources of routing information, see the section Example Administrative Distances.
Policy-Based RoutingPolicy-based routing is a more flexible mechanism for routing packets than destination routing. It is a process whereby the router puts packets through a route map before routing them. The route map determines which packets are routed to which router next. You might enable policy-based routing if you want certain packets to be routed some way other than the obvious shortest path. Possible applications for policy-based routing are to provide equal access, protocol-sensitive routing, source-sensitive routing, routing based on interactive versus batch traffic, and routing based on dedicated links. To enable policy-based routing, you must identify which route map to use for policy-based routing and create the route map. The route map itself specifies the match criteria and the resulting action if all of the match clauses are met. These steps are described in the following task tables. To enable policy-based routing on an interface, indicate which route map the router should use by using the following command in interface configuration mode. A packet arriving on the specified interface will be subject to policy-based routing except when its destination IP address is the same as the IP address of the router's interface. To disable fast switching of all packets arriving on this interface use the ip policy route-map map-tagcommand in interface configuration mode. To define the route map to be used for policy-based routing, use the route-map map-tag [permit | deny] [sequence-number] command in global configuration mode. To define the criteria by which packets are examined to learn if they will be policy-based routed, use either match length minimum-length maximum-lengthcommandor match ip address{access-list-number | access-list-name} [access-list-number | access-list-name] command or both in route map configuration mode. No match clause in the route map indicates all packets. To set the precedence and specify where the packets that pass the match criteria are output, see Configuring precedence for policy-based routed packets. The precedence setting in the IP header determines whether, during times of high traffic, the packets will be treated with more or less precedence than other packets. By default, the Cisco IOS software leaves this value untouched; the header remains with the precedence value that it had. The precedence bits in the IP header can be set in the router when policy-based routing is enabled. When the packets containing those headers arrive at another router, the packets are ordered for transmission according to the precedence set, if the queueing feature is enabled. The router does not honor the precedence bits if queueing is not enabled; the packets are sent in FIFO order. You can change the precedence setting, using either a number or name. The names came from RFC 791, but are evolving. You can enable other features that use the values in the set ip precedence route map configuration command to determine precedence. The table below lists the possible numbers and their corresponding name, from least important to most important.
The set commands can be used with each other. They are evaluated in the order shown in the previous task table. A usable next hop implies an interface. Once the local router finds a next hop and a usable interface, it routes the packet. To display the cache entries in the policy route cache, use the show ip cache policy command. For information about setting the precedence and specifying where the packets that pass the match the criteria for policy-based routing are output, see the Configuring precedence for policy-based routed packets. For information about configure QoS Policy Propagation via BGP, see the Configuring QoS Policy Propagation via BGP. See the Example Policy-Based Routing for an example of policy routing. Fast-Switched Policy RoutingIP policy routing can also be fast switched. Prior to fast-switched policy routing, policy routing could only be process switched, which meant that on most platforms, the switching rate was approximately 1000 to 10,000 packets per second. Such rates were not fast enough for many applications. Users that need policy routing to occur at faster speeds can now implement policy routing without slowing down the router. Fast-switched policy routing supports all of the match commands and most of the set commands, except for the following restrictions:
Policy routing must be configured before you configure fast-switched policy routing. Fast switching of policy routing is disabled by default. To have policy routing be fast switched, use the ip route-cache policycommand in interface configuration mode. Local Policy RoutingPackets that are generated by the router are not normally policy-routed. To enable local policy routing for such packets, indicate which route map the router should use by using the following command in global configuration mode. All packets originating on the router will then be subject to local policy routing. To identify the route map to use for local policy routing, use the ip local policy route-map map-tagcommand in global configuration mode. Use the show ip local policy command to display the route map used for local policy routing, if one exists. NetFlow Policy RoutingNetFlow policy routing (NPR) integrates policy routing, which enables traffic engineering and traffic classification, with NetFlow services, which provide billing, capacity planning, and monitoring information on real-time traffic flows. IP policy routing now works with Cisco Express Forwarding (CEF), distributed CEF (dCEF), and NetFlow. As quality of service (QoS) and traffic engineering become more popular, so does interest in the ability of policy routing to selectively set IP Precedence and type of service (ToS) bits (based on access lists and packet size), thereby routing packets based on predefined policy. It is important that policy routing work well in large, dynamic routing environments. Hence, distributed support allows customers to leverage their investment in distributed architecture. NetFlow policy routing leverages the following technologies:
Following are NPR benefits:
Following are NPR restrictions:
In order for NetFlow policy routing to work, the following features must already be configured: To configure CEF, or dCEF, refer to the "Cisco Express Forwarding Overview" chapter of the Cisco IOS IP Switching Configuration Guide. To configure NetFlow, refer to the "Cisco IOS NetFlow Overview" chapter of the Cisco IOS NetFlow Configuration Guide. NPR is the default policy routing mode. No additional configuration tasks are required to enable policy routing in conjunction with CEF, dCEF, or NetFlow. As soon as one of these features is turned on, packets are automatically subject to policy routing in the appropriate switching path. There is one new, optional configuration command (set ip next-hop verify-availability). This command has the following restrictions:
It is assumed that policy routing itself is already configured. If the router is policy routing packets to the next hop and the next hop happens to be down, the router will try unsuccessfully to use Address Resolution Protocol (ARP) for the next hop (which is down). This behavior can continue indefinitely. To prevent this situation from occurring, you can configure the router to first verify that the next hop, using a route map, are CDP neighbors of the router before routing to that next hop. This task is optional because some media or encapsulations do not support CDP, or it may not be a Cisco device that is sending the router traffic. To configure the router to verify that the next hop is a CDP neighbor before the router tries to policy-route to it, use the set ip next-hop verify-availability command in route map configuration mode. If the command shown is set and the next hop is not a CDP neighbor, the router looks to the subsequent next hop, if there is one. If there is none, the packets are simply not policy-routed. If the command shown is not set, the packets are either policy-routed or remain forever unrouted. If you want to selectively verify availability of only some next hops, you can configure different route-map entries (under the same route-map name) with different criteria (using access list matching or packet size matching), and use the set ip next-hop verify-availability configuration command selectively. Typically, you would use existing policy routing and NetFlow show commands to monitor these features. For more information on these show commands, refer to the Cisco IOS IP Routing: Protocol Independent Command Reference for policy routing commands and the appropriate chapter of the Cisco IOS IP NetFlow Command Reference for NetFlow commands. To display the route-map Inter Processor Communication (IPC) message statistics in the Route Processor (RP) or Versatile Interface Processor (VIP), use the show route-map ipc command in EXEC mode. Authentication Keys ManagementKey management is a method of controlling authentication keys used by routing protocols. Not all protocols can use key management. Authentication keys are available for Director Response Protocol (DRP) Agent, EIGRP, and RIP Version 2. Before you manage authentication keys, authentication must be enabled. See the appropriate protocol chapter to learn how to enable authentication for that protocol. To manage authentication keys, see "Managing Authentication Keys". How to Configure IP Routing Protocol-Independent Features
Configuring Redistribution Routing Information
Defining conditions for redistributing routesTo define conditions for redistributing routes from one routing protocol into another, use at least one of the following commands in route map configuration mode, as needed.
To define conditions for redistributing routes from one routing protocol into another, use at least one of the following set commands in route map configuration mode as needed.
Redistributing routes from one routing domain to anotherTo distribute routes from one routing domain into another routing domain and to control route redistribution, perform the following task. DETAILED STEPS
Removing options for redistributing routesRemoving options that you have configured for the redistribute command requires careful use of the no form of the redistribute command to ensure that you obtain the result that you are expecting. DETAILED STEPS
Configuring Routing Information FilteringTo filter routing protocol information, perform the tasks in the following sections. The tasks in the first section are required; the remaining sections are optional:
Preventing Routing Updates Through an InterfaceTo prevent other routers on a local network from learning about routes dynamically, you can keep routing update messages from being sent through a router interface. Keeping routing update messages from being sent through a router interface prevents other systems on the interface from learning about routes dynamically. This feature applies to all IP-based routing protocols except BGP. OSPF and IS-IS behave somewhat differently. In OSPF, the interface address that you specify as passive appears as a stub network in the OSPF domain. OSPF routing information is neither sent nor received through the specified router interface. In IS-IS, the specified IP addresses are advertised without actually running IS-IS on those interfaces. To prevent routing updates through a specified interface, use the passive-interface interface-type interface-number command in router configuration mode. See the Example Passive Interface for examples of configuring passive interfaces. Configuring Default Passive InterfacesTo set all interfaces as passive by default and then activate only those interfaces that must have adjacencies set, perform the following task. DETAILED STEPS
See the section "Example Default Passive Interface" for an example of a default passive interface. To verify that interfaces on your network have been set to passive, you could enter a network monitoring command such as the show ip ospf interface command, or you could verify the interfaces that you enabled as active using a command such as the show ip interface command. Controlling the Advertising of Routes in Routing UpdatesTo prevent other routers from learning one or more routes, you can suppress routes from being advertised in routing updates. Suppressing routes in route updates prevents other routers from learning the interpretation of a particular device of one or more routes. You cannot specify an interface name in OSPF. When used for OSPF, this feature applies only to external routes. To suppress routes from being advertised in routing updates, use the distribute-list {access-list-number | access-list-name} out[interface-name | routing-process | as-number] command in router configuration mode. Controlling the Processing of Routing UpdatesYou might want to avoid processing certain routes listed in incoming updates. This feature does not apply to OSPF or IS-IS. To suppress routes in incoming updates, use the distribute-list {access-list-number | access-list-name} in[interface-type interface-number] command in router configuration mode. Configuring precedence for policy-based routed packetsTo configure the precedence and specify where the packets that pass the match criteria are output, perform the following task. DETAILED STEPS Configuring QoS Policy Propagation via BGPThe QoS Policy Propagation via BGP feature allows you to classify packets by IP precedence based on BGP community lists, BGP autonomous system paths, and access lists. After a packet has been classified, you can use other QoS features such as committed access rate (CAR) and Weighted Random Early Detection (WRED) to specify and enforce policies to fit your business model. To configure Policy Propagation via BGP, perform the following basic tasks:
This section describes how to configure QoS Policy Propagation based on BGP community list, BGP autonomous system path, or access list. It assumes you have already configured BGP and CEF or dCEF. To configure QoS Policy Propagation via BGP, perform the tasks described in the following sections. The tasks in the first three sections are required; the task in the remaining section is optional.
For configuration examples, see "Examples QoS Policy Propagation via BGP Configuration."
Configuring QoS Policy Propagation Based on Community ListsThis section describes how to configure Policy Propagation via BGP using community lists. The tasks listed in this section are required unless noted as optional. This section assumes that you have already configured CEF/dCEF and BGP on your router. Perform the following task to configure the router to propagate the IP precedence based on the community lists. DETAILED STEPS
Configuring QoS Policy Propagation Based on the Autonomous System Path AttributeThis section describes how to configure QoS Policy Propagation via BGP based on the autonomous system path. This section assumes that you have already configured CEF/dCEF and BGP on your router. Perform the following task to configure the router to propagate the IP precedence based on the autonomous system path attribute. DETAILED STEPS
Configuring QoS Policy Propagation Based on an Access ListThis section describes how to configure QoS Policy Propagation via BGP based on an access list. This section assumes you have already configured CEF/dCEF and BGP on your router. To configure the router to propagate the IP Precedence based on an access list, perform the following task.s DETAILED STEPS
Monitoring QoS Policy Propagation via BGPTo monitor the QoS Policy Propagation via BGP configuration, use the following commands in EXEC mode, as needed. The commands listed in this section are optional.
Managing Authentication KeysTo manage authentication keys, define a key chain, identify the keys that belong to the key chain, and specify how long each key is valid. Each key has its own key identifier (specified with the keykey-chain configuration command), which is stored locally. The combination of the key identifier and the interface associated with the message uniquely identifies the authentication algorithm and Message Digest 5 (MD5) authentication key in use. You can configure multiple keys with lifetimes. Only one authentication packet is sent, regardless of how many valid keys exist. The software examines the key numbers in order from lowest to highest and uses the first valid key that it encounters. The lifetimes allow for overlap during key changes. Note that the router must know the time. Refer to the Network Time Protocol (NTP) and calendar commands in the "Performing Basic System Management" chapter of the Network Management Configuration Guide. To manage authentication keys, perform the following task. DETAILED STEPS
For examples of key management, see the Examples Key Management. Monitoring and Maintaining the IP NetworkYou can remove all contents of a particular cache, table, or database. You also can display specific statistics. The following sections describe each of these tasks. Clearing Routes from the IP Routing TableYou can remove all contents of a particular table. Clearing a table can become necessary when the contents of the particular structure have become, or are suspected to be, invalid. To clear one or more routes from the IP routing table, use the clear ip route {network [mask] | *} command in EXEC mode. Displaying System and Network StatisticsYou can display specific statistics such as the contents of IP routing tables, caches, and databases. Information provided can be used to determine resource utilization and solve network problems. You can also display information about node reachability and discover the routing path that packets leaving your device are taking through the network.
Configuration Examples for Configuring IP Routing Protocol-Independent Features
Example Variable-Length Subnet MaskThe following example uses two different subnet masks for the class B network address of 172.16.0.0. A subnet mask of /24 is used for LAN interfaces. The /24 mask allows 256 subnets with 254 host IP addresses on each subnet. The final subnet of the range of possible subnets using a /24 mask (172.16.255.0) is reserved for use on point-to-point interfaces and assigned a longer mask of /30. The use of a /30 mask on 172.16.255.0 creates 64 subnets (172.16.255.0 - 172.16.255.252) with 2 host addresses on each subnet. To ensure unambiguous routing, you must not assign 172.16.255.0/24 to a LAN interface in your network. Router(config)# interface Ethernet 0/0 Router(config-if)# ip address 172.16.1.1 255.255.255.0 Router(config-if)# ! 8 bits of host address space reserved for Ethernet interfaces Router(config-if)# exit Router(config)# interface Serial 0/0 Router(config-if)# ip address 172.16.255.5 255.255.255.252 Router(config-if)# ! 2 bits of address space reserved for point-to-point serial interfaces Router(config-if)# exit Router(config)# router rip Router(config-router)# network 172.16.0.0 Router(config-router)# ! Specifies the network directly connected to the router Example Overriding Static Routes with Dynamic ProtocolsIn the following example, packets for network 10.0.0.0 from Router B (where the static route is installed) will be routed through 172.18.3.4 if a route with an administrative distance less than 110 is not available. The figure below illustrates this example. The route learned by a protocol with an administrative distance of less than 110 might cause Router B to send traffic destined for network 10.0.0.0 via the alternate path--through Router D.
Router(config)# ip route 10.0.0.0 255.0.0.0 172.18.3.4 110
Example Administrative DistancesIn the following example, the router eigrp global configuration command configures EIGRP routing in autonomous system 1. The network command configuration specifies EIGRP routing on networks 192.168.7.0 and 172.16.0.0. The first distance router configuration command sets the default administrative distance to 255, which instructs the router to ignore all routing updates from routers for which an explicit distance has not been set. The second distance command sets the administrative distance to 80 for internal EIGRP routes and to 100 for external EIGRP routes. The third distance command sets the administrative distance to 120 for the router with the address 172.16.1.3. Router(config)# router eigrp 1 Router(config-router)# network 192.168.7.0 Router(config-router)# network 172.16.0.0 Router(config-router)# distance 255 Router(config-router)# distance eigrp 80 100 Router(config-router)# distance 120 172.16.1.3 0.0.0.0
The following example assigns the router with the address 192.168.7.18 an administrative distance of 100 and all other routers on subnet 192.168.7.0 an administrative distance of 200: Router(config-router)# distance 100 192.168.7.18 0.0.0.0 Router(config-router)# distance 200 192.168.7.0 0.0.0.255 However, if you reverse the order of these two commands, all routers on subnet 192.168.7.0 are assigned an administrative distance of 200, including the router at address 192.168.7.18: Router(config-router)# distance 200 192.168.7.0 0.0.0.255 Router(config-router)# distance 100 192.168.7.18 0.0.0.0
In the following example, the distance value for IP routes learned is 90. Preference is given to these IP routes rather than routes with the default administrative distance value of 110. Router(config)# router isis Router(config-router)# distance 90 ip Example Static Routing RedistributionIn the example that follows, three static routes are specified, two of which are to be advertised. The static routes are created by specifying the redistribute static router configuration command and then specifying an access list that allows only those two networks to be passed to the EIGRP process. Any redistributed static routes should be sourced by a single router to minimize the likelihood of creating a routing loop. Router(config)# ip route 192.168.2.0 255.255.255.0 192.168.7.65 Router(config)# ip route 192.168.5.0 255.255.255.0 192.168.7.65 Router(config)# ip route 10.10.10.0 255.255.255.0 10.20.1.2 Router(config)# ! Router(config)# access-list 3 permit 192.168.2.0 0.0.255.255 Router(config)# access-list 3 permit 192.168.5.0 0.0.255.255 Router(config)# access-list 3 permit 10.10.10.0 0.0.0.255 Router(config)# ! Router(config)# router eigrp 1 Router(config-router)# network 192.168.0.0 Router(config-router)# network 10.10.10.0 Router(config-router)# redistribute static metric 10000 100 255 1 1500 Router(config-router)# distribute-list 3 out static Example EIGRP RedistributionEach EIGRP routing process provides routing information to only one autonomous system. The Cisco IOS software must run a separate EIGRP process and maintain a separate routing database for each autonomous system that it services. However, you can transfer routing information between these routing databases. In the following configuration, network 10.0.0.0 is configured under EIGRP autonomous system 1 and network 192.168.7.0 is configured under EIGRP autonomous system 101: Router(config)# router eigrp 1 Router(config-router)# network 10.0.0.0 Router(config-router)# exit Router(config)# router eigrp 101 Router(config-router)# network 192.168.7.0 In the following example, routes from the 192.168.7.0 network are redistributed into autonomous system 1 (without passing any other routing information from autonomous system 101): Router(config)# access-list 3 permit 192.168.7.0 Router(config)# ! Router(config)# route-map 101-to-1 permit 10 Router(config-route-map)# match ip address 3 Router(config-route-map)# set metric 10000 100 1 255 1500 Router(config-route-map)# exit Router(config)# router eigrp 1 Router(config-router)# redistribute eigrp 101 route-map 101-to-1 Router(config-router)#! The following example is an alternative way to redistribute routes from the 192.168.7.0 network into autonomous system 1. Unlike the previous configuration, this method does not allow you to set the metric for redistributed routes. Router(config)# access-list 3 permit 192.168.7.0 Router(config)# ! Router(config)# router eigrp 1 Router(config-router)# redistribute eigrp 101 Router(config-router)# distribute-list 3 out eigrp 101 Router(config-router)# ! Example Simple RedistributionConsider a WAN at a university that uses RIP as an interior routing protocol. Assume that the university wants to connect its WAN to a regional network, 172.16.0.0, which uses EIGRP as the routing protocol. The goal in this case is to advertise the networks in the university network to the routers on the regional network. In the following example, EIGRP-to-RIP redistribution is configured: Router(config)# access-list 10 permit 172.16.0.0 Router(config)# ! Router(config)# router eigrp 1 Router(config-router)# network 172.16.0.0 Router(config-router)# redistribute rip metric 10000 100 255 1 1500 Router(config-router)# distribute-list 10 out rip Router(config-router)# exit Router(config)# router rip Router(config-router)# redistribute eigrp 1 Router(config-router)# ! In this example, an EIGRP routing process is started. The network router configuration command specifies that network 172.16.0.0 (the regional network) is to send and receive EIGRP routing information. The redistribute router configuration command specifies that RIP-derived routing information be advertised in the routing updates. The default-metric router configuration command assigns an EIGRP metric to all RIP-derived routes. The distribute-list router configuration command instructs the Cisco IOS software to use access list 10 (not defined in this example) to limit the entries in each outgoing update. The access list prevents unauthorized advertising of university routes to the regional network. Example Complex RedistributionIn the following example, mutual redistribution is configured between EIGRP and BGP. Routes from BGP autonomous system 50000 are injected into EIGRP routing process101. A filter is configured to ensure that the correct routes are advertised. Router(config)# ! All networks that should be advertised from R1 are controlled with ACLs: Router(config)# access-list 1 permit 172.18.0.0 0.0.255.255 Router(config)# access-list 1 permit 172.16.0.0 0.0.255.255 Router(config)# access-list 1 permit 172.25.0.0 0.0.255.255 Router(config)# ! Configuration for router R1: Router(config)# router bgp 50000 Router(config-router)# network 172.18.0.0 Router(config-router)# network 172.16.0.0 Router(config-router)# neighbor 192.168.10.1 remote-as 2 Router(config-router)# neighbor 192.168.10.15 remote-as 1 Router(config-router)# neighbor 192.168.10.24 remote-as 3 Router(config-router)# redistribute eigrp 101 Router(config-router)# distribute-list 1 out eigrp 101 Router(config-router)# exit Router(config)# router eigrp 101 Router(config-router)# network 172.25.0.0 Router(config-router)# redistribute bgp 50000 Router(config-router)# distribute-list 1 out bgp 50000 Router(config-router)# !
Examples OSPF Routing and Route RedistributionOSPF typically requires coordination among many internal routers, Area Border Routers (ABRs), and Autonomous System Boundary Routers (ASBRs). At a minimum, OSPF-based routers can be configured with all default parameter values, with no authentication, and with interfaces assigned to areas. Three types of examples follow:
Examples Basic OSPF ConfigurationThe following example illustrates a simple OSPF configuration that enables OSPF routing process 1, attaches Ethernet interface 0 to area 0.0.0.0, and redistributes RIP into OSPF and OSPF into RIP: Router(config)# interface Ethernet 0 Router(config-if)# ip address 172.16.1.1 255.255.255.0 Router(config-if)# ip ospf cost 1 Router(config-if)# exit Router(config)# interface Ethernet 1 Router(config-if)# ip address 172.17.1.1 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 172.18.0.0 0.0.255.255 area 0.0.0.0 Router(config-router)# redistribute rip metric 1 subnets Router(config-router)# exit Router(config)# router rip Router(config-router)# network 172.17.0.0 Router(config-router)# redistribute ospf 1 Router(config-router)# default-metric 1 Router(config-router)# ! The following example illustrates the assignment of four area IDs to four IP address ranges. In the example, OSPF routing process 1 is initialized, and four OSPF areas are defined: 10.9.50.0, 2, 3, and 0. Areas 10.9.50.0, 2, and 3 mask-specific address ranges, whereas area 0 enables OSPF for all other networks. Router(config)# router ospf 1 Router(config-router)# network 172.18.20.0 0.0.0.255 area 10.9.50.0 Router(config-router)# network 172.18.0.0 0.0.255.255 area 2 Router(config-router)# network 172.19.10.0 0.0.0.255 area 3 Router(config-router)# network 0.0.0.0 255.255.255.255 area 0 Router(config-router)# exit Router(config)# ! Ethernet interface 0 is in area 10.9.50.0: Router(config)# interface Ethernet 0 Router(config-if)# ip address 172.18.20.5 255.255.255.0 Router(config-if)# exit Router(config)# ! Ethernet interface 1 is in area 2: Router(config)# interface Ethernet 1 Router(config-if)# ip address 172.18.1.5 255.255.255.0 Router(config-if)# exit Router(config)# ! Ethernet interface 2 is in area 2: Router(config)# interface Ethernet 2 Router(config-if)# ip address 172.18.2.5 255.255.255.0 Router(config-if)# exit Router(config)# ! Ethernet interface 3 is in area 3: Router(config)# interface Ethernet 3 Router(config-if)# ip address 172.19.10.5 255.255.255.0 Router(config-if)# exit Router(config)# ! Ethernet interface 4 is in area 0: Router(config)# interface Ethernet 4 Router(config-if)# ip address 172.19.1.1 255.255.255.0 Router(config-if)# exit Router(config)# ! Ethernet interface 5 is in area 0: Router(config)# interface Ethernet 5 Router(config-if)# ip address 10.1.0.1 255.255.0.0 Router(config-if)# ! Each network router configuration command is evaluated sequentially, so the specific order of these commands in the configuration is important. The Cisco IOS software sequentially evaluates the address/wildcard-mask pair for each interface. See the Cisco IOS IP Routing: Protocol-Independent Command Reference for more information. Consider the first network command. Area ID 10.9.50.0 is configured for the interface on which subnet 172.18.20.0 is located. Assume that a match is determined for Ethernet interface 0. Ethernet interface 0 is attached to Area 10.9.50.0 only. The second networkcommand is evaluated next. For Area 2, the same process is then applied to all interfaces (except Ethernet interface 0). Assume that a match is determined for Ethernet interface 1. OSPF is then enabled for that interface, and Ethernet 1 is attached to Area 2. This process of attaching interfaces to OSPF areas continues for all network commands. Note that the last network command in this example is a special case. With this command, all available interfaces (not explicitly attached to another area) are attached to Area 0. Example Internal Router ABR and ASBRs ConfigurationThe figure below provides a general network map that illustrates a sample configuration for several routers within a single OSPF autonomous system. In this configuration, five routers are configured in OSPF autonomous system 1:
Autonomous system 60000 is connected to the outside world via the BGP link to the external peer at IP address 172.16.1.6. Following is the example configuration for the general network map shown in the figure above. Router A Configuration--Internal RouterRouter(config)# interface Ethernet 1 Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 192.168.1.0 0.0.0.255 area 1 Router(config-router)# exit Router B Configuration--Internal RouterRouter(config)# interface Ethernet 2 Router(config-if)# ip address 192.168.1.2 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 192.168.1.0 0.0.0.255 area 1 Router(config-router)# exit Router C Configuration--ABRRouter(config)# interface Ethernet 3 Router(config-if)# ip address 192.168.1.3 255.255.255.0 Router(config-if)# exit Router(config)# interface Serial 0 Router(config-if)# ip address 192.168.2.3 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 192.168.1.0 0.0.0.255 area 1 Router(config-router)# network 192.168.2.0 0.0.0.255 area 0 Router(config-router)# exit Router D Configuration--Internal RouterRouter(config)# interface Ethernet 4 Router(config-if)# ip address 10.0.0.4 255.0.0.0 Router(config-if)# exit Router(config)# interface Serial 1 Router(config-if)# ip address 192.168.2.4 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 192.168.2.0 0.0.0.255 area 0 Router(config-router)# network 10.0.0.0 0.255.255.255 area 0 Router(config-router)# exit Router E Configuration--ASBRRouter(config)# interface Ethernet 5 Router(config-if)# ip address 10.0.0.5 255.0.0.0 Router(config-if)# exit Router(config)# interface Serial 2 Router(config-if)# ip address 172.16.1.5 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 10.0.0.0 0.255.255.255 area 0 Router(config-router)# redistribute bgp 50000 metric 1 metric-type 1 Router(config-router)# exit Router(config)# router bgp 50000 Router(config-router)# network 192.168.0.0 Router(config-router)# network 10.0.0.0 Router(config-router)# neighbor 172.16.1.6 remote-as 60000 Example Complex OSPF ConfigurationThe following example configuration accomplishes several tasks in setting up an ABR. These tasks can be split into two general categories: The specific tasks outlined in this configuration are detailed briefly in the following descriptions. The figure below illustrates the network address ranges and area assignments for the interfaces. The basic configuration tasks in this example are as follows:
Configuration tasks associated with redistribution are as follows:
The following is an example OSPF configuration: Router(config)# interface Ethernet 0 Router(config-if)# ip address 192.168.110.201 255.255.255.0 Router(config-if)# ip ospf authentication-key abcdefgh Router(config-if)# ip ospf cost 10 Router(config-if)# exit Router(config)# interface Ethernet 1 Router(config-if)# ip address 172.19.251.201 255.255.255.0 Router(config-if)# ip ospf authentication-key ijklmnop Router(config-if)# ip ospf cost 20 Router(config-if)# ip ospf retransmit-interval 10 Router(config-if)# ip ospf transmit-delay 2 Router(config-if)# ip ospf priority 4 Router(config-if)# exit Router(config)# interface Ethernet 2 Router(config-if)# ip address 172.19.254.201 255.255.255.0 Router(config-if)# ip ospf authentication-key abcdefgh Router(config-if)# ip ospf cost 10 Router(config-if)# exit Router(config)# interface Ethernet 3 Router(config-if)# ip address 10.56.0.201 255.255.0.0 Router(config-if)# ip ospf authentication-key ijklmnop Router(config-if)# ip ospf cost 20 Router(config-if)# ip ospf dead-interval 80 Router(config-if)# exit In the following configuration, OSPF is on network 172.19.0.0: Router(config)# router ospf 1 Router(config-router)# network 10.0.0.0 0.255.255.255 area 10.0.0.0 Router(config-router)# network 192.168.110.0 0.0.0.255 area 192.68.110.0 Router(config-router)# network 172.19.0.0 0.0.255.255 area 0 Router(config-router)# area 0 authentication Router(config-router)# area 10.0.0.0 stub Router(config-router)# area 10.0.0.0 authentication Router(config-router)# area 10.0.0.0 default-cost 20 Router(config-router)# area 192.168.110.0 authentication Router(config-router)# area 10.0.0.0 range 10.0.0.0 255.0.0.0 Router(config-router)# area 192.168.110.0 range 192.168.110.0 255.255.255.0 Router(config-router)# area 0 range 172.19.251.0 255.255.255.0 Router(config-router)# area 0 range 172.19.254.0 255.255.255.0 Router(config-router)# redistribute eigrp 200 metric-type 2 metric 1 tag 200 subnets Router(config-router)# redistribute rip metric-type 2 metric 1 tag 200 Router(config-router)# exit In the following configuration, EIGRP autonomous system 1 is on 172.19.0.0: Router(config)# router eigrp 1 Router(config-router)# network 172.19.0.0 Router(config-router)# exit Router(config)# ! RIP for 192.168.110.0: Router(config)# router rip Router(config-router)# network 192.168.110.0 Router(config-router)# redistribute eigrp 1 metric 1 Router(config-router)# redistribute ospf 201 metric 1 Router(config-router)# exit Example Default Metric Values RedistributionThe following example shows a router in autonomous system 1 that is configured to run both RIP and EIGRP. The example advertises EIGRP-derived routes using RIP and assigns the EIGRP-derived routes a RIP metric of 10. Router(config)# router rip Router(config-router)# default-metric 10 Router(config-router)# redistribute eigrp 1 Router(config-router)# exit Example Route MapThe examples in this section illustrate the use of redistribution, with and without route maps. Examples from both the IP and Connectionless Network Service (CLNS) routing protocols are given. The following example redistributes all OSPF routes into EIGRP: Router(config)# router eigrp 1 Router(config-router)# redistribute ospf 101 Router(config-router)# exit The following example redistributes RIP routes with a hop count equal to 1 into OSPF. These routes will be redistributed into OSPF as external LSAs with a metric of 5, metric a type of type 1, and a tag equal to 1. Router(config)# router ospf 1 Router(config-router)# redistribute rip route-map rip-to-ospf Router(config-router)# exit Router(config)# route-map rip-to-ospf permit Router(config-route-map)# match metric 1 Router(config-route-map)# set metric 5 Router(config-route-map)# set metric-type type 1 Router(config-route-map)# set tag 1 Router(config-route-map)# exit The following example redistributes OSPF learned routes with tag 7 as a RIP metric of 15: Router(config)# router rip Router(config-router)# redistribute ospf 1 route-map 5 Router(config-router)# exit Router(config)# route-map 5 permit Router(config-route-map)# match tag 7 Router(config-route-map)# set metric 15 The following example redistributes OSPF intra-area and interarea routes with next hop routers on serial interface 0 into BGP with an INTER_AS metric of 5: Router(config)# router bgp 50000 Router(config-router)# redistribute ospf 1 route-map 10 Router(config-router)# exit Router(config)# route-map 10 permit Router(config-route-map)# match route-type internal Router(config-route-map)# match interface serial 0 Router(config-route-map)# set metric 5 The following example redistributes two types of routes into the integrated IS-IS routing table (supporting both IP and CLNS). The first type is OSPF external IP routes with tag 5; these routes are inserted into Level 2 IS-IS link-state packets (LSPs) with a metric of 5. The second type is ISO-IGRP derived CLNS prefix routes that match CLNS access list 2000; these routes will be redistributed into IS-IS as Level 2 LSPs with a metric of 30. Router(config)# router isis Router(config-router)# redistribute ospf 1 route-map 2 Router(config-router)# redistribute iso-igrp nsfnet route-map 3 Router(config-router)# exit Router(config)# route-map 2 permit Router(config-route-map)# match route-type external Router(config-route-map)# match tag 5 Router(config-route-map)# set metric 5 Router(config-route-map)# set level level-2 Router(config-route-map)# exit Router(config)# route-map 3 permit Router(config-route-map)# match address 2000 Router(config-route-map)# set metric 30 Router(config-route-map)# exit With the following configuration, OSPF external routes with tags 1, 2, 3, and 5 are redistributed into RIP with metrics of 1, 1, 5, and 5, respectively. The OSPF routes with a tag of 4 are not redistributed. Router(config)# router rip Router(config-router)# redistribute ospf 101 route-map 1 Router(config-router)# exit Router(config)# route-map 1 permit Router(config-route-map)# match tag 1 2 Router(config-route-map)# set metric 1 Router(config-route-map)# exit Router(config)# route-map 1 permit Router(config-route-map)# match tag 3 Router(config-route-map)# set metric 5 Router(config-route-map)# exit Router(config)# route-map 1 deny Router(config-route-map)# match tag 4 Router(config-route-map)# exit Router(config)# route map 1 permit Router(config-route-map)# match tag 5 Router(config-route-map)# set metric 5 Router(config-route-map)# exit Given the following configuration, a RIP learned route for network 172.18.0.0 and an ISO-IGRP learned route with prefix 49.0001.0002 will be redistributed into an IS-IS Level 2 LSP with a metric of 5: Router(config)# router isis Router(config-router)# redistribute rip route-map 1 Router(config-router)# redistribute iso-igrp remote route-map 1 Router(config-router)# exit Router(config)# route-map 1 permit Router(config-route-map)# match ip address 1 Router(config-route-map)# match clns address 2 Router(config-route-map)# set metric 5 Router(config-route-map)# set level level-2 Router(config-route-map)# exit Router(config)# access-list 1 permit 172.18.0.0 0.0.255.255 Router(config)# clns filter-set 2 permit 49.0001.0002... The following configuration example illustrates how a route map is referenced by the default-information router configuration command. This type of reference is calledconditional default origination. OSPF will originate the default route (network 0.0.0.0) with a type 2 metric of 5 if 172.20.0.0 is in the routing table. Router(config)# route-map ospf-default permit Router(config-route-map)# match ip address 1 Router(config-route-map)# set metric 5 Router(config-route-map)# set metric-type type-2 Router(config-route-map)# exit Router(config)# access-list 1 172.20.0.0 0.0.255.255 Router(config)# router ospf 101 Router(config-router)# default-information originate route-map ospf-default See the "Connecting to a Service Provider Using External BGP" module for more examples of BGP route-map configuration tasks and configuration examples. Example Passive InterfaceIn OSPF, hello packets are not sent on an interface that is specified as passive. Hence, the router will not be able to discover any neighbors, and none of the OSPF neighbors will be able to see the router on that network. In effect, this interface will appear as a stub network to the OSPF domain. This configuration is useful if you want to import routes associated with a connected network into the OSPF domain without any OSPF activity on that interface. The passive-interface router configuration command is typically used when the wildcard specification on the network router configuration command configures more interfaces than is desirable. The following configuration causes OSPF to run on all subnets of 172.18.0.0: Router(config)# interface Ethernet 0 Router(config-if)# ip address 172.18.1.1 255.255.255.0 Router(config-if)# exit Router(config)# interface Ethernet 1 Router(config-if)# ip address 172.18.2.1 255.255.255.0 Router(config-if)# exit Router(config)# interface Ethernet 2 Router(config-if)# ip address 172.18.3.1 255.255.255.0 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# network 172.18.0.0 0.0.255.255 area 0 Router(config-router)# exit If you do not want OSPF to run on 172.18.3.0, enter the following commands: Router(config)# router ospf 1 Router(config-router)# network 172.18.0.0 0.0.255.255 area 0 Router(config-router)# passive-interface Ethernet 2 Router(config-router)# exit Example Default Passive InterfaceThe following example configures the network interfaces, sets all interfaces that are running OSPF as passive, and then enables serial interface 0: Router(config)# interface Ethernet 0 Router(config-if)# ip address 172.19.64.38 255.255.255.0 secondary Router(config-if)# ip address 172.19.232.70 255.255.255.240 Router(config-if)# no ip directed-broadcast Router(config-if)# exit Router(config)# interface Serial 0 Router(config-if)# ip address 172.24.101.14 255.255.255.252 Router(config-if)# no ip directed-broadcast Router(config-if)# no ip mroute-cache Router(config-if)# exit Router(config)# interface TokenRing 0 Router(config-if)# ip address 172.20.10.4 255.255.255.0 Router(config-if)# no ip directed-broadcast Router(config-if)# no ip mroute-cache Router(config-if)# ring-speed 16 Router(config-if)# exit Router(config)# router ospf 1 Router(config-router)# passive-interface default Router(config-router)# no passive-interface Serial 0 Router(config-router)# network 172.16.10.0 0.0.0.255 area 0 Router(config-router)# network 172.19.232.0 0.0.0.255 area 4 Router(config-router)# network 172.24.101.0 0.0.0.255 area 4 Router(config-router)# exit Example Policy-Based RoutingThe following example provides two sources with equal access to two different service providers. Packets that arrive on asynchronous interface 1 from the source 10.1.1.1 are sent to the router at 172.16.6.6 if the router has no explicit route for the destination of the packet. Packets that arrive from the source 172.17.2.2 are sent to the router at 192.168.7.7 if the router has no explicit route for the destination of the packet. All other packets for which the router has no explicit route to the destination are discarded. Router(config)# access-list 1 permit ip 10.1.1.1 Router(config)# access-list 2 permit ip 172.17.2.2 Router(config)# interface async 1 Router(config-if)# ip policy route-map equal-access Router(config-if)# exit Router(config)# route-map equal-access permit 10 Router(config-route-map)# match ip address 1 Router(config-route-map)# set ip default next-hop 172.16.6.6 Router(config-route-map)# exit Router(config)# route-map equal-access permit 20 Router(config-route-map)# match ip address 2 Router(config-route-map)# set ip default next-hop 192.168.7.7 Router(config-route-map)# exit Router(config)# route-map equal-access permit 30 Router(config-route-map)# set default interface null 0 Router(config-route-map)# exit Example Policy Routing with CEFThe following example configures policy routing with CEF. The route is configured to verify that next hop 10.0.0.8 of the route map named test1 is a CDP neighbor before the router tries to policy-route to it. Router(config)# ip cef Router(config)# interface Ethernet 0/0/1 Router(config-if)# ip route-cache flow Router(config-if)# ip policy route-map test Router(config-if)# exit Router(config)# route-map test permit 10 Router(config-route-map)# match ip address 1 Router(config-route-map)# set ip precedence priority Router(config-route-map)# set ip next-hop 10.0.0.8 Router(config-route-map)# set ip next-hop verify-availability Router(config-route-map)# exit Router(config)# route-map test permit 20 Router(config-route-map)# match ip address 101 Router(config-route-map)# set interface Ethernet 0/0/3 Router(config-route-map)# set ip tos max-throughput Router(config-route-map)# exit Examples QoS Policy Propagation via BGP ConfigurationThe following example shows how to create route maps to match access lists, BGP community lists, and BGP autonomous system paths, and apply IP precedence to routes learned from neighbors. For information on how to configure QoS Policy Propagation via BGP, see the section Configuring QoS Policy Propagation via BGP in this document. In the figure below, Router A (Cisco 10000 Series) learns routes from autonomous system 10 and autonomous system 60. QoS policy is applied to all packets that match the defined route maps. Any packets from Router A (Cisco 10000 Series) to autonomous system 10 or autonomous system 60 are sent the appropriate QoS policy, as the numbered steps indicate. Router A (Cisco 10000 Series) Configurationinterface serial 5/0/0/1:0 ip address 10.28.38.2 255.255.255.0 bgp-policy destination ip-prec-map no ip mroute-cache no cdp enable frame-relay interface-dlci 20 IETF router bgp 30 table-map precedence-map neighbor 10.20.20.1 remote-as 10 neighbor 10.20.20.1 send-community ! ip bgp-community new-format ! ! Match community 1 and set the IP Precedence to priority route-map precedence-map permit 10 match community 1 set ip precedence priority ! ! Match community 2 and set the IP Precedence to immediate route-map precedence-map permit 20 match community 2 set ip precedence immediate ! ! Match community 3 and set the IP Precedence to flash route-map precedence-map permit 30 match community 3 set ip precedence flash ! ! Match community 4 and set the IP Precedence to flash-override route-map precedence-map permit 40 match community 4 set ip precedence flash-override ! ! Match community 5 and set the IP Precedence to critical route-map precedence-map permit 50 match community 5 set ip precedence critical ! ! Match community 6 and set the IP Precedence to internet route-map precedence-map permit 60 match community 6 set ip precedence internet ! ! Match community 7 and set the IP Precedence to network route-map precedence-map permit 70 match community 7 set ip precedence network ! ! Match ip address access list 69 or match AS path 1 ! and set the IP Precedence to critical route-map precedence-map permit 75 match ip address 69 match as-path 1 set ip precedence critical ! ! For everything else, set the IP Precedence to routine route-map precedence-map permit 80 set ip precedence routine ! ! Define the community lists ip community-list 1 permit 60:1 ip community-list 2 permit 60:2 ip community-list 3 permit 60:3 ip community-list 4 permit 60:4 ip community-list 5 permit 60:5 ip community-list 6 permit 60:6 ip community-list 7 permit 60:7 ! ! Define the AS path ip as-path access-list 1 permit ^10_60 ! ! Define the access list access-list 69 permit 10.69.0.0 Router B Configurationrouter bgp 10 neighbor 10.30.30.1 remote-as 30 neighbor 10.30.30.1 send-community neighbor 10.30.30.1 route-map send_community out ! ip bgp-community new-format ! ! Match prefix 10 and set community to 60:1 route-map send_community permit 10 match ip address 10 set community 60:1 ! ! Match prefix 20 and set community to 60:2 route-map send_community permit 20 match ip address 20 set community 60:2 ! ! Match prefix 30 and set community to 60:3 route-map send_community permit 30 match ip address 30 set community 60:3 ! ! Match prefix 40 and set community to 60:4 route-map send_community permit 40 match ip address 40 set community 60:4 ! ! Match prefix 50 and set community to 60:5 route-map send_community permit 50 match ip address 50 set community 60:5 ! ! Match prefix 60 and set community to 60:6 route-map send_community permit 60 match ip address 60 set community 60:6 ! ! Match prefix 70 and set community to 60:7 route-map send_community permit 70 match ip address 70 set community 60:7 ! ! For all others, set community to 60:8 route-map send_community permit 80 set community 60:8 ! ! Define the access lists access-list 10 permit 10.61.0.0 access-list 20 permit 10.62.0.0 access-list 30 permit 10.63.0.0 access-list 40 permit 10.64.0.0 access-list 50 permit 10.65.0.0 access-list 60 permit 10.66.0.0 access-list 70 permit 10.67.0.0 Examples Key ManagementThe following example configures a key chain named trees. In this example, the software will always accept and send willow as a valid key. The key chestnut will be accepted from 1:30 p.m. to 3:30 p.m. and be sent from 2:00 p.m. to 3:00 p.m. The overlap allows for migration of keys or discrepancy in the set time of the router. Likewise, the key birch immediately follows chestnut, and there is a 30-minute leeway on each side to handle time-of-day differences. Router(config)# interface Ethernet 0 Router(config-if)# ip rip authentication key-chain trees Router(config-if)# ip rip authentication mode md5 Router(config-if)# exit Router(config)# router rip Router(config-router)# network 172.19.0.0 Router(config-router)# version 2 Router(config-router)# exit Router(config)# key chain trees Router(config-keychain)# key 1 Router(config-keychain-key)# key-string willow Router(config-keychain-key)# key 2 Router(config-keychain-key)# key-string chestnut Router(config-keychain-key)# accept-lifetime 13:30:00 Jan 25 2005 duration 7200 Router(config-keychain-key)# send-lifetime 14:00:00 Jan 25 2005 duration 3600 Router(config-keychain-key)# key 3 Router(config-keychain-key)# key-string birch Router(config-keychain-key)# accept-lifetime 14:30:00 Jan 25 2005 duration 7200 Router(config-keychain-key)# send-lifetime 15:00:00 Jan 25 2005 duration 3600 Router(config-keychain-key)# exit The following example configures a key chain named trees: Router(config)# key chain trees Router(config-keychain)# key 1 Router(config-keychain-key)# key-string willow Router(config-keychain-key)# key 2 Router(config-keychain-key)# key-string chestnut Router(config-keychain-key)# accept-lifetime 00:00:00 Dec 5 2004 23:59:59 Dec 5 2005 Router(config-keychain-key)# send-lifetime 06:00:00 Dec 5 2004 18:00:00 Dec 5 2005 Router(config-keychain-key)# exit Router(config-keychain)# exit Router(config)# interface Ethernet 0 Router(config-if)# ip address 172.19.104.75 255.255.255.0 secondary 172.19.232.147 255.255.255.240 Router(config-if)# ip rip authentication key-chain trees Router(config-if)# media-type 10BaseT Router(config-if)# exit Router(config)# interface Ethernet 1 Router(config-if)# no ip address Router(config-if)# shutdown Router(config-if)# media-type 10BaseT Router(config-if)# exit Router(config)# interface Fddi 0 Router(config-if)# ip address 10.1.1.1 255.255.255.0 Router(config-if)# no keepalive Router(config-if)# exit Router(config)# interface Fddi 1 Router(config-if)# ip address 172.16.1.1 255.255.255.0 Router(config-if)# ip rip send version 1 Router(config-if)# ip rip receive version 1 Router(config-if)# no keepalive Router(config-if)# exit Router(config)# router rip Router(config-router)# version 2 Router(config-router)# network 172.19.0.0 Router(config-router)# network 10.0.0.0 Router(config-router)# network 172.16.0.0 Additional ReferencesRelated DocumentsMIBsTechnical Assistance
Feature Information for Configuring IP Routing Protocol-Independent FeaturesThe following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature. Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R) Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental. © 2011 Cisco Systems, Inc. All rights reserved.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|