4-6 default-information originate always metric-type type

 <  Free Open Study  >  

4-6 default-information originate always metric-type type

Syntax Description:

  • type ” The type can be set to 1 or 2. The cost of a type 1 route includes both the external cost of the redistributed route and the OSPF cost. The cost of a type 2 route only includes the external cost. The default is type 2.

Purpose: When a route is redistributed into OSPF, the route is assigned a metric that represents the cost of reaching that route from the ASBR. In Figure 4-4, the external cost of the default route is 1. This is the value the ASBR would assign to the default route (see Sections 4-3 and 4-4). If the default route is advertised as a type 2 route (the default case), then the cost of the default route should be 1 on every router in the OSPF domain. If the default route is advertised as a type 1 route, then the cost of the default route would include the internal cost of reaching the ASBR and the external cost of the route that was set by the ASBR. If multiple paths exist to reach the ASBR across the OSPF domain, all routes would have an equal cost if advertised as type 2 routes. If the default route is advertised as a type 1 route, then OSPF can determine the best path to the ASBR.

Figure 4-4. When OSPF Advertises a Default Route the Advertising Router Becomes an ASBR. A Type 1 Route Includes Both the Internal and External Cost of Reaching the Route. A Type 2 Route Only Includes the External Cost

graphics/04fig04.gif

Initial Cisco IOS Software Release: 10.0

Configuration Example: Setting the OSPF Metric Type for a Default Route

Configure the routers in Figure 4-4 as shown in the following listing.

 Router A  interface Loopback0   ip address 1.1.1.1 255.255.255.255   !   interface Ethernet0/0   ip address 172.16.1.1 255.255.255.0   !   router ospf 1   network 1.1.1.1 0.0.0.0 area 0   network 172.16.1.0 0.0.0.255 area 0  ________________________________________________________________________________ Router B  interface Loopback0   ip address 2.2.2.2 255.255.255.255   !   interface Ethernet0   ip address 172.16.1.2 255.255.255.0   !   interface Serial1   bandwidth 64   ip address 10.1.1.5 255.255.255.252   clockrate 64000   !   router ospf 1   network 2.2.2.2 0.0.0.0 area 0   network 172.16.1.0 0.0.0.255 area 0  

Verify that Routers A and B have established an OSPF neighbor relationship, as shown here.

 rtrA#  show ip ospf neighbor  Neighbor ID     Pri   State           Dead Time   Address         Interface 2.2.2.2           1   FULL/BDR        00:00:30    172.16.1.2      Ethernet0/0 rtrB#  show ip ospf neighbor  Neighbor ID     Pri   State           Dead Time   Address         Interface 1.1.1.1           1   FULL/DR         00:00:38    172.16.1.1      Ethernet0 

Modify the configuration on Router B so that OSPF will unconditionally advertise a default route into the OSPF domain.

 Router B  router ospf 1   network 2.2.2.2 0.0.0.0 area 0   network 172.16.1.0 0.0.0.255 area 0    default-information originate always   

Verify that the default route is in the IP routing table on Router B.

 rtrB#  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      1.0.0.0/32 is subnetted, 1 subnets O       1.1.1.1 [110/11] via 172.16.1.1, 16:23:59, Ethernet0      2.0.0.0/32 is subnetted, 1 subnets C       2.2.2.2 is directly connected, Loopback0      172.16.0.0/24 is subnetted, 1 subnets C       172.16.1.0 is directly connected, Ethernet0      10.0.0.0/30 is subnetted, 1 subnets C       10.1.1.4 is directly connected, Serial1 

Router B does not have a default route in the IP routing table. Verify that a default route is being advertised to Router A.

 rtrA#  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 172.16.1.2 to network 0.0.0.0  1.0.0.0/32 is subnetted, 1 subnets C       1.1.1.1 is directly connected, Loopback0      2.0.0.0/32 is subnetted, 1 subnets O       2.2.2.2 [110/11] via 172.16.1.2, 00:10:27, Ethernet0/0      172.16.0.0/24 is subnetted, 1 subnets C       172.16.1.0 is directly connected, Ethernet0/0  O*E2 0.0.0.0/0 [110/1] via 172.16.1.2, 00:01:17, Ethernet0/0  rtrA#  show ip route 0.0.0.0  Routing entry for 0.0.0.0/0, supernet   Known via "ospf 1", distance 110,  metric 1  , candidate default path   Tag 1,  type extern 2  , forward metric 10   Redistributing via ospf 1   Last update from 172.16.1.2 on Ethernet0/0, 00:00:09 ago   Routing Descriptor Blocks:   * 172.16.1.2, from 2.2.2.2, 00:00:09 ago, via Ethernet0/0  Route metric is 1  , traffic share count is 1 

Notice that the default cost of the default route is 1 and the route type is type 2 (the default). The type 2 route does not include the cost of reaching the ASBR over the Ethernet link. Modify the configuration on Router B to advertise the default route as a type 1 route.

 Router B  router ospf 1   network 2.2.2.2 0.0.0.0 area 0   network 172.16.1.0 0.0.0.255 area 0    default-information originate always metric-type 1   
Verification

Verify that the metric type of the default route has been modified.

 rtrA#  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 172.16.1.2 to network 0.0.0.0      1.0.0.0/32 is subnetted, 1 subnets C       1.1.1.1 is directly connected, Loopback0      2.0.0.0/32 is subnetted, 1 subnets O       2.2.2.2 [110/11] via 172.16.1.2, 00:02:09, Ethernet0/0      172.16.0.0/24 is subnetted, 1 subnets C       172.16.1.0 is directly connected, Ethernet0/0  O*E1 0.0.0.0/0 [110/11] via 172.16.1.2, 00:00:22, Ethernet0/0  rtrA#  show ip route 0.0.0.0  Routing entry for 0.0.0.0/0, supernet   Known via "ospf 1", distance 110,  metric 11  , candidate default path   Tag 1,  type extern 1  Redistributing via ospf 1   Last update from 172.16.1.2 on Ethernet0/0, 00:00:57 ago   Routing Descriptor Blocks:   * 172.16.1.2, from 2.2.2.2, 00:00:57 ago, via Ethernet0/0  Route metric is 11  , traffic share count is 1 

The cost of the default route now includes the external cost (1) and the internal OSPF cost (10) for a total of 11.

Troubleshooting
Step 1. Verify that there is a neighbor relationship between the OSPF routers using the show ip ospf neighbors command.

Step 2. If using the always form of the command, then this command should work as expected.

Step 3. If you are not using the always form of the command, then verify that the advertising router has a default route in the IP routing table.

 <  Free Open Study  >  


Cisco[r] OSPF Command and Configuration Handbook
Cisco OSPF Command and Configuration Handbook (paperback)
ISBN: 1587055406
EAN: 2147483647
Year: 2002
Pages: 236

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net