天下网吧 >> 网吧天地 >> 网吧技术 >> 网吧网络 >> 正文

路由器配置成帧中继交换机

2012-11-24abc16810 的BLOGdelete

  Router(config)#frame-relay switching把路由器模拟成帧中继交换机

  Router(config)#inter s1/1

  Router(config-if)#clock rate 128000

  Router(config-if)#encapsulation frame-relay 配置接口封装帧中继

  接口上启用的默认帧中继封装为Cisco封装,如果连接到非思科路由器,要使用itef参数

  Router(config-if)#no shu

  Router(config)#inter s1/2

  Router(config-if)#clo rate 128000

  Router(config-if)#encapsulation fr

  Router(config-if)#no shu

  changed state to upnointer s1/3

  Router(config-if)#clo rate 128000

  Router(config-if)#encapsulation fr

  Router(config-if)#no shu

  Router(config)#inter s1/1

  Router(config-if)#frame-relay lmi-type cisco 配置LMI类型

  Router(config-if)#frame-relay intf-type dce 配置接口为帧中继的DCE

  Router(config-if)#inter s1/2

  Router(config-if)#frame-relay lmi-type cisco

  Router(config-if)#frame-relay intf-type dce

  Router(config-if)#inter s1/3

  Router(config-if)#frame-relay lmi-type cisco

  Router(config-if)#frame-relay intf-type dce

  配置路由器两个接口之间的pvc

  Router(config)#inter s1/1

  Router(config-if)#frame-relay route 103 inter s1/2 301

  Router(config-if)#frame-relay route 104 inter s1/3 401

  Router(config-if)#exit

  Router(config)#inter s1/2

  Router(config-if)#frame-relay route 301 inter s1/1 103

  Router(config-if)#frame-relay route 304 inter s1/3 403

  Router(config-if)#exit

  Router(config)#inter s1/3

  Router(config-if)#frame-relay route 401 inter s1/1 104

  Router(config-if)#frame-relay route 403 inter s1/2 304

  Router(config-if)#

  Router#show frame-relay route

  Input IntfInput DlciOutput Intf Output Dlci Status

  Serial1/1 103 Serial1/2 301 active

  Serial1/1 104 Serial1/3 401 active

  Serial1/2 301 Serial1/1 103 active

  Serial1/2 304 Serial1/3 403 active

  Serial1/3 401 Serial1/1 104 active

  Serial1/3 403 Serial1/2 304 active

  表明路由器R2上配置3条PVC 状态都是活动的

  R1的配置

  Router(config)#inter s1/1

  Router(config-if)#ip address 172.16.134.1 255.255.255.0

  Router(config-if)#encapsulation fr 接口封装帧中继

  Router(config-if)#frame-relay lmi-type cisco

  Router(config)#inter fa0/0

  Router(config-if)#ip add

  Router(config-if)#ip address 192.168.1.1 255.255.255.0

  Router(config-if)#no shu

  如果采用Cisco路由器的IOS是11.2及以后的版本,路由器可以自动协商LMI是类型

  所以可以不配

  Router(config)#router rip

  Router(config-router)#ver 2

  Router(config-router)#no auto-summary

  Router(config-router)#network 172.16.134.0

  Router(config-router)#network 192.168.1.0

  Router(config-router)#exit

  R3和R4同R1

  ping测试

  Router#ping 172.16.134.1 source 192.168.4.1

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 172.16.134.1, timeout is 2 seconds:

  Packet sent with a source address of 192.168.4.1

  !!!!!

  Success rate is 100 percent (5/5), round-trip min/avg/max = 120/155/200 ms

 

  查看帧中继的映射

  Router#show frame-relay map

  Serial1/1 (up): ip 172.16.134.3 dlci 103(0x67,0x1870), dynamic,

  broadcast,, status defined, active

  Serial1/1 (up): ip 172.16.134.4 dlci 104(0x68,0x1880), dynamic,

  broadcast,, status defined, active

  以上输出显示了逆向ARP的作用结果 表明路由器R1每个封装帧中继的接口都包含2条处于活动状态的DLCI,每条都显示了远程Ip地址与本地的DLCI的映射关系

  broadcast“参数允许在PVC上传输广播或组播流量 “dynamic 表明动态映射

  每台路由器都不能ping通自己的串行接口的ip地址,但是可以ping通远程封装帧中继的串行接口的ip地址 是因为自己的帧中继映射表中没有自己的接口ip地址和DLCI的映射条目。 逆向ARP做动态映射解决不了该问题,只能通过静态映射解决

  Router#show ip route rip

  R192.168.4.0/24 [120/1] via 172.16.134.4, 00:00:07, Serial1/1

  R192.168.3.0/24 [120/1] via 172.16.134.3, 00:00:27, Serial1/1

  Router#show ip route rip

  R192.168.4.0/24 [120/1] via 172.16.134.4, 00:00:00, Serial1/2

  R192.168.1.0/24 [120/1] via 172.16.134.1, 00:00:05, Serial1/2

  Router#show ip route rip

  R192.168.1.0/24 [120/1] via 172.16.134.1, 00:00:18, Serial1/3

  R192.168.3.0/24 [120/1] via 172.16.134.3, 00:00:27, Serial1/3

  在本实验中,帧中继交换机在路由器R2上采用了PVC全互连的拓扑结构

  但是在实际应用中,为了节省费用,一般采用(中心--分支)的拓扑结构

  即只有分支到中心的PVC,假如R1是中心路由 R2和R3是分支路由

  在R2上是配置如下

  Router(config)#inter s1/2

  Router(config-if)#no frame-relay route 304 interface s1/3 403

  Router(config-if)#inter s1/3

  Router(config-if)#no frame-relay route 403 interface s1/2 304

  在R3和R4上

  Router#show frame-relay map

  Serial1/2 (up): ip 172.16.134.1 dlci 301(0x12D,0x48D0), dynamic,

  broadcast,, status defined, active

  Router#show frame-relay map

  Serial1/3 (up): ip 172.16.134.1 dlci 401(0x191,0x6410), dynamic,

  broadcast,, status defined, active

  可以看到R3和R4上只有一条到中心站点路由器R1的映射

  R4和R3的网络不可达

  R1

  配置帧中继的静态映射

  Router(config)#inter s1/1

  Router(config-if)#no frame-relay inverse-arp

  关闭逆向ARP ,默认是开启的

  Router(config-if)#frame-relay map ip 172.16.134.3 103 broadcast

  配置帧中继静态映射

  Router(config-if)#frame-relay map ip 172.16.134.4 104 broadcast

  Router(config-if)#frame-relay map ip 172.16.134.1 104 broadcast

  配置自己接口的ip地址的映射,目的是允许ping路由器该接口的ip地址

  R3

  Router(config)#inter s1/2

  Router(config-if)#no frame-relay inverse-arp

  Router(config-if)#frame-relay map ip 172.16.134.1 301 broadcast

  Router(config-if)#frame-relay map ip 172.16.134.4 304 broadcast

  Router(config-if)#frame-relay map ip 172.16.134.3 301 broadcast

  R4

  Router(config)#inter s1/3

  Router(config-if)#no frame-relay inverse-arp

  Router(config-if)#frame-relay map ip 172.16.134.1 401 broadcast

  Router(config-if)#frame-relay map ip 172.16.134.3 403 broadcast

  Router(config-if)#frame-relay map ip 172.16.134.4 401 broadcast

  R1#show frame-relay map

  Serial1/1 (up): ip 172.16.134.1 dlci 104(0x68,0x1880), static,

  broadcast,

  CISCO, status defined, active

  Serial1/1 (up): ip 172.16.134.3 dlci 103(0x67,0x1870), static,

  broadcast,

  CISCO, status defined, active

  Serial1/1 (up): ip 172.16.134.4 dlci 104(0x68,0x1880), static,

  broadcast,

  CISCO, status defined, active

  R3#show frame-relay map

  Serial1/2 (up): ip 172.16.134.1 dlci 301(0x12D,0x48D0), static,

  broadcast,

  CISCO, status defined, active

  Serial1/2 (up): ip 172.16.134.3 dlci 301(0x12D,0x48D0), static,

  broadcast,

  CISCO, status defined, active

  Serial1/2 (up): ip 172.16.134.4 dlci 301(0x12D,0x48D0), static,

  broadcast,

  CISCO, status defined, active

  R4#show frame-relay map

  Serial1/3 (up): ip 172.16.134.1 dlci 401(0x191,0x6410), static,

  broadcast,

  CISCO, status defined, active

  Serial1/3 (up): ip 172.16.134.3 dlci 401(0x191,0x6410), static,

  broadcast,

  CISCO, status defined, active

  Serial1/3 (up): ip 172.16.134.4 dlci 401(0x191,0x6410), static,

  broadcast,

  CISCO, status defined, active

  封装帧中继每个接口都采用了静态映射

  R1#show ip route rip

  R192.168.4.0/24 [120/1] via 172.16.134.4, 00:00:26, Serial1/1

  R192.168.3.0/24 [120/1] via 172.16.134.3, 00:00:07, Serial1/1

  R1#show ip interface s1/1

  Serial1/1 is up, line protocol is up

  Internet address is 172.16.134.1/24

  Broadcast address is 255.255.255.255

  --------------------

  Split horizon is disabled接口封装帧中继后,水平分割被自动关闭

  R1(R1(config)#inter s1/1

  R1(config-if)#ip split-horizon 开启水平分割

  R1#clear ip route * 清除路由表

  R1#show ip route rip

  R192.168.4.0/24 [120/1] via 172.16.134.4, 00:00:07, Serial1/1

  R192.168.3.0/24 [120/1] via 172.16.134.3, 00:00:11, Serial1/1

  重新获得

  R3#show ip route rip

  R192.168.1.0/24 [120/1] via 172.16.134.1, 00:00:15, Serial1/2

  R4#show ip route rip

  R192.168.1.0/24 [120/1] via 172.16.134.1, 00:00:06, Serial1/3

  R3没有了R4的路由

  R4没有了R3的路由

本文来源:abc16810 的BLOG 作者:delete

声明
声明:本站所发表的文章、评论及图片仅代表作者本人观点,与本站立场无关。文章是出于传递更多信息之目的。若有来源标注错误或侵犯了您的合法权益,请作者持权属证明与本网联系,我们将及时更正、删除,谢谢。 Email:support@txwb.com,系统开号,技术支持,服务联系微信:_WX_1_本站所有有注明来源为天下网吧或天下网吧论坛的原创作品,各位转载时请注明来源链接!
天下网吧·网吧天下
  • 本周热门
  • 本月热门
  • 阅读排行