四、PSTN 电话网络(PSTN)是目前普及程度最高、成本最低的公用通讯网络,它在网络互连中也有广泛的应用。电话网络的应用一般可分为两种类型,一种是同等级别机构之间以按需拨号(DDR)的方式实现互连,一种是ISP 为拨号上网的用户提供的服务。这两种类型使用的设置命令大致相同,但在设置思想上又有重要的差别。
1.相关命令
全局设置:
设置PPP 安全协议使用户名和密码 username username password password
设置路由器与modem 的接口指令 chat-script script-name EXPECT SEND EXPECT SEND(etc.)
设置用户的IP地址池 ip local pool {default|pool-name low-ip-address [high-ip-address]}
指定地址池的工作方式 ip address-pool [dhcp-proxy-client|local]
指定DHCP服务器 ip dhcp-server [ip-address|name]
指定TACACS 服务器 tacacs-server host hostname [single-connection] [port interger] [timeout integer] [key string]
异步口(async)设置:
设置封装形式为PPP encapsulation PPP
启动异步口的路由功能 async default routing
设置异步口的PPP工作方式 async mode {dedicated interactive}
启动按需拨号功能 dialer in-band
设置用户的IP地址 peer default ip address {ip-address|dhcp|pool [pool-name]}
设置IP 地址与Ethernet0 相同 ip unnumbered Ehternet0
启动TCP 头压缩 ip tcp header-compression passive
设置端口在挂断前的等待时间 dialer idle-timeout seconds
设置IP 地址与电话号码的映射 dialer map ip next-hop-address dialer-string
设置PPP 安全协议 ppp authentication protocol
line 拨号线设置:
指定特定情况下路由器使用的chat-script script {dialer|reset} script-name
设置modem 的工作方式 modem {inout|dialin}
自动配置modem 类型modem autoconfig discovery
设置拨号线的通讯速率 speed speed
设置通讯线路的流控方式 flowcontrol hardware
连通后自动执行命令autocommand command
2.DDR 实 例
北京:
-- username guangzhou password Legend
-- (password 必须与广州的路由器设置的password 一样)
-- chat-script rstmdm"""AT&FS0=1&B1&C1&D2&H1&K1&M4&R2"OK
-- chat-script cisco-dial"""AT"TIMEOUT 30 OK" ATDT\T" TIMEOUT 30 CONNECT \c
-- interface async1
---- encapsulation ppp
---- async default routing
---- async mode dedicated
---- dialer in-band
---- ip unnumbered Ethernet0
---- ip tcp header-compression passive
---- dialer idle-timeout 300
---- dialer map ip 20.1.1.1 name Guangzhou 02088888888
---- ppp authentication chap
-- line aux 0
---- script dialer cisco-dial
---- script reset rstmdm
---- modem inout
---- modem autoconfig discovery
---- transport input all
---- rxspeed 38400
---- txspeed 38400
---- stopbits 1
---- flowcontrol hardware
-- line vty 0 4
---- password telnet
---- login