拓朴:

 

 

ip配置如下,本实验只用R1 R2和R3:

 

宣告网络:

R1

ospf 1

 area 0.0.0.1

  network 192.168.1.0 0.0.0.255

  network 172.16.0.0 0.0.255.255

 

R2

ospf 1

 area 0.0.0.0

  network 192.168.2.0 0.0.0.255

 area 0.0.0.1

  network 192.168.1.0 0.0.0.255

测试结果:

[RT1]ping -c 1 -a 172.16.0.1 10.10.0.1

  PING10.10.0.1: 56  data bytes, press CTRL_C to break

    Reply from 10.10.0.1: bytes=56 Sequence=1 ttl=254 time=4 ms

--- 10.10.0.1 ping statistics ---

    1 packet(s) transmitted

    1 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 4/4/4 ms

 

[RT1]

 

路由汇总R1R3lo(R2上做)
ospf 1

 area 0.0.0.0

  abr-summary 10.10.0.0 255.255.248.0

  network 192.168.2.0 0.0.0.255

 area 0.0.0.1

  abr-summary 172.16.0.0 255.255.248.0

  network 192.168.1.0 0.0.0.255

汇总结果:

<RT3>display ip routing-table

Routing Tables: Public

        Destinations : 22       Routes : 22

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

10.10.0.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.1.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.2.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.3.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.4.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.5.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.6.1/32        Direct 0    0            127.0.0.1       InLoop0

10.10.7.1/32        Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

172.16.0.0/21       OSPF   10   3124         192.168.2.1     S0/2/0

192.168.1.0/24      OSPF   10   3124         192.168.2.1     S0/2/0

192.168.2.0/24      Direct 0    0            192.168.2.2     S0/2/0

&hellip;&hellip;省略
实现验证:

在接口下:

[RT2-Serial0/2/0]ospf authentication-mode hmac-md5 1 cipher 123

在区域下:

[RT2-ospf-1-area-0.0.0.1]authentication-mode md5

[RT2-ospf-1-area-0.0.0.1]

整个区域都要做

%Oct 18 13:06:18:766 2010 RT2 RM/3/RMLOG:OSPF-NBRCHANGE: Process 1, Neighbor 192

.168.1.1(Serial0/2/0) from Loading to Full

 

 

相关display命令
<RT3>display ospf interface

<RT3>display ospf cumulative

<RT3>display ospf brief

<RT3>display ospf peer

 

 

 

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:OSPF 1: SEND Packet.

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Source Address: 192.168.1.1

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Destination Address: 224.0.0.5

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Ver# 2, Type: 1, Length: 48.

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Router: 1.1.1.1, Area: 0.0.0.1, Check

sum: 0.

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:AuType: 02, Key(ascii): 0 0 1 10 0 0

0 48.

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Net Mask: 255.255.255.0, Hello Int: 1

0, Option: _E_.

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Rtr Priority: 1, Dead Int: 40, DR: 0.

0.0.0, BDR: 0.0.0.0.

*Oct 18 13:14:18:219 2010 RT1 RM/6/RMDEBUG:Attached Neighbor: 2.2.2.2.

 

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:OSPF 1: RECV Packet.

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Source Address: 192.168.1.2

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Destination Address: 224.0.0.5

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Ver# 2, Type: 1, Length: 48.

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Router: 2.2.2.2, Area: 0.0.0.1, Check

sum: 0.

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:AuType: 02, Key(ascii): 0 0 1 10 0 0

0 39.

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Net Mask: 255.255.255.0, Hello Int: 1

0, Option: _E_.

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Rtr Priority: 1, Dead Int: 40, DR: 0.

0.0.0, BDR: 0.0.0.0.

*Oct 18 13:14:18:234 2010 RT1 RM/6/RMDEBUG:Attached Neighbor: 1.1.1.1.