2014-08-10 华为模拟器末梢区域实验

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

末梢区域实例实验:
R1的配置:
ospf 1
import-route rip 1 cost 100
area 0.0.0.0
network 12.0.0.0 0.0.0.255
network 11.11.11.11 0.0.0.0
rip 1
undo summary
version 2
network 1.0.0.0
import-route ospf 1 cost 10
R2的配置:
ospf 1
area 0.0.0.0
network 12.0.0.0 0.0.0.255
network 2.2.2.2 0.0.0.0
area 0.0.0.1
network 22.22.22.22 0.0.0.0
network 23.0.0.0 0.0.0.255
R3的配置:
ospf 1
asbr-summary 192.168.0.0 255.255.252.0 import-route rip 1 cost 100
area 0.0.0.1
network 23.0.0.0 0.0.0.255
network 33.33.33.33 0.0.0.0
rip 1
network 192.168.1.0
network 192.168.2.0
network 192.168.3.0
import-route ospf 1 cost 10
将Area 1配置为Stub区域,查看现象:
配置Stub区域前R3的路由条目:
[R3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------ Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 O_ASE 150 100 D 23.0.0.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 2
3.0.0.2 Ethernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
12.0.0.0/24 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
23.0.0.0/24 Direct 0 0 D 23.0.0.3 Ethernet0/0/0
23.0.0.3/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0 33.33.33.33/32 Direct 0 0 D 127.0.0.1 LoopBack1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack2
192.168.2.1/32 Direct 0 0 D 127.0.0.1 LoopBack3
192.168.3.1/32 Direct 0 0 D 127.0.0.1 LoopBack4
配置Stub区域:
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]stub
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]stub
再看R3的路由表:
[R3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------ Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface 0.0.0.0/0 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 2
3.0.0.2 Ethernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
12.0.0.0/24 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
23.0.0.0/24 Direct 0 0 D 23.0.0.3 Ethernet0/0/0
23.0.0.3/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0 33.33.33.33/32 Direct 0 0 D 127.0.0.1 LoopBack1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack2
192.168.2.1/32 Direct 0 0 D 127.0.0.1 LoopBack3
192.168.3.1/32 Direct 0 0 D 127.0.0.1 LoopBack4
不会学习R1的路由条目。

并产生一条默认路由。

配置完全末梢区域,先查看R3的OSPF路由条目,如下:
[R3]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
OSPF routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 2
3.0.0.2 Ethernet0/0/0
11.11.11.11/32 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
12.0.0.0/24 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
配置完全末梢区域只在ABR上配置stub no-summary,区域内部路由器只配置stub.
[R2-ospf-1-area-0.0.0.1]stub no-summary
再次查看R3的OSPF路由条目,
[R3]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 2 Routes : 2
OSPF routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
只有默认路由和该区域的路由条目。

传播OSPF默认路由:
要从OSPF自治系统内前往外部网络或Internet,可以创建一条前往所有外部网络的静态路由,将路由重分发到OSPF或创建一条默认路由。

这样可以缩小路由表的规模,而且当外部网络出现故障时,不需要重新运算SPF算法。

任何的默认路由都可以创建默认路由,并将其通告给标准区域。

默认情况下,OSPF路由器不会产生默认路由并将其通告到OSPF区域。

要让OSPF生成默认路由,必须使用命令default-route-advertise(Cisco中为命令default-information originate)。

在OSPF重配置default-route-advertise,路由器变为ASBR。

将默认路由通告给标准区域的方式有两种:
1 使用命令default-route-advertise的条件是发出通告的路由器上已经存在了一条默认路由。

(Cisco上的命令为default-information originate)
2 使用命令default-route-advertise always这条命命令不管发送路由器上是否有默认路由,都将通告一条默认路由指向自己。

(Cisco上的命令为default-information originate always)
还是上面的拓扑,在R3上发送一条默认路由。

配置前查看R1和R2的路由器是否有默认路由器。

[R1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 OSPF 10 1 D 12.0.0.2 Ethernet0/0/0
11.11.11.11/32 Direct 0 0 D 127.0.0.1 LoopBack1
12.0.0.0/24 Direct 0 0 D 12.0.0.1 Ethernet0/0/0
12.0.0.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 12.0.0.2 Ethernet0/0/0
23.0.0.0/24 OSPF 10 2 D 12.0.0.2 Ethernet0/0/0
33.33.33.33/32 OSPF 10 2 D 12.0.0.2 Ethernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/22 O_ASE 150 101 D 12.0.0.2 Ethernet0/0/0
[R2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 O_ASE 150 100 D 1
2.0.0.1 Ethernet0/0/0
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 1 D 12.0.0.1 Ethernet0/0/0
12.0.0.0/24 Direct 0 0 D 12.0.0.2 Ethernet0/0/0
12.0.0.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
22.22.22.22/32 Direct 0 0 D 127.0.0.1 LoopBack1
23.0.0.0/24 Direct 0 0 D 23.0.0.2 Ethernet0/0/1
23.0.0.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/1
33.33.33.33/32 OSPF 10 1 D 23.0.0.3 Ethernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/22 O_ASE 150 101 D 23.0.0.3 Ethernet0/0/1
R1和R2上都没有默认路由。

现在在R3上配置OSPF的默认路由通告。

[R3]ospf 1
[R3-ospf-1]default-route-advertise always
再到R1和R2的路由器上看是否有默认路由器
[R2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 23.0.0.3 Ethernet0/0/1
1.1.1.1/32 O_ASE 150 100 D 1
2.0.0.1 Ethernet0/0/0
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 1 D 12.0.0.1 Ethernet0/0/0
12.0.0.0/24 Direct 0 0 D 12.0.0.2 Ethernet0/0/0
12.0.0.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
22.22.22.22/32 Direct 0 0 D 127.0.0.1 LoopBack1
23.0.0.0/24 Direct 0 0 D 23.0.0.2 Ethernet0/0/1
23.0.0.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/1
33.33.33.33/32 OSPF 10 1 D 23.0.0.3 Ethernet0/0/1 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/22 O_ASE 150 101 D 23.0.0.3 Ethernet0/0/1 [R1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 12.0.0.2 Ethernet0/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 OSPF 10 1 D 12.0.0.2 Ethernet0/0/0
11.11.11.11/32 Direct 0 0 D 127.0.0.1 LoopBack1
12.0.0.0/24 Direct 0 0 D 12.0.0.1 Ethernet0/0/0
12.0.0.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 12.0.0.2 Ethernet0/0/0
23.0.0.0/24 OSPF 10 2 D 12.0.0.2 Ethernet0/0/0
33.33.33.33/32 OSPF 10 2 D 12.0.0.2 Ethernet0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/22 O_ASE 150 101 D 12.0.0.2 Ethernet0/0/0
R1和R2学到了默认路由条目。

NSSA区域默认路由的传送:
还是利用上一个实验拓扑,将Area 1配位NSSA区域。

配置命令:[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]nssa
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]nssa
查看R2和R3的路由表:
[R3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_NSSA 150 1 D 23.0.0.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 2
3.0.0.2 Ethernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
12.0.0.0/24 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
23.0.0.0/24 Direct 0 0 D 23.0.0.3 Ethernet0/0/0
23.0.0.3/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
33.33.33.33/32 Direct 0 0 D 127.0.0.1 LoopBack1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack2
192.168.2.1/32 Direct 0 0 D 127.0.0.1 LoopBack3
192.168.3.1/32 Direct 0 0 D 127.0.0.1 LoopBack4
[R2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 O_ASE 150 100 D 1
2.0.0.1 Ethernet0/0/0
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 1 D 12.0.0.1 Ethernet0/0/0
12.0.0.0/24 Direct 0 0 D 12.0.0.2 Ethernet0/0/0
12.0.0.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
22.22.22.22/32 Direct 0 0 D 127.0.0.1 LoopBack1
23.0.0.0/24 Direct 0 0 D 23.0.0.2 Ethernet0/0/1
23.0.0.2/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/1
33.33.33.33/32 OSPF 10 1 D 23.0.0.3 Ethernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/22 O_NSSA 150 101 D 23.0.0.3 Ethernet0/0/1
配置了NSSA区域后,R3将不能学到R1学到的外部路由,并且R3上多了一条只向R2的默认路由,R3想要访问外部路由将走这条默认路由。

用R3 ping 1.1.1.1 如下:
[R3]ping 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=254 time=60 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=70 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=80 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=254 time=70 ms
--- 1.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/68/80 ms
路有走的是默认,所以才能访问外部路由。

在华为中不必配置 nssa default-route-advertise 路由器会自动产生一条只向ABR的默认路由器,这一点与Cisco不同,Cisco必须配置default-information-originate,才能在NSSA区域内产生默认路由条目。

配置完全NSSA区域,部接收其他区域的3 类LSA,华为是在ABR(即R2路由器上)配置,命令如下:
[R2-ospf-1-area-0.0.0.1]nssa default-route-advertise no-summary
配置完全NSSA区域前R3的路由表:
[R3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_NSSA 150 1 D 23.0.0.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 2
3.0.0.2 Ethernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.11.11.11/32 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
12.0.0.0/24 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
23.0.0.0/24 Direct 0 0 D 23.0.0.3 Ethernet0/0/0
23.0.0.3/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
33.33.33.33/32 Direct 0 0 D 127.0.0.1 LoopBack1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack2
192.168.2.1/32 Direct 0 0 D 127.0.0.1 LoopBack3
192.168.3.1/32 Direct 0 0 D 127.0.0.1 LoopBack4
R3还学习到了ABR发送的3 类LSA,配置完完全NSSA区域后,在查看R3的路由表:[R3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 OSPF 10 2 D 23.0.0.2 Ethernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
22.22.22.22/32 OSPF 10 1 D 23.0.0.2 Ethernet0/0/0
23.0.0.0/24 Direct 0 0 D 23.0.0.3 Ethernet0/0/0 23.0.0.3/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0 33.33.33.33/32 Direct 0 0 D 127.0.0.1 LoopBack1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack2
192.168.2.1/32 Direct 0 0 D 127.0.0.1 LoopBack3
192.168.3.1/32 Direct 0 0 D 127.0.0.1 LoopBack4
R3上没有了ABR的3 类LSA。

相关文档
最新文档