路由器查看接口状态
提问 查看当前路由器接 口状态
回答
Router1#show interfaces
Router1#show interfaces FastEthernet0/1
Router1#show ip interface brief
Router1#show ip interface FastEthernet0/1
注释 show interface命令得输出有很多得信息,网上一些中文文档详细介绍输出得含义,这里不翻译了。Txload和rxload这两个测量值得周期缺省是5分钟,可以使用load-interval 60 命令来修改其为60秒,必须是30得倍数,最长10分钟。再来一个隐藏命令
Router1#show interfaces FastEthernet0/1 stats
FastEthernet0/1
Switching path Pkts In Chars In Pkts Out Chars Out
Processor 294567 18704930 239526 22219870
Route cache 7758 681257 48303 6129834
Total 302325 19386187 287829 28349704
Processor是process switching,Route cache是Fast Switching
16.2. 配置串行接口
提问 为广域网连接配置串行接口
回答
Router3#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router3(config)#interface Serial1
Router3(config-if)#description WAN Connection to Chicago
Router3(config-if)#ip address 192.168.99.5 255.255.255.252
Router3(config-if)#encapsulation hdlc
Router3(config-if)#clock rate 56000
Router3(config-if)#no shutdown
Router3(config-if)#exit
Router3(config)#end
Router3#
注释 在DCE侧需要配置clock rate,如果是DTE配置了clock rate路由器会忽略此配置。通过show controller serial 命令来判断连接线缆得类型。缺省情况路由器会认为串口为1.544M带宽,而实际可能不是,为了准确进行路由协议度量值计算,需要人工bandwidth命令来修改,注意这里得单位是Kilobits每秒,而clock rate是bits每秒
16.3. 使用内置T1 CSU/DSU
提问 使用内置T1 CSU/DSU配置广域网连接
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface Serial0/1
Router1(config-if)#ip address 192.168.99.9 255.255.255.252
Router1(config-if)#no shutdown
Router1(config-if)#service-module t1 timeslots 1-12
Router1(config-if)#exit
Router1(config)#end
Router1#
注释 缺省每个channel使用64Kbps,如果电路是56k的需要在上述service module命令后面加上speed 56。还有很多的参数,需要和对端一致
Router1(config-if)#service-module t1 linecode ami
Router1(config-if)#service-module t1 data-coding inverted
Router1(config-if)#service-module t1 framing sf
Router1(config-if)#service-module t1 fdl ansi
Router1(config-if)#service-module t1 fdl att
Router1(config-if)#service-module t1 remote-alarm-enable
通常运营商会提供时钟,如果在实验网络需要其成为DCE需要配置service-module t1 clock source internal 来提供时钟
16.4. 使用内置ISDN PRI 模块
提问 配置内置ISDN PRI 模块
回答
Router8#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router8(config)#isdn switch-type primary-dms100
Router8(config)#controller T1 0
Router8(config-controlle)#framing esf
Router8(config-controlle)#clock source line primary
Router8(config-controlle)#linecode b8zs
Router8(config-controlle)#pri-group timeslots 1-24
Router8(config-controlle)#exit
Router8(config)#end
Router8#
注释 无
16.5. 使用内置56 Kbps CSU/DSU
提问 配置内置56 Kbps CSU/DSU
回答
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface Serial0/1
Router2(config-if)#ip address 192.168.99.25 255.255.255.252
Router2(config-if)#no shutdown
Router2(config-if)#service-module 56k clock rate 9.6
Router2(config-if)#exit
Router2(config)#end
Router2#
注释 这种模块没有见过,有点晕,先略一下
16.6. 配置异步串行接口
提问 配置一个同步/异步串行接口工作于异步模式
回答
Router3#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router3(config)#interface Serial1/7
Router3(config-if)#physical-layer async
Router3(config-if)#encapsulation ppp
Router3(config-if)#exit
Router3(config)#line 40
Router3(config-line)#speed 115200
Router3(config-line)#exit
Router3(config)#end
Router3#
注释 在配置了physical-layer async命令以后需要查看line号
Router3#show line
Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int
0 CTY - - - - - 0 0 0/0 -
40 TTY 9600/9600 - - - - - 0 0 0/0 Se1/7
65 AUX 2400/2400 F - - - - 0 0 0/0 -
看到Se1/7为line 40,同时其速率变为9600,所以需要使用speed命令来修改速率
16.7. 配置ATM子接口
提问 基于PVC得ATM链路互联
回答
老方法
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface ATM0/0
Router2(config-if)#no ip address
Router2(config-if)#exit
Router2(config)#interface ATM0/0.1 point-to-point
Router2(config-subif)#description PVC to New York
Router2(config-subif)#ip address 192.168.250.146 255.255.255.252
Router2(config-subif)#atm pvc 1 0 60 aal5snap 10000 5000 3 oam 5
Router2(config-subif)#exit
Router2(config)#end
Router2#
11.3以后使用思科特性周期性发送ATM OAM信元来测试VC
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface ATM0/0
Router2(config-if)#no ip address
Router2(config-if)#exit
Router2(config)#interface ATM0/0.1 point-to-point
Router2(config-subif)#description PVC to New York
Router2(config-subif)#ip address 192.168.250.146 255.255.255.252
Router2(config-subif)#pvc 0/60
Router2(config-if-atm-vc)#vbr-nrt 10000 5000 30
Router2(config-if-atm-vc)#oam-pvc manage 5
Router2(config-if-atm-vc)#exit
Router2(config)#end
Router2#
注释 第一种方法验证Router2#show atm pvc 0/60
ATM0/0.1: VCD: 1, VPI: 0, VCI: 60, etype:0×0, AAL5 – LLC/SNAP, Flags: 0×830
PeakRate: 10000, Average Rate: 5000, Burst Cells: 96, VCmode: 0xE000
OAM frequency: 5 second(s), InARP frequency: 15 minute(s)
InPkts: 1292959637, OutPkts: 3327374998, InBytes: 2196038015, OutBytes: 813592646
InPRoc: 19959239, OutPRoc: 24660, Broadcasts: 19481389
InFast: 1212924649, OutFast: 3297025318, InAS: 60075750, OutAS: 10843631
OAM F5 cells sent: 6804133, OAM cells received: 6740056
Status: ACTIVE
VCD是本地有效,VPI VCI必须和对端相同,至于封装协议推荐是AAL5SNAP,如果需要支持PPP则改为AAL5CISCOPPP
在新方法里面已经没有配置VCD了,并且如果3个OAM信元没有收到就会标记此接口断掉,在12.2(4)T后还引入了Router2(config)#snmp-server enable traps atm pvc extension oam failure loopback 来支持SNMP告警
设置有效载荷绕码(Payload Scrambling)
提问
回答
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface ATM0/0
Router2(config-if)#atm ds3-scramble (atm e3-scramble)
Router2(config-if)#exit
Router2(config)#end
Router2#
Router4#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router4(config)#interface ATM0/0
Router4(config-if)#atm scrambling cell-payload
Router4(config-if)#exit
Router4(config)#end
Router4#
注释 暂略
16.9. 传统的ATM承载IP(Classical IP Over ATM)
提问 配置路由器支持SVC和传统的ATM承载IP
回答
首先ATMARP Server
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface ATM1/0
Router1(config-if)#no ip address
Router1(config-if)#atm ilmi-keepalive
Router1(config-if)#pvc 0/5 qsaal
Router1(config-if-atm-vc)#exit
Router1(config-if)#pvc 0/16 ilmi
Router1(config-if-atm-vc)#exit
Router1(config-if)#exit
Router1(config)#interface ATM1/0.1 multipoint
Router1(config-subif)#ip address 192.168.123.1 255.255.255.0
Router1(config-subif)#atm esi-address A000C0A87B01.01
Router1(config-subif)#atm arp-server self
Router1(config-subif)#exit
Router1(config)#end
Router1#
其他Client
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface ATM1/0
Router2(config-if)#no ip address
Router2(config-if)#atm ilmi-keepalive
Router2(config-if)#pvc 0/5 qsaal
Router2(config-if-atm-vc)#exit
Router2(config-if)#pvc 0/16 ilmi
Router2(config-if-atm-vc)#exit
Router2(config-if)#exit
Router2(config)#interface ATM1/0.1 multipoint
Router2(config-subif)#ip address 192.168.123.2 255.255.255.0
Router2(config-subif)#atm esi-address A000C0A87B02.01
Router2(config-subif)#atm arp-server nsap 47.00918100000000e014cd0001.A000C0A87B01.01
Router2(config-subif)#exit
Router2(config)#end
Router2#
注释 除了上面的使用ATM SVC以外,还有Local Area Network Emulation (LANE)和Multiple Protocols over ATM (MPOA)也支持,都是解决Quasi Signaling Application Adaptation Layer (QSAAL) 协议和nterim Local Management Interface (ILMI)的问题。在客户机配置arp服务器的地址要记得加上前缀,并不仅仅是服务器的ESI地址
16.10. 配置以太网接口特性
提问 对以太网接口得速率,双工等特性进行配置
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface FastEthernet0/0
Router1(config-if)#media-type 100BaseX
Router1(config-if)#duplex full
Router1(config-if)#speed 100
Router1(config-if)#mac-address 0AAA.ABCD.0101
Router1(config-if)#arp timeout 60
Router1(config-if)#keepalive 5
Router1(config-if)#exit
Router1(config)#end
Router1#
注释 无
16.11. 配置令牌环接口特性
提问 配置令牌环接口
回答
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface TokenRing0
Router2(config-if)#ring-speed 4
Router8(config-if)#full-duplex
Router2(config-if)#mac-address 0006.1111.aaaa
Router2(config-if)#exit
Router2(config)#end
Router2#
注释 不是所有得令牌环模块都支持全双工
16.12. 使用ISL协议配置Vlan Trunks
提问 使用ISL协议配置Vlan Trunks
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no ip address
Router1(config-if)#speed 100
Router1(config-if)#full-duplex
Router1(config-if)#exit
Router1(config)#interface FastEthernet0/0.1
Router1(config-subif)#encapsulation isl 1
Router1(config-subif)#ip address 172.25.1.5 255.255.255.0
Router1(config-subif)#exit
Router1(config)#interface FastEthernet0/0.2
Router1(config-subif)#encapsulation isl 2
Router1(config-subif)#ip address 172.16.2.1 255.255.255.0
Router1(config-subif)#exit
Router1(config)#interface FastEthernet0/0.3
Router1(config-subif)#encapsulation isl 574
Router1(config-subif)#ip address 10.22.1.2 255.255.255.0
Router1(config-subif)#exit
Router1(config)#end
Router1#
注释 通常所说的单臂路由,ISL是思科特有的
Router1#show interfaces FastEthernet0/0.3
Encapsulation ISL Virtual LAN, Color 574.
在12.2(4)T以后增加了
Router1(config)#interface FastEthernet0/0.1
Router1(config-if)#ip unnumbered Loopback0
16.13. 使用802.1Q协议配置VLAN Trunks
提问 使用802.1Q协议配置Vlan Trunks
回答
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface FastEthernet1/0
Router2(config-if)#no ip address
Router2(config-if)#speed 100
Router2(config-if)#full-duplex
Router2(config-if)#exit
Router2(config)#interface FastEthernet1/0.1
Router2(config-subif)#encapsulation dot1Q 1 native
Router2(config-subif)#ip address 172.25.1.47 255.255.255.0
Router2(config-subif)#exit
Router2(config)#interface FastEthernet1/0.2
Router2(config-subif)#encapsulation dot1Q 2
Router2(config-subif)#ip address 172.25.22.4 255.255.255.0
Router2(config-subif)#exit
Router2(config)#interface FastEthernet1/0.3
Router2(config-subif)#encapsulation dot1Q 548
Router2(config-subif)#ip address 172.20.1.1 255.255.255.0
Router2(config-subif)#exit
Router2(config)#end
Router2#
注释 这里面要注意的是native vlan的配置,缺省是vlan 1,但是也可以设定为其他的,要保证路由器的native vlan和交换机的是一致的
<!–[if !supportLists]–>16.14. <!–[endif]–>LPD Printer Support
提问 把打印机接到路由器的异步串行口上
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#printer rtlpr1 line 161
Router1(config)#end
Router1#
注释 首先要有一台主机支持Berkeley Unix LPD print program,然后配置主机etc/printcap 把打印工作转到路由器,然后你的打印机要支持串口连接,最后通过show line的命令找到AUX端口的line号,也就是上例子中的161,同时建议下面配置
Router1(config)#line aux 0
Router1(config-line)#no exec
Router1(config-line)#no login
Router1(config-line)#no password
Router1(config-line)#transport input none
Router1(config-line)#speed 115200
Router1(config-line)#exit
Router1#show printer
Printer Line Rotary Errors Connections Datafiles Controlfiles Bytes
rtlpr1 161 0 0 0 0 0 0
Router1#