拓扑如下图:
FR交换机的DLCI配置
初始配置
R1
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 192.168.1.1 0.0.0.0
#
#
interface Serial0/0/0
link-protocol fr
ip address 192.168.1.1 255.255.255.0
#
R2
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 192.168.1.2 0.0.0.0
#
interface Serial0/0/2
link-protocol fr
ip address 192.168.1.2 255.255.255.0
#
R3
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 192.168.1.3 0.0.0.0
#
#
interface Serial0/0/0
link-protocol fr
ip address 192.168.1.3 255.255.255.0
#
配置好接口后,测试R1到R2 ,R3互联接口是通的.两条PVC工作正常
配置好OSPF在R1上查看,发现邻居关系没起来,由于无法通过广播Hello报文的形式动态发现相邻设备,必须手工通过peer命令指定相邻设备的IP地址。
[R1-ospf-1]DIS ospf peer brief
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
----------------------------------------------------------------------------
在R1上手动打领居命令 peer 192.168.1.2,再查看出现ATTEMPT状态。如果R2上不指PEER,120秒后这个状态会变成DOWN
{Attempt:该状态仅发生在NBMA网络中,表明对端在邻居失效时间间隔(dead interval)超时后仍然没有回复Hello报文。此时路由器依然每发送轮询Hello报文的时间间隔(poll interval)向对端发送Hello报文}
[R1-ospf-1]DIS ospf peer brief
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial0/0/0 0.0.0.0 Attempt
----------------------------------------------------------------------------
在R2上指邻居 peer 192.168.1.1 。邻居关系起来并变成邻接FULL状态。同样操作R1与R3
[R1-ospf-1]DIS ospf peer brief
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial0/0/0 2.2.2.2 Full
0.0.0.0 Serial0/0/0 3.3.3.3 Full
----------------------------------------------------------------------------
但是此时查看R1的路由表发现只学到R3的路由,没有R2 2.2.2.2 路由。
<R1>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
3.3.3.3/32 OSPF 10 1562 D 192.168.1.3 Serial0/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.1.0/24 Direct 0 0 D 192.168.1.1 Serial0/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/0
192.168.1.2/32 Direct 0 0 D 192.168.1.2 Serial0/0/0
192.168.1.3/32 Direct 0 0 D 192.168.1.3 Serial0/0/0
<R1>dis ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 192.168.1.1(Serial0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.1.2 BDR: 192.168.1.1 MTU: 0
Dead timer due in 97 sec
Retrans timer interval: 8
Neighbor is up for 00:03:40
Authentication Sequence: [ 0 ]
Router ID: 3.3.3.3 Address: 192.168.1.3
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.1.3 BDR: 192.168.1.1 MTU: 0
Dead timer due in 112 sec
Retrans timer interval: 5
Neighbor is up for 00:03:27
Authentication Sequence: [ 0 ]
原因为R1的ROUD ID 最小于R2与R3.所以在这个网络中R3是DR,在NBMA点到多点网络必须保证HUB节点是DR,通过修改R2,R3,的优先级,并重启ospf进程。
(让R1成为DR,在R1上配置 'peer 192.168.1.2or3 dr-priority 0' dr-priority priority 指定相邻设备的优先级,用于DR选举。 整数形式,取值范围是0~255,缺省值为1。)上面的命令测试在ENSP中失败需要在R2,R3接口下配置 ospf dr-priority 0
<R1>DIS ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 192.168.1.1(Serial0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.1.2
State: Full Mode:Nbr is Master Priority: 0
DR: 192.168.1.1 BDR: None MTU: 0
Dead timer due in 108 sec
Retrans timer interval: 5
Neighbor is up for 00:00:28
Authentication Sequence: [ 0 ]
Router ID: 3.3.3.3 Address: 192.168.1.3
State: Full Mode:Nbr is Master Priority: 0
DR: 192.168.1.1 BDR: None MTU: 0
Dead timer due in 114 sec
Retrans timer interval: 5
Neighbor is up for 00:00:17
Authentication Sequence: [ 0 ]
配置好后,R1,R2,R3的路由表全了。但从R3的PING不通R2。(正常应该有水平分割问题R2,R3间互相的路由应该学习不到。。。。。不知道是不是模拟器的问题)
<R3>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 1562 D 192.168.1.1 Serial0/0/1
2.2.2.2/32 OSPF 10 1562 D 192.168.1.2 Serial0/0/1
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
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.0/24 Direct 0 0 D 192.168.1.3 Serial0/0/1
192.168.1.1/32 Direct 0 0 D 192.168.1.1 Serial0/0/1
192.168.1.3/32 Direct 0 0 D 127.0.0.1 Serial0/0/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=255 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=40 ms
--- 1.1.1.1 ping statistics ---
3 packet(s) transmitted
3 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/26/40 ms
<R3>ping 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Request time out
Request time out
因为不是全互联的帧中继网络中,R3到R2 2.2.2.2 的下一跳192 .168.1.2 是不可达的,解决方法:
1、是建立全互联的帧中继线路,如下图
2、把R1的接口改成子接口,同时可以解决水平分割的问题。(需要重新规划互联网段)
3、手动在R2,R3上用 fr map 把对端的地址指向R1
[R2-Serial0/0/2]DIS THIS
#
interface Serial0/0/2
link-protocol fr
fr map ip 192.168.1.3 201
ip address 192.168.1.2 255.255.255.0
ospf dr-priority 0
#
return
[R3-Serial0/0/1]dis this
#
interface Serial0/0/1
link-protocol fr
fr map ip 192.168.1.2 301
ip address 192.168.1.3 255.255.255.0
ospf dr-priority 0
#
再测试,成功。实验完成。
[R3-Serial0/0/1]ping 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=50 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=60 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=70 ms