Configuring OSPF: Cisco's OSPF Implementation
Configuring OSPF: Cisco's OSPF Implementation
This chapter describes how to congure OSPF. For a complete description of the OSPF commands in this chapter, refer to the OSPF Commands chapter of the Network Protocols Command Reference, Part 1. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online. Open shortest path rst (OSPF) is an IGP developed by the OSPF working group of the Internet Engineering Task Force (IETF). Designed expressly for IP networks, OSPF supports IP subnetting and tagging of externally derived routing information. OSPF also allows packet authentication and uses IP multicast when sending/receiving packets. We support RFC 1253, Open Shortest Path First (OSPF) MIB, August 1991. The OSPF MIB denes an IP routing protocol that provides management information related to OSPF and is supported by Cisco routers. For protocol-independent features that include OSPF, see the chapter Conguring IP Routing Protocol-Independent Features in this document.
Stub areasDenition of stub areas is supported. Route redistributionRoutes learned via any IP routing protocol can be redistributed into any other IP routing protocol. At the intradomain level, this means that OSPF can import routes learned via IGRP, RIP, and IS-IS. OSPF routes can also be exported into IGRP, RIP, and IS-IS. At the interdomain level, OSPF can import routes learned via EGP and BGP. OSPF routes can be exported into EGP and BGP. AuthenticationPlain text and MD5 authentication among neighboring routers within an area is supported. Routing interface parametersCongurable parameters supported include interface output cost, retransmission interval, interface transmit delay, router priority, router dead and hello intervals, and authentication key. Virtual linksVirtual links are supported. NSSA areasRFC 1587. OSPF over demand circuitRFC 1793.
Enable OSPF Congure OSPF Interface Parameters Congure OSPF over Different Physical Networks Congure OSPF Area Parameters Congure OSPF Not So Stubby Area (NSSA) Congure Route Summarization between OSPF Areas Congure Route Summarization when Redistributing Routes into OSPF Create Virtual Links Generate a Default Route Congure Lookup of DNS Names Force the Router ID Choice with a Loopback Interface Control Default Metrics Change the OSPF Administrative Distances Congure OSPF on Simplex Ethernet Interfaces Congure Route Calculation Timers Congure OSPF over On Demand Circuits Log Neighbors Going Up or Down Change the LSA Group Pacing Block OSPF LSA Flooding Ignore MOSPF LSA Packets Monitor and Maintain OSPF
In addition, you can specify route redistribution; see the task Redistribute Routing Information in the chapter Conguring IP Routing Protocol-Independent Features for information on how to congure route redistribution.
P1C-108
Enable OSPF
Enable OSPF
As with other routing protocols, enabling OSPF requires that you create an OSPF routing process, specify the range of IP addresses to be associated with the routing process, and assign area IDs to be associated with that range of IP addresses. Use the following commands, starting in global conguration mode:
Step
1 2
Purpose Enable OSPF routing, which places you in router conguration mode. Dene an interface on which OSPF runs and dene the area ID for that interface.
Broadcast networks (Ethernet, Token Ring, FDDI) Nonbroadcast multiaccess networks (SMDS, Frame Relay, X.25) Point-to-point networks (HDLC, PPP)
You can congure your network as either a broadcast or a nonbroadcast multiaccess network. X.25 and Frame Relay provide an optional broadcast capability that can be congured in the map to allow OSPF to run as a broadcast network. See the x25 map and frame-relay map command descriptions in the Wide-Area Networking Command Reference for more detail.
Point-to-multipoint is easier to congure because it requires no conguration of neighbor commands, it consumes only one IP subnet, and it requires no designated router election. It costs less because it does not require a fully meshed topology. It is more reliable because it maintains connectivity in the event of virtual circuit failure.
To congure your OSPF network type, use the following command in interface conguration mode:
Command ip ospf network {broadcast | non-broadcast | {point-to-multipoint [non-broadcast] }} Purpose Congure the OSPF network type for a specied interface.
See the OSPF Point-to-Multipoint Example section at the end of this chapter for an example of an OSPF point-to-multipoint network.
Before this feature, some OSPF point-to-multipoint protocol trafc was treated as multicast trafc. Therefore, the neighbor command was not needed for point-to-multipoint interfaces because multicast took care of the trafc. Hellos, updates and acknowledgments were sent using multicast. In particular, multicast hellos discovered all neighbors dynamically. On any point-to-multipoint interface (broadcast or not), the Cisco IOS software assumed the cost to each neighbor was equal. The cost was congured with the ip ospf cost command. In reality, the bandwidth to each neighbor is different, so the cost should be different. With this feature, you can congure a separate cost to each neighbor. This feature applies to point-to-multipoint interfaces only. To treat an interface as point-to-multipoint broadcast and assign a cost to each neighbor, use the following commands beginning in interface conguration mode:
Step
1 2 3 4 5
Command ip ospf network point-to-multipoint exit router ospf process-id neighbor ip-address cost number
Purpose Congure an interface as point-to-multipoint for broadcast media. Enter global conguration mode. Congure an OSPF routing process and enter router conguration mode. Specify a neighbor and assign a cost to the neighbor. Repeat Step 4 for each neighbor if you want to specify a cost. Otherwise, neighbors will assume the cost of the interface, based on the ip ospf cost command.
Priority for a neighboring router Nonbroadcast poll interval Interface through which the neighbor is reachable
On point-to-multipoint, nonbroadcast networks, you now use the neighbor command to identify neighbors. Assigning a cost to a neighbor is optional. Prior to Release 12.0, some customers were using point-to-multipoint on nonbroadcast media (such as classic IP over ATM), so their routers could not dynamically discover their neighbors. This feature allows the neighbor command to be used on point-to-multipoint interfaces.
Configuring OSPF P1C-111
On any point-to-multipoint interface (broadcast or not), the Cisco IOS software assumed the cost to each neighbor was equal. The cost was congured with the ip ospf cost command. In reality, the bandwidth to each neighbor is different, so the cost should be different. With this feature, you can congure a separate cost to each neighbor. This feature applies to point-to-multipoint interfaces only. To treat the interface as point-to-multipoint when the media does not support broadcast, use the following commands beginning in interface conguration mode:
Step
1 2 3 4 5
Command ip ospf network point-to-multipoint non-broadcast exit router ospf process-id neighbor ip-address [cost number]
Purpose Congure an interface as point-to-multipoint for nonbroadcast media. Enter global conguration mode. Congure an OSPF routing process and enter router conguration mode. Specify an OSPF neighbor and optionally assign a cost to the neighbor. Repeat Step 4 for each neighbor.
P1C-112
Implementation Considerations
Use NSSA to simplify administration if you are an Internet service provider (ISP), or a network administrator that must connect a central site using OSPF to a remote site that is using a different routing protocol. Prior to NSSA, the connection between the corporate site border router and the remote router could not be run as OSPF stub area because routes for the remote site cannot be redistributed into stub area. A simple protocol like RIP is usually run and handle the redistribution. This meant maintaining two routing protocols. With NSSA, you can extend OSPF to cover the remote connection by dening the area between the corporate router and the remote router as an NSSA. In router conguration mode, use the following command to specify area parameters as needed to congure OSPF NSSA:
Command area area-id nssa [no-redistribution] [default-information-originate] Purpose Dene an area to be NSSA.
In router conguration mode on the ABR, use the following command to control summarization and ltering of Type 7 LSA into Type 5 LSA:
Command summary address prex mask [not advertise] [tag tag] Purpose (Optional) Control the summarization and ltering during the translation.
Implementation Considerations
Evaluate the following considerations before implementing this feature:
You can set a Type 7 default route that can be used to reach external destinations. When congured, the router generates a Type 7 default into the NSSA by the NSSA ABR. Every router within the same area must agree that the area is NSSA; otherwise, the routers will not be able to communicate with each other.
If possible, avoid using explicit redistribution on NSSA ABR because confusion may result over which packets are being translated by which router.
To display information about virtual links, use the show ip ospf virtual-links EXEC command. To display the router ID of an OSPF router, use the show ip ospf EXEC command.
See the discussion of redistribution of routes in the Conguring IP Routing Protocol-Independent Features chapter.
Purpose Create a loopback interface, which places you in interface conguration mode. Assign an IP address to this interface.
For an example of changing administrative distance, see the section Changing OSPF Administrative Distance at the end of this chapter.
Implementation Considerations
With this feature, periodic hellos are suppressed and the periodic refreshes of LSAs are not ooded over the demand circuit. These packets bring up the link only when they are exchanged for the rst time, or when a change occurs in the information they contain. This operation allows the underlying datalink layer to be closed when the network topology is stable. This feature is useful when you want to connect telecommuters or branch ofces to an OSPF backbone at a central site. In this case, OSPF for on demand circuits allows the benets of OSPF over the entire domain, without excess connection costs. Periodic refreshes of hello updates, LSA updates, and other protocol overhead are prevented from enabling the on demand circuit when there is no real data to transmit. Overhead protocols such as hellos and LSAs are transferred over the on demand circuit only upon initial setup and when they reect a change in the topology. This means that critical changes to the topology that require new SPF calculations are transmitted in order to maintain network topology integrity. Periodic refreshes that do not include changes, however, are not transmitted across the link. To congure OSPF for on demand circuits, use the following commands, beginning in global conguration mode:
Step
1 2 3
Purpose Enable OSPF operation. Enter interface conguration mode. Congure OSPF on an on demand circuit.
If the router is part of a point-to-point topology, then only one end of the demand circuit must be congured with this command. However, all routers must have this feature loaded. If the router is part of a point-to-multipoint topology, only the multipoint end must be congured with this command. For an example of OSPF over an on-demand circuit, see the section OSPF over On-Demand Routing Example at the end of this chapter.
Implementation Considerations
Evaluate the following considerations before implementing this feature:
Because LSAs that include topology changes are ooded over an on demand circuit, it is advised to put demand circuits within OSPF stub areas, or within NSSAs to isolate the demand circuits from as many topology changes as possible. To take advantage of the on demand circuit functionality within a stub area or NSSA, every router in the area must have this feature loaded. If this feature is deployed within a regular area, all other regular areas must also support this feature before the demand circuit functionality can take effect. This is because type 5 external LSAs are ooded throughout all areas. You do not want to do on a broadcast-based network topology because the overhead protocols (such as hellos and LSAs) cannot be successfully suppressed, which means the link will remain up. Conguring the router for an OSPF on-demand circuit with an asynchronous interface is not a supported conguration. The supported conguration is to use dialer interfaces on both ends of the circuit. For more information, refer to the following TAC URL: http://www.cisco.com/warp/public/104/dcprob.html#reason5
Congure this command if you want to know about OSPF neighbors going up or down without turning on the debugging command debug ip ospf adjacency. The ospf log-adjacency-changes command provides a higher level view of such changes with less output.
P1C-118
Solution
Figure 21
All LSAs refreshed, 120 external LSAs on Ethernet need three packets
Solution
This problem is solved by each LSA having its own timer. Again using the example of refreshing, each LSA gets refreshed when it is 30 minutes old, independent of other LSAs. So CPU is used only when necessary. However, LSAs being refreshed at frequent, random intervals would require many packets for the few refreshed LSAs the router must send out. That would be inefcient use of bandwidth. Therefore, the router delays the LSA refresh function for an interval of time instead of performing it when the individual timers are reached. The accumulated LSAs constitute a group, which is then refreshed and sent out in one packet or more. Thus, the refresh packets are paced, as are the checksumming and aging. The pacing interval is congurable; it defaults to 4 minutes, which is randomized to further avoid synchronization. Figure 22 illustrates the case of refresh packets. The rst timeline illustrates individual LSA timers; the second timeline illustrates individual LSA timers with group pacing.
Figure 22 OSPF LSAs on Individual Timers with Group Pacing
Without group pacing, LSAs need to be refreshed frequently and at random intervals. Individual LSA timers require many refresh packets that contain few LSAs.
The group pacing interval is inversely proportional to the number of LSAs the router is refreshing, checksumming, and aging. For example, if you have approximately 10,000 LSAs, decreasing the pacing interval would benet you. If you have a very small database (40 to 100 LSAs), increasing the pacing interval to 10 to 20 minutes might benet you slightly.
10471
10341
30 minutes
30 minutes
30 minutes
The default value of pacing between LSA groups is 240 seconds (4 minutes). The range is 10 seconds to 1800 seconds (half an hour). To change the LSA group pacing interval, use the following command in router conguration mode:
Command timers lsa-group-pacing seconds Purpose Change the group pacing of LSAs.
For an example, see the section LSA Group Pacing Example at the end of this chapter.
On broadcast, nonbroadcast, and point-to-point networks, you can block ooding over specied OSPF interfaces. On point-to-multipoint networks, you can block ooding to a specied neighbor.
On broadcast, nonbroadcast, and point-to-point networks, to prevent ooding of OSPF LSAs, use the following command in interface conguration mode:
Command ospf database-lter all out Purpose Block the ooding of OSPF LSA packets to the interface.
On point-to-multipoint networks, to prevent ooding of OSPF LSAs, use the following command in router conguration mode:
Command neighbor ip-address database-lter all out Purpose Block the ooding of OSPF LSA packets to the specied neighbor.
For an example of blocking LSA ooding, see the section Block LSA Flooding Example at the end of this chapter.
For an example of suppressing MOSPF LSA packets, see the section Ignore MOSPF LSA Packets Example at the end of this chapter.
P1C-120 Network Protocols Configuration Guide, Part 1
show ip ospf interface [interface-name] show ip ospf neighbor [interface-name] [neighbor-id] detail show ip ospf request-list [nbr] [intf] [intf-nbr] show ip ospf retransmission-list [nbr] [intf] [intf-nbr] show ip ospf virtual-links
OSPF Point-to-Multipoint Example OSPF Point-to-Multipoint, Broadcast Example OSPF Point-to-Multipoint, Nonbroadcast Example Variable-Length Subnet Masks Example OSPF Routing and Route Redistribution Examples
Configuring OSPF P1C-121
Route Map Examples Changing OSPF Administrative Distance OSPF over On-Demand Routing Example LSA Group Pacing Example Block LSA Flooding Example Ignore MOSPF LSA Packets Example
402
Mollies Conguration
hostname mollie ! interface serial 1 ip address 10.0.0.2 255.0.0.0 ip ospf network point-to-multipoint encapsulation frame-relay frame-relay map ip 10.0.0.1 201 broadcast frame-relay map ip 10.0.0.3 202 broadcast frame-relay map ip 10.0.0.4 203 broadcast ! router ospf 1 network 10.0.0.0 0.0.0.255 area 0
P1C-122
S3775
Platty 10.0.0.4
401
301
Jelly
Neons Conguration
hostname neon ! interface serial 0 ip address 10.0.0.1 255.0.0.0 ip ospf network point-to-multipoint encapsulation frame-relay frame-relay map ip 10.0.0.2 101 broadcast frame-relay map ip 10.0.0.4 102 broadcast ! router ospf 1 network 10.0.0.0 0.0.0.255 area 0
Plattys Conguration
hostname platty ! interface serial 3 ip address 10.0.0.4 255.0.0.0 ip ospf network point-to-multipoint encapsulation frame-relay clock rate 1000000 frame-relay map ip 10.0.0.1 401 broadcast frame-relay map ip 10.0.0.2 402 broadcast ! router ospf 1 network 10.0.0.0 0.0.0.255 area 0
Jellys Conguration
hostname jelly ! interface serial 2 ip address 10.0.0.3 255.0.0.0 ip ospf network point-to-multipoint encapsulation frame-relay clock rate 2000000 frame-relay map ip 10.0.0.2 301 broadcast ! router ospf 1 network 10.0.0.0 0.0.0.255 area 0
The output shown for neighbors in the rst conguration above looks like this:
Router# show ip ospf neighbor Neighbor ID Pri State 4.1.1.1 1 FULL/ 3.1.1.1 1 FULL/ 2.1.1.1 1 FULL/ Dead Time 00:01:50 00:01:47 00:01:45 Address 10.0.1.5 10.0.1.4 10.0.1.3 Interface Serial0 Serial0 Serial0
The route information in the rst conguration above looks like this:
Router# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set C 1.0.0.0/8 is directly connected, Loopback0 10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks O 10.0.1.3/32 [110/100] via 10.0.1.3, 00:39:08, Serial0 C 10.0.1.0/24 is directly connected, Serial0 O 10.0.1.5/32 [110/5] via 10.0.1.5, 00:39:08, Serial0 O 10.0.1.4/32 [110/10] via 10.0.1.4, 00:39:08, Serial0
P1C-124
The following example is the conguration for the router on the other side:
interface Serial9/2 ip address 10.0.1.3 255.255.255.0 encapsulation frame-relay ip ospf network point-to-multipoint non-broadcast no ip mroute-cache no keepalive no fair-queue frame-relay local-dlci 301 frame-relay map ip 10.0.1.1 300 no shut ! router ospf 1 network 10.0.1.0 0.0.0.255 area 0
The output shown for neighbors in the rst conguration above looks like this:
Router# show ip ospf neighbor Neighbor ID Pri State 4.1.1.1 1 FULL/ 3.1.1.1 1 FULL/ 2.1.1.1 1 FULL/ Dead Time 00:01:52 00:01:52 00:01:52 Address 10.0.1.5 10.0.1.4 10.0.1.3 Interface Serial0 Serial0 Serial0
The rst is a simple conguration illustrating basic OSPF commands. The second example illustrates a conguration for an internal router, ABR, and ASBRs within a single, arbitrarily assigned, OSPF autonomous system. The third example illustrates a more complex conguration and the application of various tools available for controlling OSPF-based routing environments.
Configuring OSPF P1C-125
Basic OSPF Conguration Example for Internal Router, ABR, and ASBRs
The following example illustrates the assignment of four area IDs to four IP address ranges. In the example, OSPF routing process 109 is initialized, and four OSPF areas are dened: 10.9.50.0, 2, 3, and 0. Areas 10.9.50.0, 2, and 3 mask specic address ranges, while Area 0 enables OSPF for all other networks.
router ospf 109 network 131.108.20.0 0.0.0.255 area 10.9.50.0 network 131.108.0.0 0.0.255.255 area 2 network 131.109.10.0 0.0.0.255 area 3 network 0.0.0.0 255.255.255.255 area 0 ! ! Interface Ethernet0 is in area 10.9.50.0: interface ethernet 0 ip address 131.108.20.5 255.255.255.0 ! ! Interface Ethernet1 is in area 2: interface ethernet 1 ip address 131.108.1.5 255.255.255.0 ! ! Interface Ethernet2 is in area 2: interface ethernet 2 ip address 131.108.2.5 255.255.255.0 ! ! Interface Ethernet3 is in area 3: interface ethernet 3 ip address 131.109.10.5 255.255.255.0 ! ! Interface Ethernet4 is in area 0: interface ethernet 4 ip address 131.109.1.1 255.255.255.0 ! ! Interface Ethernet5 is in area 0: interface ethernet 5 ip address 10.1.0.1 255.255.0.0
Each network area router conguration command is evaluated sequentially, so the order of these commands in the conguration is important. The Cisco IOS software sequentially evaluates the address/wildcard-mask pair for each interface. See the OSPF Commands chapter of the Network Protocols Command Reference, Part 1 for more information.
P1C-126 Network Protocols Configuration Guide, Part 1
Consider the rst network area command. Area ID 10.9.50.0 is congured for the interface on which subnet 131.108.20.0 is located. Assume that a match is determined for interface Ethernet 0. Interface Ethernet 0 is attached to Area 10.9.50.0 only. The second network area command is evaluated next. For Area 2, the same process is then applied to all interfaces (except interface Ethernet 0). Assume that a match is determined for interface Ethernet 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 area commands. Note that the last network area 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.
Figure 24
Router A
Router B
S1 Router D E4 Interface address: 10.0.0.4 Network: 10.0.0.0 E5 Router E Interface address: 131.108.2.4
Area 0
Router A and Router B are both internal routers within Area 1. Router C is an OSPF area border router. Note that for Router C, Area 1 is assigned to E3 and Area 0 is assigned to S0. Router D is an internal router in Area 0 (backbone area). In this case, both network router conguration commands specify the same area (Area 0, or the backbone area). Router E is an OSPF autonomous system boundary router. Note that BGP routes are redistributed into OSPF and that these routes are advertised by OSPF.
P1C-128
S1030a
Note It is not necessary to include denitions of all areas in an OSPF autonomous system in the
conguration of all routers in the autonomous system. You must only dene the directly connected areas. In the example that follows, routes in Area 0 are learned by the routers in Area 1 (Router A and Router B) when the area border router (Router C) injects summary link state advertisements (LSAs) into Area 1.
The OSPF domain in BGP autonomous system 109 is connected to the outside world via the BGP link to the external peer at IP address 11.0.0.6.
Router CABR
interface ethernet 3 ip address 131.108.1.3 255.255.255.0 interface serial 0 ip address 131.108.2.3 255.255.255.0 router ospf 999 network 131.108.1.0 0.0.0.255 area 1 network 131.108.2.0 0.0.0.255 area 0
Router EASBR
interface ethernet 5 ip address 10.0.0.5 255.0.0.0 interface serial 2 ip address 11.0.0.5 255.0.0.0 router ospf 65001 network 10.0.0.0 0.255.255.255 area 0 redistribute bgp 109 metric 1 metric-type 1 router bgp 109 network 131.108.0.0 network 10.0.0.0 neighbor 11.0.0.6 remote-as 110
The specic tasks outlined in this conguration are detailed briey in the following descriptions. Figure 25 illustrates the network address ranges and area assignments for the interfaces.
Figure 25 Interface and Area Specications for OSPF Example Conguration
Network address range: 192.42.110.0 through 192.42.110.255 Area ID: 192.42.110.0
Router A E3
E0 E1 E2
Network address range: 131.119.251.0 through 131.119.251.255 Area ID: 0 Configured as backbone area
P1C-130
Congure address ranges for Ethernet 0 through Ethernet 3 interfaces. Enable OSPF on each interface. Set up an OSPF authentication password for each area and network. Assign link state metrics and other OSPF interface conguration options.
S1031a
Network address range: 36.56.0.0 through 35.56.255.255 Area ID: 36.0.0.0 Configured as stub area
Network address range: 131.119.254.0 through 131.254.255 Area ID: 0 Configured as backbone area
Create a stub area with area id 36.0.0.0. (Note that the authentication and stub options of the area router conguration command are specied with separate area command entries, but can be merged into a single area command.) Specify the backbone area (Area 0).
Conguration tasks associated with redistribution are as follows: Redistribute IGRP and RIP into OSPF with various options set (including metric-type, metric, tag, and subnet). Redistribute IGRP and OSPF into RIP.
The following example redistributes RIP routes with a hop count equal to 1 into OSPF. These routes will be redistributed into OSPF as external link state advertisements with a metric of 5, metric type of Type 1, and a tag equal to 1.
router ospf 109 redistribute rip route-map rip-to-ospf ! route-map rip-to-ospf permit match metric 1 set metric 5 set metric-type type1 set tag 1
The following example redistributes OSPF learned routes with tag 7 as a RIP metric of 15:
router rip redistribute ospf 109 route-map 5 ! route-map 5 permit match tag 7 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 bgp 109 redistribute ospf 109 route-map 10 ! route-map 10 permit match route-type internal match interface serial 0 set metric 5
P1C-132
The following example redistributes two types of routes into the integrated IS-IS routing table (supporting both IP and CLNS). The rst are OSPF external IP routes with tag 5; these are inserted into Level 2 IS-IS LSPs with a metric of 5. The second are ISO-IGRP derived CLNS prex routes that match CLNS access list 2000. These will be redistributed into IS-IS as Level 2 LSPs with a metric of 30.
router isis redistribute ospf 109 route-map 2 redistribute iso-igrp nsfnet route-map 3 ! route-map 2 permit match route-type external match tag 5 set metric 5 set level level-2 ! route-map 3 permit match address 2000 set metric 30
With the following conguration, 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 rip redistribute ospf 109 route-map 1 ! route-map 1 permit match tag 1 2 set metric 1 ! route-map 1 permit match tag 3 set metric 5 ! route-map 1 deny match tag 4 ! route map 1 permit match tag 5 set metric 5
The following conguration sets the condition that if there is an OSPF route to network 140.222.0.0, generate the default network 0.0.0.0 into RIP with a metric of 1:
router rip redistribute ospf 109 route-map default ! route-map default permit match ip address 1 set metric 1 ! access-list 1 permit 140.222.0.0 0.0.255.255 access-list 2 permit 0.0.0.0 0.0.0.0
In the following conguration, a RIP learned route for network 160.89.0.0 and an ISO-IGRP learned route with prex 49.0001.0002 will be redistributed into an IS-IS Level 2 LSP with a metric of 5:
router isis redistribute rip route-map 1 redistribute iso-igrp remote route-map 1 ! route-map 1 permit match ip address 1 match clns address 2 set metric 5 set level level-2 ! access-list 1 permit 160.89.0.0 0.0.255.255 clns filter-set 2 permit 49.0001.0002...
The following conguration example illustrates how a route map is referenced by the default-information router conguration command. This is called conditional default origination. OSPF will originate the default route (network 0.0.0.0) with a Type 2 metric of 5 if 140.222.0.0, with network 0.0.0.0 in the routing table. Extended access-lists cannot be used in a route map for conditional default origination.
route-map ospf-default permit match ip address 1 set metric 5 set metric-type type-2 ! access-list 1 140.222.0.0 0.0.255.255 ! router ospf 109 default-information originate route-map ospf-default
P1C-134
Figure 26
OSPF 2
Network 10.0.0.0
Router A
router ospf 1 redistribute ospf 2 subnet distance ospf external 200 ! router ospf 2 redistribute ospf 1 subnet distance ospf external 200
Router B
router ospf 1 redistribute ospf 2 subnet distance ospf external 200 ! router ospf 2 redistribute ospf 1 subnet distance ospf external 200
14830
OSPF 1
Figure 27
Token Ring 0
BRI 0 Router A
BRI 0 Router B
Ethernet 0
14873
Router A
username RouterB password 7 060C1A2F47 isdn switch-type basic-5ess ip routing ! interface TokenRing0 ip address 140.10.20.7 255.255.255.0 no shut ! interface BRI0 no cdp enable description connected PBX 1485 ip address 140.10.10.7 255.255.255.0 encapsulation ppp ip ospf demand-circuit dialer map ip 140.10.10.6 name RouterB broadcast 61484 dialer-group 1 ppp authentication chap no shut ! router ospf 100 network 140.10.10.0 0.0.0.255 area 0 network 140.10.20.0 0.0.0.255 area 0 ! dialer-list 1 protocol ip permit
Router B
username RouterA password 7 04511E0804 isdn switch-type basic-5ess ip routing ! interface Ethernet0 ip address 140.10.60.6 255.255.255.0 no shut ! interface BRI0 no cdp enable description connected PBX 1484 ip address 140.10.10.6 255.255.255.0 encapsulation ppp dialer map ip 140.10.10.7 name RouterA broadcast 61485 dialer-group 1 ppp authentication chap no shut ! router ospf 100 network 140.10.10.0 0.0.0.255 area 0 network 140.10.60.0 0.0.0.255 area 0 ! dialer-list 1 protocol ip permit
P1C-136
The following example prevents ooding of OSPF LSAs to point-to-multipoint networks to the neighbor at IP address 1.2.3.4:
router ospf 109 neighbor 1.2.3.4 database-filter all out
P1C-138