CISCO路由器之广域网协议设置

cisco路由器之广域网协议设置
一、hdlc
hdlc是cisco路由器使用的缺省协议,一台新路由器在未指定封装协议时默认使用hdlc封装。
1. 有关命令
端口设置
任务
命令
设置hdlc封装
encapsulation hdlc
设置dce端线路速度
clockrate speed
复位一个硬件接口
clear interface serial unit
显示接口状态
show interfaces serial [unit] 1
注:1.以下给出一个显示cisco同步串口状态的例子.
router#show interface serial 0
serial 0 is up, line protocol is up
hardware is mci serial
internet address is 150.136.190.203, subnet mask is 255.255.255.0
mtu 1500 bytes, bw 1544 kbit, dly 20000 usec, rely 255/255, load 1/255
encapsulation hdlc, loopback not set, keepalive set (10 sec)
last input 0:00:07, output 0:00:00, output hang never
output queue 0/40, 0 drops; input queue 0/75, 0 drops
five minute input rate 0 bits/sec, 0 packets/sec
five minute output rate 0 bits/sec, 0 packets/sec
16263 packets input, 1347238 bytes, 0 no buffer
received 13983 broadcasts, 0 runts, 0 giants
2 input errors, 0 crc, 0 frame, 0 overrun, 0 ignored, 2 abort
22146 packets output, 2383680 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets, 0 restarts
1 carrier transitions
2. 举例
设置如下:
router1:
interface serial0
ip address 192.200.10.1 255.255.255.0
clockrate 1000000
router2:
interface serial0
ip address 192.200.10.2 255.255.255.0
!
3. 举例使用e1线路实现多个64k专线连接.
相关命令:
任务
命令
进入controller配置模式
controller {t1 | e1} number
选择帧类型
framing {crc4 | no-crc4}
选择line-code类型
linecode {ami | b8zs | hdb3}
建立逻辑通道组与时隙的映射
channel-group number timeslots range1
显示controllers接口状态
show controllers e1 [slot/port]2
注: 1. 当链路为t1时,channel-group编号为0-23, timeslot范围1-24; 当链路为e1时, channel-group编号为0-30, timeslot范围1-31.
2.使用show controllers e1观察controller状态,以下为帧类型为crc4时controllers正常的状态.
router# show controllers e1
e1 0/0 is up.
applique type is channelized e1 - unbalanced
framing is crc4, line code is hdb3 no alarms detected.
data in current interval (725 seconds elapsed):
0 line code violations, 0 path code violations
0 slip secs, 0 fr loss secs, 0 line err secs, 0 degraded mins
0 errored secs, 0 bursty err secs, 0 severely err secs, 0 unavail secs
total data (last 24 hours) 0 line code violations, 0 path code violations,
0 slip secs, 0 fr loss secs, 0 line err secs, 0 degraded mins,
0 errored secs, 0 bursty err secs, 0 severely err secs, 0 unavail secs
以下例子为e1连接3条64k专线, 帧类型为no-crc4,非平衡链路,路由器具体设置如下:
shanxi#wri t
building configuration...
current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname shanxi
!
enable secret 5 $1$xn08$ttr8nflop9.2rgzhcbzkk/
enable password shanxi
!
!
ip subnet-zero
!
controller e1 0
framing no-crc4
channel-group 0 timeslots 1
channel-group 1 timeslots 2
channel-group 2 timeslots 3
!
interface ethernet0
ip address 133.118.40.1 255.255.0.0
media-type 10baset
!
interface ethernet1
no ip address
shutdown
!
interface serial0:0
ip address 202.119.96.1 255.255.255.252
no ip mroute-cache
!
interface serial0:1
ip address 202.119.96.5 255.255.255.252
no ip mroute-cache
!
interface serial0:2
ip address 202.119.96.9 255.255.255.252
no ip mroute-cache
!
no ip classless
ip route 133.210.40.0 255.255.255.0 serial0:0
ip route 133.210.41.0 255.255.255.0 serial0:1
ip route 133.210.42.0 255.255.255.0 serial0:2
!
line con 0
line aux 0
line vty 0 4
password shanxi
login
!
end
二、ppp
ppp(point-to-point protocol)是slip(serial line ip protocol)的继承者,它提供了跨过同步和异步电路实现路由器到路由器(router-to-router)和主机到网络(host-to-network)的连接。
chap(challenge handshake authentication protocol)和pap(password authentication protocol) (pap)通常被用于在ppp封装的串行线路上提供安全性认证。使用chap和pap认证,每个路由器通过名字来识别,可以防止未经授权的访问。
chap和pap在rfc 1334上有详细的说明。
1. 有关命令
端口设置
任务
命令
设置ppp封装
encapsulation ppp1
设置认证方法
ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin]
指定口令
username name password secret
设置dce端线路速度
clockrate speed
注:1、要使用chap/pap必须使用ppp封装。在与非cisco路由器连接时,一般采用ppp封装,其它厂家路由器一般不支持cisco的hdlc封装协议。
2. 举例
路由器router1和router2的s0口均封装ppp协议,采用chap做认证,在router1中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为router2。同时在router2中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为router1。所建的这两用户的password必须相同。
设置如下:
router1:
hostname router1
username router2 password xxx
interface serial0
ip address 192.200.10.1 255.255.255.0
clockrate 1000000
ppp authentication chap
!
router2:
hostname router2
username router1 password xxx
interface serial0
ip address 192.200.10.2 255.255.255.0
ppp authentication chap
三、x.25
1. x25技术
x.25规范对应osi三层,x.25的第三层描述了分组的格式及分组交换的过程。x.25的第二层由lapb(link access procedure, balanced)实现,它定义了用于dte/dce连接的帧格式。x.25的第一层定义了电气和物理端口特性。
x.25网络设备分为数据终端设备(dte)、数据电路终端设备(dce)及分组交换设备(pse)。dte是x.25的末端系统,如终端、计算机或网络主机,一般位于用户端,cisco路由器就是dte设备。dce设备是专用通信设备,如调制解调器和分组交换机。pse是公共网络的主干交换机。
x.25定义了数据通讯的电话网络,每个分配给用户的x.25 端口都具有一个x.121地址,当用户申请到的是svc(交换虚电路)时,x.25一端的用户在访问另一端的用户时,首先将呼叫对方x.121地址,然后接收到呼叫的一端可以接受或拒绝,如果接受请求,于是连接建立实现数据传输,当没有数据传输时挂断连接,整个呼叫过程就类似我们拨打普通电话一样,其不同的是x.25可以实现一点对多点的连接。其中x.121地址、htc均必须与x.25服务提供商分配的参数相同。x.25 pvc(永久虚电路),没有呼叫的过程,类似ddn专线。
2. 有关命令:
任务
命令
设置x.25封装
encapsulation x25 [dce]
设置x.121地址
x25 address x.121-address
设置远方站点的地址映射
x25 map protocol address [protocol2 address2[...[protocol9 address9]]] x121-address [option]
设置最大的双向虚电路数
x25 htc citcuit-number1
设置一次连接可同时建立的虚电路数
x25 nvc count2
设置x25在清除空闲虚电路前的等待周期
x25 idle minutes
重新启动x25,或清一个svc,启动一个pvc相关参数
clear x25 {serial number | cmns-interface mac-address} [vc-number] 3
清x25虚电路
clear x25-vc
显示接口及x25相关信息
show interfaces serial
show x25 interface
show x25 map
show x25 vc
注:1、虚电路号从1到4095,cisco路由器默认为1024,国内一般分配为16。
2、虚电路计数从1到8,缺省为1。
3、在改变了x.25各层的相关参数后,应重新启动x25(使用clear x25 {serial number | cmns-interface mac-address} [vc-number]或clear x25-vc命令),否则新设置的参数可能不能生效。同时应对照服务提供商对于x.25交换机端口的设置来配置路由器的相关参数,若出现参数不匹配则可能会导致连接失败或其它意外情况。
3. 实例:
3.1. 在以下实例中每二个路由器间均通过svc实现连接。
路由器设置如下:
router1:
interface serial0
encapsulation x25
ip address 192.200.10.1 255.255.255.0
x25 address 110101
x25 htc 16
x25 nvc 2
x25 map ip 192.200.10.2 110102 broadcast
x25 map ip 192.200.10.3 110103 broadcast
!
router2:
interface serial0
encapsulation x25
ip address 192.200.10.2 255.255.255.0
x25 address 110102
x25 htc 16
x25 nvc 2
x25 map ip 192.200.10.1 110101 broadcast
x25 map ip 192.200.10.3 110103 broadcast
!
router:
interface serial0
encapsulation x25
ip address 192.200.10.3 255.255.255.0
x25 address 110103
x25 htc 16
x25 nvc 2
x25 map ip 192.200.10.1 110101 broadcast
x25 map ip 192.200.10.2 110102 broadcast
!
相关调试命令:
clear x25-vc
show interfaces serial
show x25 map
show x25 route
show x25 vc
3.2. 在以下实例中路由器router1和router2均通过svc与router连接,但router1和router2不通过svc直接连接,此三个路由器的串口运行rip路由协议,使用了子接口的概念。由于使用子接口,router1和router2均学习到了访问对方局域网的路径,若不使用子接口,router1和router2将学不到到对方局域网的路由。
子接口(subinterface)是一个物理接口上的多个虚接口,可以用于在同一个物理接口上连接多个网。我们知道为了避免路由循环,路由器支持split horizon法则,它只允许路由更新被分配到路由器的其它接口,而不会再分配路由更新回到此路由被接收的接口。
无论如何,在广域网环境使用基于连接的接口(象 x.25和frame relay),同一接口通过虚电路(vc)连接多台远端路由器时,从同一接口来的路由更新信息不可以再被发回到相同的接口,除非强制使用分开的物理接口连接不同的路由器。cisco提供子接口(subinterface)作为分开的接口对待。你可以将路由器逻辑地连接到相同物理接口的不同子接口, 这样来自不同子接口的路由更新就可以被分配到其他子接口,同时又满足split horizon法则。
router1:
interface serial0
encapsulation x25
ip address 192.200.10.1 255.255.255.0
x25 address 110101
x25 htc 16
x25 nvc 2
x25 map ip 192.200.10.3 110103 broadcast
!
router rip
network 192.200.10.0
!
router2:
interface serial0
encapsulation x25
ip address 192.200.11.2 255.255.255.0
x25 address 110102
x25 htc 16
x25 nvc 2
x25 map ip 192.200.11.3 110103 broadcast
!
router rip
network 192.200.11.0
!
router:
interface serial0
encapsulation x25
x25 address 110103
x25 htc 16
x25 nvc 2
!
interface serial0.1 point-to-point
ip address 192.200.10.3 255.255.255.0
x25 map ip 192.200.10.1 110101 broadcast
!
interface serial0.2 point-to-point
ip address 192.200.11.3 255.255.255.0
x25 map ip 192.200.11.2 110102 broadcast
!
router rip
network 192.200.10.0
network 192.200.11.0
!
四、frame relay
1. 帧中继技术
帧中继是一种高性能的wan协议,它运行在osi参考模型的物理层和数据链路层。它是一种数据包交换技术,是x.25的简化版本。它省略了x.25的一些强健功能,如提供窗口技术和数据重发技术,而是依靠高层协议提供纠错功能,这是因为帧中继工作在更好的wan设备上,这些设备较之x.25的wan设备具有更可靠的连接服务和更高的可靠性,它严格地对应于osi参考模型的最低二层,而x.25还提供第三层的服务,所以,帧中继比x.25具有更高的性能和更有效的传输效率。
帧中继广域网的设备分为数据终端设备(dte)和数据电路终端设备(dce),cisco路由器作为 dte设备。
帧中继技术提供面向连接的数据链路层的通信,在每对设备之间都存在一条定义好的通信链路,且该链路有一个链路识别码。这种服务通过帧中继虚电路实现,每个帧中继虚电路都以数据链路识别码(dlci)标识自己。dlci的值一般由帧中继服务提供商指定。帧中继即支持pvc也支持svc。
帧中继本地管理接口(lmi)是对基本的帧中继标准的扩展。它是路由器和帧中继交换机之间信令标准,提供帧中继管理机制。它提供了许多管理复杂互联网络的特性,其中包括全局寻址、虚电路状态消息和多目发送等功能。
2. 有关命令:
端口设置
任务
命令
设置frame relay封装
encapsulation frame-relay[ietf] 1
设置frame relay lmi类型
frame-relay lmi-type {ansi | cisco | q933a}2
设置子接口
interface interface-type interface-number.subinterface-number [multipoint|point-to-point]
映射协议地址与dlci
frame-relay map protocol protocol-address dlci [broadcast]3
设置fr dlci编号
frame-relay interface-dlci dlci [broadcast]
注:1.若使cisco路由器与其它厂家路由设备相连,则使用internet工程任务组(ietf)规定的帧中继封装格式。
2.从cisco ios版本11.2开始,软件支持本地管理接口(lmi)“自动感觉”, “自动感觉”使接口能确定交换机支持的lmi类型,用户可以不明确配置lmi接口类型。
3.broadcast选项允许在帧中继网络上传输路由广播信息。
3. 帧中继point to point配置实例:
router1:
interface serial 0
encapsulation frame-relay
!
interface serial 0.1 point-to-point
ip address 172.16.1.1 255.255.255.0
frame-reply interface-dlci 105
!
interface serial 0.2 point-to-point
ip address 172.16.2.1 255.255.255.0
frame-reply interface-dlci 102
!
interface serial 0.3 point-to-point
ip address 172.16.4.1 255.255.255.0
frame-reply interface-dlci 104
!
router2:
interface serial 0
encapsulation frame-relay
!
interface serial 0.1 point-to-point
ip address 172.16.2.2 255.255.255.0
frame-reply interface-dlci 201
!
interface serial 0.2 point-to-point
ip address 172.16.3.1 255.255.255.0
frame-reply interface-dlci 203
!
相关调试命令:
show frame-relay lmi
show frame-relay map
show frame-relay pvc
show frame-relay route
show interfaces serial
go top
4. 帧中继 multipoint 配置实例:
router1:
interface serial 0
encapsulation frame-reply
!
interface serial 0.1 multipoint
ip address 172.16.1.2 255.255.255.0
frame-reply map ip 172.16.1.1 201 broadcast
frame-reply map ip 172.16.1.3 301 broadcast
frame-reply map ip 172.16.1.4 401 broadcast
!
router2:
interface serial 0
encapsulation frame-reply
!
interface serial 0.1 multipoint
ip address 172.16.1.1 255.255.255.0
frame-reply map ip 172.16.1.2 102 broadcast
frame-reply map ip 172.16.1.3 102 broadcast
frame-reply map ip 172.16.1.4 102 broadcast
!
五、isdn
1. 综合数字业务网(isdn)
综合数字业务网(isdn)由数字电话和数据传输服务两部分组成,一般由电话局提供这种服务。isdn的基本速率接口(bri)服务提供2个b信道和1个d信道(2b+d)。bri的b信道速率为64kbps,用于传输用户数据。d信道的速率为16kbps,主要传输控制信号。在北美和日本,isdn的主速率接口(pri)提供23个b信道和1个d信道,总速率可达1.544mbps,其中d信道速率为64kbps。而在欧洲、澳大利亚等国家,isdn的pri提供30个b信道和1个64kbps d信道,总速率可达2.048mbps。我国电话局所提供isdn pri为30b+d。
2. 基本命令
任务
命令
设置isdn交换类型
isdn switch-type switch-type1
接口设置
interface bri 0
设置ppp封装
encapsulation ppp
设置协议地址与电话号码的映射
dialer map protocol next-hop-address [name hostname] [broadcast] [dial-string]
启动ppp多连接
ppp multilink
设置启动另一个b通道的阈值
dialer load-threshold load
显示isdn有关信息
show isdn {active | history | memory | services | status [dsl | interface-type number] | timers}
注:1.交换机类型如下表,国内交换机一般为basic-net3。
按区域分关键字
交换机类型
australia
basic-ts013
australian ts013 switches
europe
basic-1tr6
german 1tr6 isdn switches
basic-nwnet3
norway net3 switches (phase 1)
basic-net3
net3 isdn switches (uk, denmark, and other nations); covers the euro-isdn e-dss1 signalling system
primary-net5
net5 switches (uk and europe)
vn2
french vn2 isdn switches
vn3
french vn3 isdn switches
japan
ntt
japanese ntt isdn switches
primary-ntt
japanese isdn pri switches
north america
basic-5ess
at&t basic rate switches
basic-dms100
nt dms-100 basic rate switches
basic-ni1
national isdn-1 switches
primary-4ess
at&t 4ess switch type for the u.s. (isdn pri only)
primary-5ess
at&t 5ess switch type for the u.s. (isdn pri only)
primary-dms100
nt dms-100 switch type for the u.s. (isdn pri only)
new zealand
basic-nznet3
new zealand net3 switches
3. isdn实现ddr(dial-on-demand routing)实例:
设置如下:
router1:
hostname router1
user router2 password cisco
!
isdn switch-type basic-net3
!
interface bri 0
ip address 192.200.10.1 255.255.255.0
encapsulation ppp
dialer map ip 192.200.10.2 name router2 572
dialer load-threshold 80
ppp multilink
dialer-group 1
ppp authentication chap

dialer-list 1 protocol ip permit
!
router2:
hostname router2
user router1 password cisco
!
isdn switch-type basic-net3
!
interface bri 0
ip address 192.200.10.2 255.255.255.0
encapsulation ppp
dialer map ip 192.200.10.1 name router1 571
dialer load-threshold 80
ppp multilink
dialer-group 1
ppp authentication chap

dialer-list 1 protocol ip permit
!
cisco路由器同时支持回拨功能,我们将路由器router1作为callback server,router2作为callback client。
与回拨相关命令:
任务
命令
映射协议地址和电话号码,并在接口上使用在全局模式下定义的ppp回拨的映射类别。
dialer map protocol address name hostname class classname dial-string
设置接口支持ppp回拨
ppp callback accept
在全局模式下为ppp回拨设置映射类别
map-class dialer classname
通过查找注册在dialer map里的主机名来决定回拨.
dialer callback-server [username]
设置接口要求ppp回拨
ppp callback request
设置如下:
router1:
hostname router1
user router2 password cisco
!
isdn switch-type basic-net3
!
interface bri 0
ip address 192.200.10.1 255.255.255.0
encapsulation ppp
dialer map ip 192.200.10.2 name router2 class s3 572
dialer load-threshold 80
ppp callback accept
ppp multilink
dialer-group 1
ppp authentication chap

map-class dialer s3
dialer callback-server username
dialer-list 1 protocol ip permit
!
router2:
hostname router2
user router1 password cisco
!
isdn switch-type basic-net3
!
interface bri 0
ip address 192.200.10.2 255.255.255.0
encapsulation ppp
dialer map ip 192.200.10.1 name router1 571
dialer load-threshold 80
ppp callback request
ppp multilink
dialer-group 1
ppp authentication chap

dialer-list 1 protocol ip permit
!
相关调试命令:
debug dialer
debug isdn event
debug isdn q921
debug isdn q931
debug ppp authentication
debug ppp error
debug ppp negotiation
debug ppp packet
show dialer
show isdn status
举例:执行debug dialer命令观察router2呼叫router1,router1回拨router2的过程.
router1#debug dialer
router2#ping 192.200.10.1
router1#
00:03:50: %link-3-updown: interface bri0:1, changed state to up
00:03:50: bri0:1:ppp callback callback server starting to router2 572
00:03:50: bri0:1: disconnecting call
00:03:50: %link-3-updown: interface bri0:1, changed state to down
00:03:50: bri0:1: disconnecting call
00:03:50: bri0:1: disconnecting call
00:03:51: %link-3-updown: interface bri0:2, changed state to up
00:03:52: callback to router2 already started
00:03:52: bri0:2: disconnecting call
00:03:52: %link-3-updown: interface bri0:2, changed state to down
00:03:52: bri0:2: disconnecting call
00:03:52: bri0:2: disconnecting call
00:04:05: : callback timer expired
00:04:05: bri0:beginning callback to router2 572
00:04:05: bri0: attempting to dial 572
00:04:05: freeing callback to router2 572
00:04:05: %link-3-updown: interface bri0:1, changed state to up
00:04:05: bri0:1: no callback negotiated
00:04:05: %link-3-updown: interface virtual-access1, changed state to up
00:04:05: dialer protocol up for vi1
00:04:06: %lineproto-5-updown: line protocol on interface bri0:1, changed state
to up
00:04:06: %lineproto-5-updown: line protocol on interface virtual-access1, chang
ed state to up
00:04:11: %isdn-6-connect: interface bri0:1 is now connected to 572
#router1
4. isdn访问首都在线263网实例:
本地局部网地址为10.0.0.0/24,属于保留地址,通过nat地址翻译功能,局域网用户可以通过isdn上263网访问internet。263的isdn电话号码为2633,用户为263,口令为263,所涉及的命令如下表:
任务
命令
指定接口通过ppp/ipcp地址协商获得ip地址
ip address negotiated
指定内部和外部端口
ip nat {inside | outside}
使用ppp/pap作认证
ppp authentication pap callin
指定接口属于拨号组1
dialer-group 1
定义拨号组1允许所有ip协议
dialer-list 1 protocol ip permit
设定拨号,号码为2633
dialer string 2633
设定登录263的用户名和口令
ppp pap sent-username 263 password 263
设定默认路由
ip route 0.0.0.0 0.0.0.0 bri 0
设定符合访问列表2的所有源地址被翻译为bri 0所拥有的地址
ip nat inside source list 2 interface bri 0 overload
设定访问列表2,允许所有协议
access-list 2 permit any
具体配置如下:
hostname cisco2503
!
isdn switch-type basic-net3
!
ip subnet-zero
no ip domain-lookup
ip routing
!
interface ethernet 0
ip address 10.0.0.1 255.255.255.0
ip nat inside
no shutdown
!
interface serial 0
shutdown
no description
no ip address
!
interface serial 1
shutdown
no description
no ip address
!
interface bri 0
ip address negotiated
ip nat outside
encapsulation ppp
ppp authentication pap callin
ppp multilink
dialer-group 1
dialer hold-queue 10
dialer string 2633
dialer idle-timeout 120
ppp pap sent-username 263 password 263
no cdp enable
no ip split-horizon
no shutdown
!
ip classless
!
! static routes
!
ip route 0.0.0.0 0.0.0.0 bri 0
!
! access control list 2
!
access-list 2 permit any
!
dialer-list 1 protocol ip permit
!
! dynamic nat
!
ip nat inside source list 2 interface bri 0 overload
snmp-server community public ro
!
line console 0
exec-timeout 0 0
!
line vty 0 4
!
end
5. cisco765m通过isdn拨号上263
由于cisco765的设置命令与我们常用的cisco路由器的命令不同,所以以下列举了通过cisco765上263访问internet的具体命令行设置步骤。
>set system c765
c765> set multidestination on
c765> set switch net3
c765> set ppp multilink on
c765> cd lan
c765:lan> set ip routing on
c765:lan> set ip address 10.0.0.1
c765:lan> set ip netmask 255.0.0.0
c765:lan> set briding off
c765:lan>cd
c765> set user remotenet
new user remotenet being created
c765:remotenet> set ip routing on
c765:remotenet> set bridging off
c765:remotenet> set ip framing none
c765:remotenet> set ppp clientname 263
c765:remotenet> set ppp password client
enter new password: 263
re-type new password: 263
c765:remotenet> set ppp authentication out none
c765:remotenet> set ip address 0.0.0.0
c765:remotenet> set ip netmask 0.0.0.0
c765:remotenet> set ppp address negotiation local on
c765:remotenet> set ip pat on
c765:remotenet> set ip route destination 0.0.0.0/0 gateway 0.0.0.0
c765:remotenet> set number 2633
c765:remotenet> set active
命令描述如下:
任务
命令
设置路由器系统名称
set system c765
允许路由器呼叫多个目的地
set multidestination on
设置isdn交换机类型为net3
set switch net3
允许点到点间多条通道连接实现负载均衡
set ppp multilink on
关掉桥接
set briding off
建立用户预制文件用于设置拨号连接参数- 可以设置多个用户预制文件用于相同的物理端口对应于不同的连接。
set user remotenet
使用ppp/ipcp
set ip framing none
设置上网用户帐号
set ppp clientname 263
设置上网口令
set ppp password client
enter new password: 263
re-type new password: 263
不用ppp/chap或pap做认证
set ppp authentication out none
允许地址磋商
set ppp address negotiation local on
设置地址翻译
set ip pat on
设置默认路由
set ip route destination 0.0.0.0/0 gateway 0.0.0.0
设置isp的电话号码
set number 2633
激活用户预制文件
set active
六、pstn
电话网络(pstn)是目前普及程度最高、成本最低的公用通讯网络,它在网络互连中也有广泛的应用。电话网络的应用一般可分为两种类型,一种是同等级别机构之间以按需拨号(ddr)的方式实现互连,一种是isp为拨号上网为用户提供的远程访问服务的功能。
1. 远程访问
1.1.access server基本设置:
选用cisco2511作为访问服务器,采用ip地址池动态分配地址.远程工作站使用win95拨号网络实现连接。
全局设置:
任务
命令
设置用户名和密码
username username password password
设置用户的ip地址池
ip local pool {default | pool-name low-ip-address [high-ip-address]}
指定地址池的工作方式
ip address-pool [dhcp-proxy-client | local]
基本接口设置命令:
任务
命令
设置封装形式为ppp
encapsulation ppp
启动异步口的路由功能
async default routing
设置异步口的ppp工作方式
async mode {dedicated | interactive}
设置用户的ip地址
peer default ip address {ip-address | dhcp | pool [pool-name]}
设置ip地址与ethernet0相同
ip unnumbered ethernet0
line拨号线设置:
任务
命令
设置modem的工作方式
modem {inout|dialin}
自动配置modem类型
modem autoconfig discovery
设置拨号线的通讯速率
speed speed
设置通讯线路的流控方式
flowcontrol {none | software [lock] [in | out] | hardware [in | out]}
连通后自动执行命令
autocommand command
访问服务器设置如下:
router:
hostname router
enable secret 5 $1$efqu$tyljlrynnukze4bx6fmh//
!
interface ethernet0
ip address 10.111.4.20 255.255.255.0
!
interface async1
ip unnumbered ethernet0
encapsulation ppp
keepalive 10
async mode interactive
peer default ip address pool cisco2511-group-142
!
ip local pool cisco2511-group-142 10.111.4.21 10.111.4.36
!
line con 0
exec-timeout 0 0
password cisco
!
line 1 16
modem inout
modem autoconfigure discovery
flowcontrol hardware
!
line aux 0
transport input all
line vty 0 4
password cisco
!
end
相关调试命令:
show interface
show line
1.2. access server通过tacacs服务器实现安全认证:
使用一台windows nt服务器作为tacacs服务器,地址为10.111.4.2,运行cisco2511随机带的easy acs 1.0软件实现用户认证功能.
相关设置:
任务
命令
激活aaa访问控制
aaa new-model
用户登录时默认起用tacacs+做aaa认证
aaa authentication login default tacacs+
列表名为no_tacacs使用enable口令做认证
aaa authentication login no_tacacs enable
在运行ppp的串行线上采用tacacs+做认证
aaa authentication ppp default tacacs+
由tacacs+服务器授权运行exec
aaa authorization exec tacacs+
由tacacs+服务器授权与网络相关的服务请求。
aaa authorization network tacacs+
为exec会话运行记帐.进程开始和结束时发通告给tacacs+服务器。
aaa accounting exec start-stop tacacs+
为与网络相关的服务需求运行记帐包括slip,ppp,ppp ncps,arap等.在进程开始和结束时发通告给tacacs+服务器。
aaa accounting network start-stop tacacs+
指定tacacs服务器地址
tacacs-server host 10.111.4.2
在tacacs+服务器和访问服务器设定共享的关键字,访问服务器和tacacs+服务器使用这个关键字去加密口令和响应信息。这里使用tac作为关键字。
tacacs-server key tac
访问服务器设置如下:
hostname router
!
aaa new-model
aaa authentication login default tacacs+
aaa authentication login no_tacacs enable
aaa authentication ppp default tacacs+
aaa authorization exec tacacs+
aaa authorization network tacacs+
aaa accounting exec start-stop tacacs+
aaa accounting network start-stop tacacs+
enable secret 5 $1$kn4g$cvs4d2.rjzwntcnn/0hve0
!
interface ethernet0
ip address 10.111.4.20 255.255.255.0
!
interface serial0
no ip address
shutdown
interface serial1
no ip address
shutdown
!
interface group-async1
ip unnumbered ethernet0
encapsulation ppp
async mode interactive
peer default ip address pool cisco2511-group-142
no cdp enable
group-range 1 16
!
ip local pool cisco2511-group-142 10.111.4.21 10.111.4.36
tacacs-server host 10.111.4.2
tacacs-server key tac
!
line con 0
exec-timeout 0 0
password cisco
login authentication no_tacacs
line 1 16
login authentication tacacs
modem inout
modem autoconfigure type usr_courier
autocommand ppp
transport input all
stopbits 1
rxspeed 115200
txspeed 115200
flowcontrol hardware
line aux 0
transport input all
line vty 0 4
password cisco
!
end
2. ddr(dial-on-demand routing)实例
此例通过cisco 2500系列路由器的aux端口实现异步拨号ddr连接。router1拨号连接到router2。其中采用ppp/chap做安全认证,在router1中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为router2。同时在router2中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为router1。所建的这两用户的password必须相同。
相关命令如下:
任务
命令
设置路由器与modem的接口指令
chat-script script-name expect send expect send (etc.)
设置端口在挂断前的等待时间
dialer idle-timeout seconds
设置协议地址与电话号码的映射
dialer map protocol next-hop-address [name hostname] [broadcast] [modem-script
modem-regexp] [system-script system-regexp] [dial-string]
设置电话号码
dialer string dial-string
指定在特定线路下路由器默认 使用的chat-script
script {dialer|reset} script-name
router1:
hostname router1
!
enable secret 5 $1$qki7$wxjpfqc74vdaykbumallw/
!
username router2 password cisco
chat-script cisco-default at timeout 30 ok atdt \t timeout 30 connect \c
!
interface ethernet0
ip address 10.0.0.1 255.255.255.0
!
interface async1
ip address 192.200.10.1 255.255.255.0
encapsulation ppp
async default routing
async mode dedicated
dialer in-band
dialer idle-timeout 60
dialer map ip 192.200.10.2 name router2 modem-script cisco-default 573
dialer-group 1
ppp authentication chap
!
ip route 10.0.1.0 255.255.255.0 192.200.10.2
dialer-list 1 protocol ip permit
!
line con 0
line aux 0
modem inout
modem autoconfigure discovery
flowcontrol hardware
router2:
hostname router2
!
enable secret 5 $1$f6ev$5u8puznt2/o9g.t56pxho.
!
username router1 password cisco
!
interface ethernet0
ip address 10.0.1.1 255.255.255.0
!
interface async1
ip address 192.200.10.2 255.255.255.0
encapsulation ppp
async default routing
async mode dedicated
dialer in-band
dialer idle-timeout 60
dialer map ip 192.200.10.1 name router1
dialer-group 1
ppp authentication chap
!
ip route 10.0.0.0 255.255.255.0 192.200.10.1
dialer-list 1 protocol ip permit
!
line con 0
line aux 0
modem inout
modem autoconfigure discovery
flowcontrol hardware
!
相关调试命令:
debug dialer
debug ppp authentication
debug ppp error
debug ppp negotiation
debug ppp packet
show dialer
3. 异步拨号备份ddn专线:
此例主连接采用ddn专线,备份线路为电话拨号。当ddn专线连接正常时,主端口s0状态为up,line protocol亦为up,则备份线路状态为standby,line protocol为down,此时所有通信均通过主接口进行。当主接口连接发生故障时,端口状态为down,则激活备份接口,完成数据通信。此方法不适合为x.25做备份。因为,配置封装为x.25的接口只要和x.25交换机之间的连接正常其接口及line protocol的状态亦为 up,它并不考虑其它地方需与之通信的路由器的状态如何,所以若本地路由器状态正常,而对方路由器连接即使发生故障,本地也不会激活备份线路。例4将会描述如何为x.25做拨号备份。
以下是相关命令:
任务
命令
指定主线路改变后,次线路状态发生改变的延迟时间
backup delay {enable-delay | never} {disable-delay | never}
指定一个接口作为备份接口
backup interface type number
hostname c2522rb
!
enable secret 5 $1$j5vn$ceyde2fwphrzi6qsiiz6g0
enable password cisco
!
username c4700 password 0 cisco
ip subnet-zero
chat-script cisco-default at timeout 30 ok atdt \t timeout 30 connect \c
chat-script reset atz
!
interface ethernet0
ip address 16.122.51.254 255.255.255.0
no ip mroute-cache
!
interface serial0
backup delay 10 10
backup interface serial2
ip address 16.250.123.18 255.255.255.252
no ip mroute-cache
no fair-queue
!
interface serial1
no ip address
no ip mroute-cache
shutdown
!
interface serial2
physical-layer async
ip address 16.249.123.18 255.255.255.252
encapsulation ppp
async mode dedicated
dialer in-band
dialer idle-timeout 60
dialer map ip 16.249.123.17 name c4700 6825179
dialer-group 1
ppp authentication chap
!
interface serial3
no ip address
shutdown
no cdp enable
!
interface serial4
no ip address
shutdown
no cdp enable
!
interface serial5
no ip address
no ip mroute-cache
shutdown
!
interface serial6
no ip address
no ip mroute-cache
shutdown
!
interface serial7
no ip address
no ip mroute-cache
shutdown
!
interface serial8
no ip address
no ip mroute-cache
shutdown
!
interface serial9
no ip address
no ip mroute-cache
shutdown
!
interface bri0
no ip address
no ip mroute-cache
shutdown
!
router eigrp 200
network 16.0.0.0
!
ip classless
!
dialer-list 1 protocol ip permit
!
line con 0
line 2
script dialer cisco-default
script reset reset
modem inout
modem autoconfigure discovery
rxspeed 38400
txspeed 38400
flowcontrol hardware
line aux 0
line vty 0 4
password cisco
login
!
end
c2522rb#
4. 异步拨号备份x.25:
设置x.25的拨号备份,首先x.25连接的端口必须运行动态路由协议,异步拨号口必须使用静态路由.本例选择eigrp作为路由选择协议,将静态路由的metric的值设置为200,由于eigrp的默认metric为90,所以当同时有两条路径通往同一网段时,其中metric值小的路径生效,而当x.25连接出现问题时,路由器无法通过路由协议学习到路由表,则此时静态路由生效,访问通过拨号端口实现。当x.25连接恢复正常时,路由器又可以学习到路由表,则由于 metric值的不同,静态路由自动被动态路由所代替,这样就实现了备份的功能。
路由器router1配置如下:
hostname router1
!
enable secret 5 $1$utvd$99yiy2xsrmxhudcyehn.y.
enable password cisco
!
username router2 password cisco
ip subnet-zero
chat-script cisco-default at timeout 30 ok atdt \t timeout 30 connect \c
chat-script reset atz
interface ethernet0
ip address 202.96.38.100 255.255.255.0
!
interface serial0
ip address 202.96.0.1 255.255.255.0
encapsulation x25
x25 address 10112227
x25 htc 16
x25 map ip 202.96.0.2 10112225 broadcast
!
interface serial1
no ip address
shutdown
!
!
interface async 1
ip address 202.96.1.1 255.255.255.252
encapsulation ppp
dialer in-band
dialer idle-timeout 60
dialer map ip 202.96.1.2 name router2 modem-script cisco-default 2113470
dialer-group 1
ppp authentication chap
!
router eigrp 200
redistribute connected
network 202.96.0.0
!
ip route 202.96.37.0 255.255.255.0 202.96.1.2 200
dialer-list 1 protocol ip permit
line con 0
line aux 0
script dialer cisco-default
script reset reset
modem inout
modem autoconfigure discovery
transport input all
rxspeed 38400
txspeed 38400
flowcontrol hardware
line vty 0 4
password cisco
login
!
end
路由器router2配置如下:
hostname router2
!
enable secret 5 $1$t4iu$2ciqak8f/e4ug6dlt0k.j0
enable password cisco
!
username router1 password cisco
ip subnet-zero
chat-script cisco-default at timeout 30 ok atdt \t timeout 30 connect \c
chat-script reset atz
!
interface ethernet0
ip address 202.96.37.100 255.255.255.0
!
interface serial0
ip address 202.96.0.2 255.255.255.0
no ip mroute-cache
encapsulation x25
x25 address 10112225
x25 htc 16
x25 map ip 202.96.0.1 10112227 broadcast
!
interface serial1
no ip address
shutdown
!
interface async1
ip address 202.96.1.2 255.255.255.252
encapsulation ppp
keepalive 30
async default routing
async mode dedicated
dialer in-band
dialer idle-timeout 60
dialer wait-for-carrier-time 120
dialer map ip 202.96.1.1 name router1 modem-script cisco-default 2113469
dialer-group 1
ppp authentication chap
!
router eigrp 200
redistribute static
network 202.96.0.0
!
no ip classless
ip route 202.96.38.0 255.255.255.0 202.96.1.1 200
dialer-list 1 protocol ip permit
!
line con 0
exec-timeout 0 0
line aux 0
script reset reset
modem inout
modem autoconfigure discovery
transport input all
rxspeed 38400
txspeed 38400
flowcontrol hardware
line vty 0 4
password cisco
login
!
end

魅族pro7和pro6s哪个值得买?配置参数详情对比测评
ISHE 2017——“语音交互+机器人=智能家居”模式成主流
泰国和华为合作建立了一个5G测试平台
光伏发电防孤岛效应装置工作原理_光伏发电防孤岛效应装置功能特点
USB的阻抗匹配问题
CISCO路由器之广域网协议设置
Velodyne Lidar探讨智慧城市、洞穴、机场和灾难响应中的自动探测
全新智能语音融合应急通信系统
PAC控创技术的特点及其优势
三星和斯坦福大学合作研制精细度10000PPI的OLED显示技术
广义软开关串并联补偿在线UPS
小米6Plus什么时候上市?小米6Plus王牌来袭!大屏+MIUI9,价格2999起,给次现货吧!
一文详解IEPE传感器
集邦咨询发布全球智能手机市占率最新排名
华为打响了AI在智能手机上应用响亮的第一枪
激光遥感式路面状况设备在交通监测中的应用
现代名图和大众速腾哪个好?配置对比,性价比谁的优势最让人心动,12万左右家轿的“极限挑战”之中谁能胜出
多功能海缆安装维护驳船“福勇6”的成功交付并顺利通过海试
苹果13官方发布时间是什么时候
一加5通过无线电核准,诺基亚8、诺基亚9设计图曝光,两种品牌你更期待谁?