OSPF的NSSA区域

  • Post author:
  • Post category:其他

 

1、 OSPF的NSSA区域

 

a、 不完全存根区域,能学习本区域连接的外部路由,能学习域间路由,不能学习其它区域的外部路由

b、 含有ASBR路由器的stub区域

c、 配置命令:area 区域号 nssa

 

思考:一般末节区域的路由器都是性能不是很好的,但是现在又不得不加入外网路由,没有办法,使用了NSSA区域,NSSA说白了就是不那么末节的区域,总而言之,NSSA区域就是拓扑设计的一个补救措施,本应是stub区域的,但是现在又不得以连上一个外部网络,而且是绝对NSSA区域,那么就禁止了3,4类lsa,所以就会自动推一个3类的默认路由,让去往域内的路由都匹配这个默认路由。

R1配置

en
conf t
hostname R1
 
int loopback 0
ip address 1.1.1.1 255.255.255.0
no shutdown
exit
 
int f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
 
router ospf 1
network 1.1.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
exit
end

 

R2配置

 

en
conf t
hostname R2
 
int loopback 0
ip address 2.2.2.2 255.255.255.0
no shutdown
exit
 
int f0/0
ip address 192.168.1.2 255.255.255.0
no shutdown
exit
 
int f0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
 
router ospf 1
network 2.2.2.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 1
area 1 nssa
exit
end

 

 

 

 

R3配置

en
conf t
hostname R3
 
int loopback 0
ip address 3.3.3.3 255.255.255.0
no shutdown
exit
 
int f0/1
ip address 192.168.2.2 255.255.255.0
no shutdown
exit
 
int f0/0
ip address 202.168.1.1 255.255.255.0
no shutdown
exit
 
router ospf 1
network 192.168.2.0 0.0.0.255 area 1
network 3.3.3.0 0.0.0.255 area 1
area 1 nssa
redistribute static metric-type 1 subnets
exit
 
ip route 4.4.4.0 255.255.255.0 f0/0
 
end

 

 

 

R4配置

en
conf t
hostname R4
 
int f0/0
ip address 202.168.1.2 255.255.255.0
no shutdown
exit
 
int loopback 0
ip address 4.4.4.4 255.255.255.0
no shutdown
exit
 
ip route 0.0.0.0 0.0.0.0 f0/0
end

 

 

 

 

 

 

 

R2#show ip ospf database

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

 

                Router Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

2.2.2.2         2.2.2.2         67          0x80000004 0x00410e 2

1.1.1.1         1.1.1.1         67          0x80000003 0x00500e 2

 

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.1.2     2.2.2.2         67          0x80000001 0x00741f

 

                Summary Net Link States (Area0)

Link ID         ADV Router      Age        Seq#       Checksum

192.168.2.0     2.2.2.2         47          0x80000001 0x008f5b

3.3.3.3         2.2.2.2         47          0x80000003 0x00d274

 

                Summary ASB Link States (Area0)

Link ID         ADV Router      Age        Seq#       Checksum

2.2.2.2         2.2.2.2         2           0x8000000e 0x009b90

 

                Router Link States (Area 1)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

2.2.2.2         2.2.2.2         55          0x80000002 0x005d0c 1

3.3.3.3         3.3.3.3         55          0x80000004 0x00a29d 2

 

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.2.2     3.3.3.3         55          0x80000001 0x007f07

 

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.1.0     2.2.2.2         47          0x80000001 0x009a51

2.2.2.2         2.2.2.2         47          0x80000002 0x00f854

1.1.1.1         2.2.2.2         47          0x80000003 0x002f20

 

                Type-7 AS External Link States(Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Tag

4.4.4.0         3.3.3.3         50          0x80000001 0x000fa0 0

 

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag

4.4.4.0         2.2.2.2         50          0x80000001 0x00dfdf 0

R2#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 – OSPFexternal type 2, E – EGP

       i – IS-IS, 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/32 is subnetted, 1 subnets

O      1.1.1.1 [110/2] via 192.168.1.1, 00:01:10, FastEthernet0/0

    2.0.0.0/24 is subnetted, 1 subnets

C      2.2.2.0 is directly connected, Loopback0

    3.0.0.0/32 is subnetted, 1 subnets

O      3.3.3.3 [110/2] via 192.168.2.2, 00:00:55, FastEthernet0/1

    4.0.0.0/24 is subnetted, 1 subnets

O N1   4.4.4.0 [110/21] via 192.168.2.2, 00:00:55, FastEthernet0/1

C   192.168.1.0/24 is directly connected, FastEthernet0/0

C   192.168.2.0/24 is directly connected, FastEthernet0/1

 

 

 

 

解释:不完全存根区域NSSA外部路由为LSA7因为存根区域不能存在LSA5,发送到主干区域时,边界路由器转换为LSA5发送到各区域(除存根区域)。

 

 

 

 

 

 

R3#show ip ospf database

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

 

                Router Link States (Area 1)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

3.3.3.3         3.3.3.3         25          0x80000004 0x00a29d 2

2.2.2.2         2.2.2.2         25         0x80000002 0x005d0c 1

 

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.2.2     3.3.3.3         25          0x80000001 0x007f07

 

                Summary Net Link States (Area1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.1.0     2.2.2.2         17          0x80000001 0x009a51

2.2.2.2         2.2.2.2         17          0x80000002 0x00f854

1.1.1.1         2.2.2.2         17          0x80000003 0x002f20

 

               Type-7 AS External LinkStates (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Tag

4.4.4.0         3.3.3.3         20          0x80000001 0x000fa0 0

R3#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 – OSPFexternal type 2, E – EGP

       i – IS-IS, 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/32 is subnetted, 1 subnets

O IA   1.1.1.1 [110/3] via 192.168.2.1, 00:01:14, FastEthernet0/1

    2.0.0.0/32 is subnetted, 1 subnets

O IA   2.2.2.2 [110/2] via 192.168.2.1, 00:01:14, FastEthernet0/1

    3.0.0.0/24 is subnetted, 1 subnets

C      3.3.3.0 is directly connected, Loopback0

    4.0.0.0/24 is subnetted, 1 subnets

S      4.4.4.0 is directly connected, FastEthernet0/0

O IA 192.168.1.0/24 [110/2] via192.168.2.1, 00:01:14, FastEthernet0/1

C   192.168.2.0/24 is directly connected, FastEthernet0/1

C   202.168.1.0/24 is directly connected, FastEthernet0/0

 

 

 

解释:OIA域间路由,不完全存根区域能接受域间路由,但不接受其他区域的外部路由(本实验其他区域没有设置外部路由,只有本区域有外部路由)。


版权声明:本文为u011857683原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。