1.1 实验任务<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

配置多区域的OSPF、配置Stub区域和配置Totally Stubby区域

 

1.2 实验环境和网络拓扑

 

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

 

1.3 完成标准

完成Loopback地址配置、多区域的OSPF配置、Stub区域配置和Totally Stubby区域配置,验证所有配置。

 

 

2.详细操作步骤

 

Step 1: 配置多区域的OSPFStub区域和Totally Stub区域

 

路由器SH1配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho SH1
SH1(config)#interface f0/0
SH1(config-if)#ip address 192.168.1.1 255.255.255.0               //配置接口F0/0 IP地址

SH1(config-if)#no shut
SH1(config-if)#exit
*Dec  7 09:11:48.431: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec  7 09:11:49.431: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
SH1(config)#interface loopback 0
SH1(config-if)#ip address 192.168.64.1 255.255.255.0                    //配置Loopback地址

SH1(config-if)#exit
SH1(config)#exit
SH1#
*Dec  7 09:12:23.979: %SYS-5-CONFIG_I: Configured from console by console
SH1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
SH1(config)#router ospf 10                                                    //配置进程为10OSPF

SH1(config-router)#network 192.168.1.0 <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0.0.0.255 area 0        //宣告的主干区网段

SH1(config-router)#network 192.168.64.0 0.0.0.255 area 1              //宣告的1区网段

SH1(config-router)#area 1 stub no-summary                                   //配置1区为完全末梢网络

SH1(config-router)#exit
SH1(config)#exit

 

路由器BJ1配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho BJ1
BJ1(config)#interface f0/0                                                     //配置接口F0/0 IP地址

BJ1(config-if)#ip address 192.168.1.3 255.255.255.0
BJ1(config-if)#no shut
*Dec  7 09:13:49.959: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec  7 09:13:50.959: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
BJ1(config-if)#interface f1/1                                                  //配置接口F1/1 IP地址
BJ1(config-if)#ip address 192.169.224.1 255.255.255.252
BJ1(config-if)#no shut
BJ1(config-if)#exit
BJ1(config)#
*Dec  7 09:14:25.519: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Dec  7 09:14:26.519: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
BJ1(config)#interface loopback 0                                            //配置Loopback地址

BJ1(config-if)#ip address 192.168.3.1 255.255.255.0
BJ1(config-if)#exit
BJ1(config)#exit
BJ1(config)#router ospf 20                                                    //配置进程为20OSPF
BJ1(config-router)#network 192.168.1.0 0.0.0.255 area 0         //宣告的主干区网段
BJ1(config-router)#network 192.168.224.0 0.0.0.3 area 51              //宣告的51区网段
*Dec  7 09:20:03.495: %OSPF-5-ADJCHG: Process 20, Nbr 192.168.64.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
//进程20,在接口F0/0上编号192.168.64.1从加载到完全状态,加载完成

BJ1(config-router)#network 192.168.3.0 0.0.0.255 area 0         //宣告的主干区网段
BJ1(config-router)#area 51 stub                                              //配置51区为末梢区域

BJ1(config-router)#exit
BJ1(config)#exit

 

路由器GZ1配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho GZ1
GZ1(config)#interface f1/1                                                     //配置接口F1/1 IP地址
GZ1(config-if)#ip address 192.168.224.2 255.255.255.252
GZ1(config-if)#no shut
*Dec  7 09:16:28.907: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Dec  7 09:16:29.907: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
GZ1(config-if)#exit
GZ1(config)#exit
*Dec  7 09:16:35.955: %SYS-5-CONFIG_I: Configured from console by console
GZ1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
GZ1(config)#router ospf 30                                                    //配置进程为30OSPF
GZ1(config-router)#network 192.168.224.0 0.0.0.3 area 51              //宣告的51区网段
GZ1(config-router)#area 51 stub                                             //配置51区为末梢区域

GZ1(config-router)#exit
GZ1(config)#exit

 

 

Step 2: 验证所有配置

 

路由器SH1配置如下:
SH1#show ip route                                                                //显示路有信息

Codes: C - connected, S - static, 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
       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

 

C    192.168.64.0/24 is directly connected, Loopback0
//连接 192.168.64.0/24网段直连,Loopback0

C    192.168.1.0/24 is directly connected, FastEthernet0/0
//连接 192.168.1.0/24网段直连,接口F0/0

     192.168.3.0/32 is subnetted, 1 subnets
     //192.168.3.0/24被划为子网,1个子网

O       192.168.3.1 [110/2] via 192.168.1.3, 00:02:38, FastEthernet0/0
//OSPF路由192.168.3.1[路径110/代价2]通过192.168.1.3 238秒,F0/0

SH1#show ip ospf                                                                 //显示OSPF信息

 Routing Process "ospf 10" with ID 192.168.64.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 It is an area border router
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 2. 1 normal 1 stub 0 nssa
 //在这个路由器上的区域数量21个标准区1个末梢区0NSSA

 External flood list length 0
    Area BACKBONE(0)                                                     //区域主干(0)

        Number of interfaces in this area is 1
              //在这个区域上的接口数量1

        Area has no authentication
        SPF algorithm last executed 00:07:01.184 ago
        SPF algorithm executed 7 times
        Area ranges are
        Number of LSA 4. Checksum Sum 0x0149AB
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 1
        Number of interfaces in this area is 1 (1 loopback)
              //在这个区域上的接口数量2(1Loopback)

        It is a stub area, no summary LSA in this area
              //这是一个完全末梢区域,在此区域中没有链路数据通告汇总

          generates stub default route with cost 1
                //生成的默认末梢路由代价为1

        Area has no authentication
        SPF algorithm last executed 00:08:57.132 ago
        SPF algorithm executed 3 times                                //最短路径优先算法执行3

        Area ranges are
        Number of LSA 2. Checksum Sum 0x016063
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

 

路由器BJ1配置如下:
BJ1#show ip route
Codes: C - connected, S - static, 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
       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

 

     192.169.224.0/30 is subnetted, 1 subnets
C       192.169.224.0 is directly connected, FastEthernet1/1
//连接 192.168.224.0网段直连,接口F1/1

     192.168.64.0/32 is subnetted, 1 subnets
     //192.168.64.0/32被划为子网,1个子网

O IA    192.168.64.1 [110/2] via 192.168.1.1, 00:02:38, FastEthernet0/0
//OSPF路由 区域内 192.168.64.1[路径110/代价2]通过192.168.1.1 238 F0/0

C    192.168.1.0/24 is directly connected, FastEthernet0/0
//连接 192.168.1.0/24网段直连,接口F0/0

C    192.168.3.0/24 is directly connected, Loopback0
//连接 192.168.3.0/24网段直连,Loopback0

 

BJ1#show ip ospf                                                                  //显示OSPF信息
 Routing Process "ospf 20" with ID 192.168.3.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 2. 1 normal 1 stub 0 nssa
 //在这个路由器上的区域数量21个标准区1个末梢区0NSSA

 External flood list length 0                                                   //外部泛洪列表长度0

    Area BACKBONE(0)                                                     //区域 主干区(0)

        Number of interfaces in this area is 2 (1 loopback)
              //在这个区域上的接口数量2(1Loopback)

        Area has no authentication                                        //区域没有授权

        SPF algorithm last executed 00:06:13.172 ago
              //最短路径有限算法最后执行 613.172秒以前

        SPF algorithm executed 5 times                                //最短路径优先算法共执行5

        Area ranges are                                                       //区域范围

        Number of LSA 4. Checksum Sum 0x0149AB
              //链路状态信息数量4,总合检查 综合0x0149AB

        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 51
        Number of interfaces in this area is 0                         //在此区域上的接口数量0

        It is a stub area                                                        //这是一个末梢区域

        Area has no authentication
        SPF algorithm last executed 00:06:27.660 ago
        SPF algorithm executed 2 times                                //最短路径优先算法共执行2

        Area ranges are
        Number of LSA 1. Checksum Sum 0x0099CE
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

 

路由器GZ1配置如下:
GZ1#show ip route                                                                //显示路由信息

Codes: C - connected, S - static, 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
       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

 

     192.168.224.0/30 is subnetted, 1 subnets
     //192.168.224.0/30网段被划为子网,1个子网

C       192.168.224.0 is directly connected, FastEthernet1/1
//连接 192.168.224.0网段直连,接口F1/1

 

GZ1#show interfaces f1/1                                                       //查看借口F1/1状态

FastEthernet1/1 is up, line protocol is up
  Hardware is i82543 (Livengood), address is ca00.12b0.001d (bia ca00.12b0.001d)

 

  Internet address is 192.168.224.2/30
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  //封装类型 ARPA,没有设置loopbcak

  Keepalive set (10 sec)
  Full-duplex, 100Mb/s, 100BaseTX/FX
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:05, output 00:00:01, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     59 packets input, 5639 bytes
     Received 9 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog
     0 input packets with dribble condition detected
     78 packets output, 8220 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
GZ1#show ip ospf                                                                 //查看OSPF信息

 Routing Process "ospf 30" with ID 192.168.224.2
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 1. 0 normal 1 stub 0 nssa
 //在这个路由器上的区域总数10个标准区1个末梢区0NSSA

 External flood list length 0
    Area 51                                                                         //区域 51

        Number of interfaces in this area is 1                         //在此区域上的接口数量1

        It is a stub area                                                        //这是个末梢区域

        Area has no authentication
        SPF algorithm last executed 00:03:49.620 ago
        SPF algorithm executed 2 times                                //最短路径优先算法共执行2

        Area ranges are
        Number of LSA 1. Checksum Sum 0x0095BC
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0

 

 

3.实验总结

       生成OSPF多区域可改善网络的可扩展性,加速收敛。而分层路由降低了SPF运算的频率,减小了路由表,也减小了链路状态更新报文(LSU)的流量。此实验简单描述了OSPF多区域配置,要点如下:
l         区域分类为:骨干区域Area 0、标准区域、末梢区域(Stu)、完全末梢区域(Totally Stubby)和非纯末梢区域(NSSA)
l         OSPF链路状态通告共6类:1类为路由器LSA2类为网络LSA3类为网络汇总LSA4类为ASBR汇总LSA5类为AS外部LSA7类为NSSA外部LSA
l         共有4类路径类型,分别为:区域内路径(Intra-area path);区域间路径(Inter-area path);类型1的外部路径(Type 1 external path, E1);类型2的外部路径(Type 2 external path, E2)