OSPF实验过程详解(OSPF在NBMA上实现法)
转:OSPF实验过程详解(OSPF在NBMA上实现法)[table][tr][td][img]http://hiphotos.baidu.com/liyunhuipc/pic/item/b5f72f7b112937f60ad187e2.jpg[/img]
[b]实验环境说明:[/b]
1.将路由器R5的Fa0/0端口的ip设为:192.168.4.5/24;S1/1端口的ip设为:192.168.3.5/24
2.将路由器R1的 S1/1端口的ip设为:192.168.3.1/24;S1/2端口的ip设为:192.168.2.1/24
3.将路由器R2的S1/2端口的ip设为:192.168.2.2/24;Fa0/0端口的ip设为:192.168.1.2/24
[b]前言:[/b]我们都知道,OSPF的网络类型有:广播型(也称多路访问)、点到点、点到多点、非广播多路访问(NBMA),除了非广播型多点访问类型以外的其它类型都会自动选择DR和BDR,这样才会形成邻居,它们之间才可以互相通信。而我们今天要演示的OSPF在NBMA中的实现,就是要克服这种非广播型多路访问中无法自动选出DR和BDR而无法发现邻居。没有邻居的路由器之间是无法通信的。我们的解决思路主要有:1、手工为相应的端口指定邻居;2、改变相应端口的网络类型。下面请看我们的详细配置过程:
[b]配置过程清单:[/b]
[color=#0000ff]交换机SW1的配置:
[/color]分别将Fa1/11、Fa1/14端口设置为全双工模式:
SW1(config)#int fa1/11
SW1(config-if)#speed 100
SW1(config-if)#duplex full
SW1(config-if)#no shut
SW1(config-if)#exit
SW1(config)#int fa1/14
SW1(config-if)#speed 100
SW1(config-if)#duplex full
SW1(config-if)#no shut
SW1(config-if)#exit
[color=#0000ff]路由器R2的配置清单:
[/color][b]1、分别为路由器R2的S1/2、Fa0/0端口设置iP:
[/b]R2(config)#int s1/2
R2(config-if)#ip add 192.168.2.2 255.255.255.0
R2(config-if)#no shut
R2(config)#int fa0/0
R2(config-if)#speed 100
R2(config-if)#duplex full
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
[b]2、在路由器R2上配置OSPF:[/b]
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network
R2(config-router)#network 192.168.2.2 0.0.0.0 a 0
R2(config-router)#network 192.168.1.2 0.0.0.0 a 0
R2(config-router)#exit
[color=#0000ff]路由器R1的配置清单:[/color]
[b]1、为路由器R1的S1/1端口设置ip并封装桢中继:[/b]
R1(config)#int s1/1
R1(config-if)#ip add 192.168.3.1 255.255.255.0
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay map ip 192.168.3.5 105 br
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#no shut
[b]2、为路由器R1的S1/2端口设置ip:[/b]
R1(config)#int s1/2
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#no shut
[b]3、在路由器R1上配置OSPF:[/b]
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.3.1 0.0.0.0 a 0
R1(config-router)#network 192.168.2.1 0.0.0.0 a 0
R1(config-router)#exit
[color=#0000ff]路由器R5的配置清单:[/color]
[b]1、为路由器R5的S1/1端口配置ip并封装桢中继:[/b]
R5(config)#int s1/1
R5(config-if)#ip add 192.168.3.5 255.255.255.0
R5(config-if)#encapsulation frame-relay
R5(config-if)#frame-relay map ip 192.168.3.1 501 br
R5(config-if)#no frame-relay inverse-arp
R5(config-if)#no shut
R5(config-if)#exit
[b]2、为路由器R5的Fa0/0端口配置ip并设为全双工模式:[/b]
R5(config)#int fa0/0
R5(config-if)#speed 100
R5(config-if)#duplex full
R5(config-if)#ip add 192.168.4.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#exit
[b]3、在路由器R5上配置OSPF:[/b]
R5(config)#router ospf 100
R5(config-router)#router-id 5.5.5.5
R5(config-router)#network 192.168.4.5 0.0.0.0 a 0
R5(config-router)#network 192.168.3.5 0.0.0.0 a 0
R5(config-router)#exit
[color=#ff0000]以上为正常的配置过程,如果我们来通过#show ip ospf nei命令来看看R1、R5的邻居表,你会发现它们的邻居表中根本没有对方,也就是说,它们之间根本没有发现邻居,这时它们之间是无法互相通信。在前面我们已经说过,非广播型多路访问是不会自动选出DR和BDR的,需要我们手工来指定。这时我们就有了两种思路:1改变R1 、R5之间的网络类型,将它们改变为点对多点(point-to-mu);2、手工为它们指定邻居。请看下面的配置,这就是关键所在:[/color]
[b][color=#0000ff]A:改变[/color][url=http://www.ciscotech.org/][color=#0000ff]网络[/color][/url][color=#0000ff]类型实现OSPF在桢中继可以发现邻居:[/color][/b]
[b]1、改变R1的S1/1的网络类型为“点对多点”:[/b]
R1(config)#int s1/1
R1(config-if)#ip ospf network point-to-mu
R1(config-if)#no shut
[b]2、改变R5的S1/1的网络类型为“点对多点”:[/b]
R5(config)#int s1/1
R5(config-if)#ip ospf network point-to-mu
R5(config-if)#no shut
[b]这时,我们使用#show ip ospf nei命令来查看R1的邻居表:
[/b]R1#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
5.5.5.5 0 FULL/ - 00:01:47 192.168.3.5 Serial1/1
2.2.2.2 0 FULL/ - 00:00:33 192.168.2.2 Serial1/2
[b]看到了吧,路由器R1的邻居表里面已经有了R5和R2,这时,我们再用ping命令来验证一下,我们用R1来pingR5:[/b]
R1#ping 192.168.4.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/73/112 ms
[b]成功了!同样的道理,R5我们就不再验证了,您看明白了吗?[/b]
[b][color=#0000ff]B:手工为R1、R5指定邻居:(//后面为注释) [/color]
[/b]R1(config)#router ospf 100
R1(config)#nei 192.168.3.5 //指定R5是R1的邻居,这里写对方的ip
R5(config)#router ospf 100 R5(config)#nei 192.168.3.1 //指定R1是R5的邻居,这里写对方的ip
[/td][/tr][/table] dddddddddddddddddddddddddddddddddddd wqewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ddddddddddddddddddddd
页:
[1]