文章出处http://www.safexjt.com/bbs/thread-169-1-1.html

一.案例拓扑

 

一.需求分析:RTAsafexjt公司的北京总部,RTBRTC分别是它位于合肥和苏州的分公司。为了简单有效并且安全的传输各个公司之间的数据,公司决定使用帧中继接入技术。公司对于网管小郭的要求是使三个局域网可以互相访问,并且不能出现路由环路。公司只买了两条虚电路。

二.解决方案:在总部RTA上使用子接口分别与两个分公司建立PVC,三台路由之间使用RIP协议交换路由,在两个子接口上启用RIP 水平分割,防止路由环路。

三.使用步骤

1.       我们使用一台H3C的路由器做帧中继交换机,并配置它

[fr-switch]fr switching    ;启用帧中继交换功能

[fr-switch-Serial0/2/0]int s0/2/0      ;进入S0/2/0接口

[fr-switch-Serial0/2/1]link-protocol fr      ;封装接口为FR

[fr-switch-Serial0/2/2]fr interface-type dce   ;;接口类型为DCE,这里无论物理上市DTE还是ECE,这里定义的是逻辑上是DCE,帧中继交换机接口必须是DCE

[fr-switch-Serial0/2/0]fr dlci-switch 102 interface s0/2/1 dlci 201   ;在S00/2/0接口侦听,

头部DLCI102的帧从S0/2/1接口转发,并且修改帧头DLCI201

[fr-switch-Serial0/2/0]fr dlci-switch 103 interface s0/2/2 dlci 301

[fr-switch-Serial0/2/0]int s0/2/1

[fr-switch-Serial0/2/1]link-protocol fr

[fr-switch-Serial0/2/2]fr interface-type dce

[fr-switch-Serial0/2/1]undo shut

[fr-switch-Serial0/2/1]link-protocol fr

[fr-switch-Serial0/2/1]fr dlci-switch 201 interface s0/2/0 dlci 102

[fr-switch-Serial0/2/0]int s0/2/2

[fr-switch-Serial0/2/2]link-protocol fr

[fr-switch-Serial0/2/2]fr interface-type dce

[fr-switch-Serial0/2/2]fr dlci-switch 301 interface s0/2/0 dlci 103

 

小结:这里没有定义LMI的类型(使用默认类型),接口下使用命令fr lmi type 类型

默认类型有这三种

  ansi         Set LMI type to ANSI          标准类型,与其他设备通信时使用

  nonstandard  Set LMI type to nonstandard

  q933a        Set LMI type to Q.933a        私有类型,默认LMI类型,我们都是H3C设备,所有可以使用这种类型

 

2.       配置RTA(最核心的配置)

[H3C]sysname RTA

[RTA]int s0/2/0

[RTA-Serial0/2/0]link-protocol fr         ;封装接口为帧中继,否则子接口无法绑定帧中继

 

小插曲:查看PVC是否正确

 

 

 

都正确,我们继续

 

进入s0/2/0.1子接口(从s0/2/0划分的子接口)

[RTA-Serial0/2/0]int s0/2/0.1 p2p    ;接口类型为点对点

[RTA-Serial0/2/0.2]fr dlci 102       ;使用dlci 102

[RTA-fr-dlci-Serial0/2/0.2-102]quit   退出

[RTA-Serial0/2/0.2]ip add 200.1.1.1 255.255.255.252   ;设置IP,子接口随物理接口状态

[RTA-Serial0/2/0.1]ripng split-horizon    ;在s0/2/0.1启用水平分割

配置S0/2/0.2接口地址

[RTA-Serial0/2/0.1]int s0/2/0.2 p2p

[RTA-Serial0/2/0.2]fr dlci 103

[RTA-fr-dlci-Serial0/2/0.2-103]ip ad

[RTA-fr-dlci-Serial0/2/0.2-103]quit

[RTA-Serial0/2/0.2]ip add 197.1.1.1 255.255.255.252 

[RTA-Serial0/2/0.2]ripng split-horizon    ;在s0/2/0.2启用水平分割

[RTA]int LoopBack 0

[RTA-LoopBack0]ip add 1.1.1.1 255.255.255.255    ;我们把换回口模拟成一个网络,这里掩

码必须32

[RTA-Serial0/2/0.2]quit

宣告RIPv2路由

 

[RTA]rip 1

[RTA-rip-1]version 2  

[RTA-rip-1]undo summary       

[RTA-rip-1]net 200.1.1.0

[RTA-rip-1]net 197.1.1.0

[RTA-rip-1]net 1.1.1.1

小结:p2p接口只需要绑定dlci,不需要映射IPdlci,。因为它会把所有的IP包封装成指定的DLCI

 

1.       配置RTB的接口地址,启用RIP水平分割,并宣告RIP协议

[RTB]int s0/2/0

[RTB]link-protocol fr      ;封装接口为帧中继

[RTB-Serial0/2/0]ip add 200.1.1.2 255.255.255.252

[RTB-Serial0/2/0]undo shut

[RTB-Serial0/2/0]ripng split-horizon   ;启用RIP水平分割

[RTB-Serial0/2/0]int lo0

[RTB-LoopBack0]ip add 2.2.2.2 255.255.255.255

[RTB-Serial0/2/0]rip 1                         

[RTB-rip-1]version 2

[RTB-rip-1]undo summary

[RTB-rip-1]net 200.1.1.0

[RTB-rip-1]net 2.2.2.2

[RTB-rip-1]

小结:配置接口钱请查看PVC是否建立。我们不需要指定IPdlci的映射,因为帧中继自带interse arp(反向arpdlci--ip)。

关闭反向arp的命令是undo fr inarp,优点减少广播,缺点需要手工映射

 

2.       配置RTC

[RTC]int s0/2/0

 

[RTC-Serial0/2/0]link-protocol    ;封装接口为帧中继

[RTC-Serial0/2/0]ip add 197.1.1.2 255.255.255.252

[RTC-Serial0/2/0]ripng split-horizon

 [RTC-Serial0/2/0]int lo0

[RTC-LoopBack0]ip add 3.3.3.3 255.255.255.255

[RTC-LoopBack0]rip 1 

[RTC-rip-1]version 2

 [RTC-rip-1]undo summary    ;关闭RIPv2自动汇总

[RTC-rip-1]net 197.1.1.0

[RTC-rip-1]net 3.3.3.3

 

3.       测试

RTC上查看路由表

 

 

 

RTC PING TRA换回口

 

RTB ping  自己的串口地址

 

 

小结:在CISCO设备中,LMI使用ANSI,本路由器是PING 不通自己的帧中继接口的,需要做静态映射,小菜也不知道为什么在H3C设备里可以。