wKioL1gWpGDThr6MAAFqhgfOCcI450.jpg

帧中继交换机使用路由器R2进行模拟:
R2:
Router(config)#host FW-sw
FW-sw(config)#frame-relay switching         //开启路由器的帧中继交换功能
FW-sw(config)#int s0/0  
FW-sw(config-if)#encapsulation frame-relay     //在接口封装帧中继协议
FW-sw(config-if)#frame-relay intf-type dce     //指定接口为DCE端
FW-sw(config-if)#frame-relay route 103 interface s0/1 301   //创建路由,dlci 103从s0/1接口到达301
FW-sw(config-if)#frame-relay route 104 interface s0/2 401   //创建路由,dlci 104从s0/2接口到达401

FW-sw(config)#int s0/1
FW-sw(config-if)#encapsulation fram
FW-sw(config-if)#encapsulation frame-relay 
FW-sw(config-if)#frame-relay intf-type dce
FW-sw(config-if)#frame-relay route 301 int s0/0 103   //从s0/1接口进入的dlci 301从s0/0接口到达103
FW-sw(config-if)#no shutdown

FW-sw(config)#int s0/2
FW-sw(config-if)#encapsulation frame-relay 
FW-sw(config-if)#frame-relay intf-type dce
FW-sw(config-if)#frame-relay route 401 int s0/0 104   //从s0/2接口进入的dlci 401从s0/0接口到达104
FW-sw(config-if)#no shutdown

R1:
IP配置过程略
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay 
R1(config-if)#frame-relay map ip 192.168.1.3 103   //创建PVC映射,1.3为对端IP,103为本地DLCI
R1(config-if)#frame-relay map ip 192.168.1.4 104   //创建PVC映射,1.4为对端IP,104为本地DLCI

R3:
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay 
R1(config-if)#frame-relay map ip 192.168.1.1 301

R4:
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay 
R1(config-if)#frame-relay map ip 192.168.1.1 401
(在帧中继网络中,只需保证分支和中心能通信,即R3和R4可以和R1通信,因此到此步时帧中继搭建完毕,可以在R3和R4上ping对端R1的物理口,验证是否能够通信,但是目前三个路由器的回环口还无法通信,因为还未配置OSPF)

R1:
R1(config)#router ospf 1  
R1(config-router)#neighbor 192.168.1.3   //手动指定邻居R3-192.168.1.3
R1(config-router)#neighbor 192.168.1.4   //手动指定邻居R4-192.168.1.4
R1(config-router)#network 192.168.1.0 0.0.0.255 a 0
R1(config-router)#network 10.1.1.0 0.0.0.255 a 0
R1(config-router)#exit

R3:
R3(config)#router ospf 1
R3(config-router)#neighbor 192.168.1.1   //手动指定邻居IP
R3(config-router)#net 192.168.1.0
R3(config-router)#net 10.1.3.0 0.0.0.255 a 0
R3(config)#int s0/0
R3(config-if)#ip ospf priority 0   //将该接口OSPF优先级改为0,该接口将不参与DR/BDR选举

R4:
R4(config)#router ospf 1
R4(config-router)#neighbor 192.168.1.1   //手动指定邻居IP
R4(config-router)#net 192.168.1.0
R4(config-router)#net 10.1.4.0 0.0.0.255 a 0
R4(config)#int s0/0
R4(config-if)#ip ospf priority 0   //将该接口OSPF优先级改为0,该接口将不参与DR/BDR选举


若要配置OSPF在帧中继中的点到多点广播方式,在每个路由器的物理接口上加入下列命令:(以R3为例)
R3(config-if)#frame-relay map ip 192.168.1.1 301 broadcast   //使该接口以广播方式建立PVC
R3(config-if)#ip ospf network point-to-multipoint             //让该接口OSPF以点到多点方式工作