Quantcast
Channel: CCNP Recertification » Routing
Viewing all articles
Browse latest Browse all 10

OSPF Special Areas, with examples

$
0
0

Earlier I gave a description of OSPF special areas (stubby, not so stubby, totally stubby). Here’s some examples to back it up.

I use dynagen to simulate my environment, it’s so good I ended up selling my routers! Here’s the config:



autostart = false 

[localhost]

    [[7200]]
   image = ..\images\c7200-jk9s-mz.122-40.bin 
   npe = npe-400
    ram = 192
        
    [[ROUTER R1]]
    f0/0 = LAN 1
    
    [[ROUTER R2]]
    f0/0 = LAN 1
    f1/0 = LAN 2

    [[ROUTER R3]]
    f0/0 = LAN 2
    f1/0 = LAN 3

    [[ROUTER R4]]
    f0/0 = LAN 3

That sets up 4 7200 series routers, basically with crossover cables between them. (picture to come).

R1-R2 is area 1
R2-R3 is area 0
R3-R4 is area 2

R1 redistributes 1.1.1.0/24 into OSPF. R4 redistributes 4.4.4.0/24 into OSPF.


R4#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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/10] via 10.0.2.3, 00:00:27, FastEthernet0/0
     4.0.0.0/24 is subnetted, 1 subnets
S       4.4.4.0 is directly connected, Null0
     10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C       10.0.2.0/24 is directly connected, FastEthernet0/0
O IA    10.0.0.0/24 [110/3] via 10.0.2.3, 00:01:24, FastEthernet0/0
O IA    10.0.1.0/24 [110/2] via 10.0.2.3, 00:01:24, FastEthernet0/0
O IA    10.0.33.1/32 [110/4] via 10.0.2.3, 00:01:24, FastEthernet0/0
R4#

In the default OSPF config, the routes from both the backbone and area 1 are seen as O IA routes (interarea), and the redistributed route from R1 is E2 (note how the metric is always 10, no matter how far away it is, that's because it's E2 and not E1).

Area 2 is, topology wise, a stub (ditto R1). Everything has to leave by R3. By filtering the types of routes that make it into area 2 (on the ABR... remember we're in link state land here), the number of routes can be reduced allowing lower end routers to do the same job.

First order of business is to change area 2 into a stub with the "area 2 stub" command on R3 and R4. I had to remove the "redistribute static subnets" on R4 because an ASBR is not allowed within a stub area (more on this later)


r3(config)#router ospf 1
r3(config-router)#area 2 stub

R4(config)#router ospf 1
R4(config-router)#area 2 stub
OSPF: Stub command is invalid when it is ASBR

R4(config-router)#no redistribute static
R4(config-router)#area 2 stub

After OSPF reconverges, R4 has no more external routes. They have been replaced by a default route to an ABR:


R4#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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 10.0.2.3 to network 0.0.0.0

     4.0.0.0/24 is subnetted, 1 subnets
S       4.4.4.0 is directly connected, Null0
     10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C       10.0.2.0/24 is directly connected, FastEthernet0/0
O IA    10.0.0.0/24 [110/3] via 10.0.2.3, 00:00:05, FastEthernet0/0
O IA    10.0.1.0/24 [110/2] via 10.0.2.3, 00:00:05, FastEthernet0/0
O IA    10.0.33.1/32 [110/4] via 10.0.2.3, 00:00:05, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 10.0.2.3, 00:00:05, FastEthernet0/0

And, of course, there are no type 5 LSAs on R4:


R4#show ip ospf database external

            OSPF Router with ID (10.0.2.4) (Process ID 1)

But there are on R3, because it's the one connected to the backbone:


r3#show ip ospf database external

            OSPF Router with ID (10.0.2.3) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 544
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 1.1.1.0 (External Network Number )
  Advertising Router: 10.0.33.1
  LS Seq Number: 80000001
  Checksum: 0x1764
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 10
        Forward Address: 0.0.0.0
        External Route Tag: 0

Looking back at the stub area, there are still a bunch of IntraArea routes (type 3 summary LSAs). At the ABR we can filter those out and rely on the default route.


r3(config)#router ospf 1
r3(config-router)#area 2 stub no-summary

Remember the no-summary means no type 3 summary LSAs, and has nothing to do with summarization of routes!

This has the effect of cleaning up R4's routing table nicely:


R4#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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 10.0.2.3 to network 0.0.0.0

     4.0.0.0/24 is subnetted, 1 subnets
S       4.4.4.0 is directly connected, Null0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.2.0 is directly connected, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 10.0.2.3, 00:01:19, FastEthernet0/0

R4#show ip ospf database summary

            OSPF Router with ID (10.0.2.4) (Process ID 1)

                Summary Net Link States (Area 2)

  Routing Bit Set on this LSA
  LS age: 46
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 0.0.0.0 (summary Network Number)
  Advertising Router: 10.0.2.3
  LS Seq Number: 80000004
  Checksum: 0x31FA
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 1

The only summary route is the default route (0.0.0.0/0) advertised by R3.

This post has sat in draft long enough. I'll do a separate post about not-so-stubby areas, which fix the "no ASBR in stub zones" problem above.

Content Copyright Sean Walberg

OSPF Special Areas, with examples


Viewing all articles
Browse latest Browse all 10

Trending Articles