dialer map lp 192.200.10.2 name router2 572 dialer load-threshold 8O ppp multilink dialer-group 1 ppp atlthentication chap ! dialer-list 1 protocol ip permit ! Router2: hostname router2 user router1 password clsco ! isdn switch-type basic-net3 ! Interface bri O ip address 192.2O0.10.2 255.255.255.0 encapsulation ppp dialer map ip 192.2O0.10.1 name router1 571 dialer loadthreshold 8O ppp multilink dialer-group 1 ppp authentication chap ! dialer-list 1 protocol ip permit ! Ciscl我们将支持路由器的回拨功能 Router1作为 Callback Server,Router2作为 Callback Client。 与回拨相关的命令: 任务 命令 在接口上映射协议地址和电话号码 在全局模式下定义的使用 PPP回拨的 映射类别 Dialer map protocol address name Host name class classname Dial-string 设置接口支持 PPP回拨 ppp callback accept 在全局模式下 PPP回拨设置映射类 别 Map-class dialer classname 找注册在 dialer map里的主机 名字决定回拨 Dialer callback-server[username] 设置接口要求 PPP回拨 Ppp callback request 设置如下: Routerl: hostname routerl user router2 password cisco ! isdn switch-type basic-net3 l ppp authentication chap ! map-class dialer s3 dialer callback-server username dialer-list l protocol ip permit ! Router2: hostname router2 user routerl password cisco ! isdn switch-type basic-net3 ! interface bri O ip address 192.2OO.10.2 255.255.255.O encapsulation ppp dialer map ip 192.200.10.1 name routerl 571 dialer load-threshold 8O ppp callback request ppp multilink dialer-group l ppp authentication chap ! dialer-list l 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的过程。 routerl#debug dialer Router2#ping 192.2O0.10.1 00:03:50:%LINK-3-UPDOWN:interface BRI0:1, changed state to Up 00: 03: 50: BRIO: l: PPP callback Callback server Starting to router2 572 OO:03:5O:BRIO:l:disconnecting Call 00: 03: 5O:% LINK-3-UPDOWN: Interface BRIO: l, changed state to down 00:03:50:BRIO:l:disconnecting call 00:O3:5O:BRIO:l:disconnecting Call O0:03:51:%LINK-3-UPDOWN: Interface BRIO:2, changed state to up 00:O3:52:callback to router2 already started OO:03:52:BRIO:2:disconnecting Call OO:O3:52:%LINK-3-UPDOWN: Interface BRIO:2, changed state to down OO:03:52:BR10:2:disconnecting call 00:03:52BRIO:2:disconnecting call OO:04:O5:: Callback timer expired 00:04:05:BRI0:beginning callback to router2 572 00:04:O5:BRIO: Attempting to dial 572 00:04:O5:freeing callback to router2 572 00:04:05:%LINK-3-UPDOWN:Interface BRIO:l, changed state to up 0O:04:05: BRIO:l: NO Callback negotiated 0O:04:05:%LINK-3-UPDOWN:Interface Virtual-Access1,change state to up 0O:04:05:dialer Protocol up for Vil 0O:04:06:%LINEPROTO-5-UPDOWN:Line protocol on Interface BRIO:l, changed state to up 00: 04: 06: % LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access 1, changed state to up 00:04:11:%ISDN-6-CONNECT:Interface BRIO:1 is now connected to 572 #routerl 4.ISDN访问首都在线 263实例 本地局部地址为 1O.0.O.0/24,属于保留地址,通过 NAT地址翻译功 能,局域用户可以通过 ISDN上 263访问 1nternet。263的 ISDN电记号码 为 2633,用户为 263,口令为 263,所涉及的命令如下表: 任务 命令 指定接口通过 PPP/IPCP地址协 商获得 IP地址 Ip address negotiated 指定内部和外部端口 Ip nat {inside|outside} 使用 ppp/pap作认证 Ppp authentication pap callin 指定接口属于拨号口 1 Dialer-group1 定义拨号组 1允许所有 IP协议 Dialer-list 1 protocol ip permit 设定拨号,号码为 2633 Dialer string 2633 设定登陆 263的用户名和口令 Ppp pap sent-username 263 Passwrd 263 设定默认路由 Ip router 0.0.0.0 0.0.0.0 bri 0 设定符合访问列表 2的所有源地 址被翻译为 bri 0所拥有的地址 Ip nat inside sourse 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-lockup ip routing ! interface Ethernet O 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 O exec-timeout O O ! line vty O 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.l c765:LAN> set ip netmask 255.0.0.O 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.O 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 O.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 bridging off 建立用户预制文件用于设置拨号连接 参数,可以设置多个用户预制文件用于 相同的物理 端口对应于不同的连接。 set user remotenet 使用 PPP/IPCP set ip framing none 设置上用户帐号 set ppp clientname 263 设置上口令 Set ppp password client Enter new pssword: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 2.6. PSTN 电话络(PSTN)是目前普及程度最高、成本最低的公用通讯络,它在 络互连中也有广泛的应用。电话络的应用一般可分为两种类型,一种是同等级 别机构之间以按需拨号(DDR)的方式实现互连,一种是 ISP为拨号上为用户 提供的远程访问服务的功能。 1.远程访问 1.l. Access Server基本设置: 选用 Cisco2511作为访问服务器,采用 IP地址池动态分配地址.远程工 作站使用 WIN95拨号络实现连接。 全局设置: 任务 命令 设置用户名和密码 username username Password Password 设置用户的 IP地址池 ip local pool {default|pool-name low-ip-address [high-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地址与 EthernetO相同 Ip unnumbered ethernet0 Line 拨号线设置: 任务 命令 设置 modem的工作方式 Modem {inout|dialin} 自动配置 modem类型 Modem autoconfig discovery 设置拨号线的通讯速率 Speed speed 设置通讯线路的流控方式 Flowcontrol{none|software[lock] [in|out]|haderware[in|out]} 连通后自动执行命令 Autocommand command 访问服务器设置如下: Router: hostname Router enable secret 5$l$EFqU$tYLJLrynNUKzE4bx6fmH// ! interface EthernetO ip address 10.111.4.2O 255.255.255.0 ! interface Async1 ip unnumbered EthernetO encapsulation PPP keepalive 10 async mode interactive peer default iP address Pool Cisco2511-Group-142 ! ip local pool Cisco2511-Group-142.1O.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 Sever通过 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 authentication exec tacacs+ 由 TACACS+服务器授权域络相 关的服务请求 Aaa authentication network tacacs+ 为 EXEC会话运行记账.进程开始 和结束时发通告给 TACACS+服务 器 Aaa authentication 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-server key tac 设定共享的关键字,访问服务器 和 Tacacs+服务器使用这个关键 字去加密口令和响应信息.这里 使用 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 l interface Serial0 no ip address shutdown interface Serial1 no lp address shutdown ! interface Group-Asyncl ip unnumbered Etherneto encapsulation PPP async mode Interactive peer default ip address pool Cisco2511-Group-142 no cdp enable group-range 1 16 ! ip local pool Cisco25ll-Group-142 10.111.4.21 10.111.4.36 tacacs-server host 10.111.4.2 tacacs-server key tac ! line Con0 exec-timeout 0 0 password cisco login authentication no_tacacs line1 16 login authentication tacacs modem InOut modem autoconfigure type usr_courier autocommand ppp transport input all stopbits l rl Routerl拨号连接到 Router2。其中采用 PPP/CHAP做安全认证,在 Router1中应 建立一个用户,以对端路由器主机名作为用户名,即用户名应为 Router2。同时 在 Router2中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为 Router1。所建的这两用户的 PASSWORD必须相同。 相关命令如下: 任务 命令 设置路由器与 modem的接口指令 chat-script-name EXPECT SEND EXPECT SEND(etc.) 设置端口在挂断前的等待时间 dialer idle-timeout seconds 设置协议地址与电话号码的映射 dialer map protocol next-hop- address[name hostname] [broadcast][modem-scriPt modem-regexp][syetem-script syetem-regexp][dial-string] 设置电话号码 dialer string dial-string 指定在特定线路下路由器默认 使用的 chat-script script {dialer|reset}script-name Router1: hostname Routerl ! enable secret 5 $1$QK17$wXjpFqC74vDAyKBUMallw/ ! username Router2 password cisco chat-script cisco-default “””AT” TIMEOUT 3O OK”ATDT\ T”tl TIMEOUT 30 CONNECT\c ! interface Ethernet0 ip address 10.0.0.1 255.255.255.0 ! interface Asyncl ip address 192.2OO.10.1 255.255.255.0 encapsulation ppp async default routing async mode dedicated dialer in-band dialer idle-timeout 6O dialer map ip 192.200.10.2 name Router2 modem-script cisco-default 573 dialer-groupl PPP authentication chap ! ip router 10.0.1.0 255.255.255.O 192.200.10.2 dialer-list 1 protocol ip permit Line con O Line aux O modem InOut modem autoconfigure discovery flowcontrol hardware Router2: hostname Router2 ! enable secret 5$1$F6EV$5U8puzNt2/o9g.t56PXHo. ! username Routerl password cisco ! interface EthernetO ip address 10.0.1.1 255.255.255.O ! interface Async1 ip address 192.2O0.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.2O0. 10.1 name Routerl dialer-groupl ppp authentication chap ! ip route 10.0.O.0 255.255.255.O 192.2O0.1O.l dialer-list l protocol ip permit ! line con O line aux O 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,11ne protocol 亦为 up,则备份线路状态为 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 hoetname c2522rb ! enable secret 5$l$J5vn$ceYDe2ZFwPhrZi6qsllZ6gO enable password cisco ! username c4700 password 0 cisco ip subnet-zero Chat-script CISCO- default””” AT” TIMEOUT 30 OK” ATDT\ T” TIMEOUT 30 CONNECTT \c chat-script reset atz ! interface Ethernet0 ip address 16.122.5l.254 255.255.255.0 no ip mroute-cache ! interface SerialO backup delay 1010 backup interface SeriaI2 ip address 16.250.123.18 255.255.255.252 no ip mroute-cache no fair-queue ! interface Seriall 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 l6.249. 123.17 name c4700 6825179 dialer-groupl 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 BRIO no ip address no ip mroute-cache shutdown ! router eigrp 200 network 16.0.0.0 ! ip classless ! dialer-listl protocol ip permit ! line con 0 line 2 script dialer cisco-default script reset reset modem InOut modem autoconngure discovery rxspeed 38400 txspeed 3840O flowcontrol hardware line aux O line vty O 4 password cisco login ! end c2522rb# 4.异步拨号备份 X.25 设 X.25的拨号备份,首先 X.25连接的端口必须运行动态动态路由协议, 异步拨号口必须使用静态路由.本例选择 EIGRl 路由器 Router1配置如下: hostname routerl ! enable secrets$l$UTvD$99YiY2XsRMxHudcYeHn.Y. enable password clsco ! username router2 password cisco ip subnet-zero chat-script cisco-default””” AT” TIMEOUT 30 OK” ATDT\ T” TIMEOUT 3O CONNECT\c chat-script reset atz interface Etherneto ip address 2O2.96.38.1OO 255.255.255.0 ! interface Serial0 ip address 202.96.0.1 255.255.255.0 encapsulatlion x25 x25 address 10112227 x25 htc l6 x25 map ip 202.96 .0. 2 10112225 broadcast ! interface Seriall no ip address shutdown ! ! interface Asyncl ip address 202.96.1.1 255.255.255.252 encapsulation ppp dialer in-band Dialer idle-timeout 60 dialer map ip 202.96.l.2 name router2 modem-script cisco-default 2113470 dialer-group1 PPP authentication chap ! router eigrp 200 redistribute connected network 2O2.96.O.O ! ip route 2O2.96.37.0 255.255.255.O 202.96.1.2 20O dialer-list l protocol ip permit line con O line aux 0 script dialer cisco-default script reset reset modem In0ut modem autocontfigure discovery transport input all rxspeed 38400 txspeed 3840O flowcontrol hardware line Vty 0 4 password cisco login ! end 路由器 Router2配置如下: hostname router2 ! enable secret 5 $1$T4IU$2cIqak8f/E4Ug6dLT0k.JO enable password cIsco ! username router1 password cisco ip subnet-zero Chat-script cisco-default””” AT” TIMEOUT 30 OK” ATDT \ T” TIMEOUT 3O CONNECT\c chat-script reset atz ! interface Ethernet0 ip address 2O2.96.37.1OO 255.255.255.0 ! interface Serial0 Ip address 2O2.96.0.2 255.255.255.0 no ip mroute-cache encapsulatlon x25 x25 address 10112225 x25 htcl6 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 2O2. 96. 1. 1 name router1 modem- script cisco-default 2113469 dialer-group1 ppp authentication chap ! router eigrp 20O reddistribute static network 2O2.96.0.0 ! no ip classless iP route 202.96.38.O 255.255.255.0 2O2.96.1.1 200 dialer-list 1 protocol ip permit ! line con 0 exec-timeout 0 O line aux O 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 3. 路由配置协议 3.1. RIP协议 RIP(Routing information Protocol)是应用较早、使用较普遍的内部 关协议(Interior Gateway Protocol,简称 IGP),适用于小型同类络,是典 型的距离问量(distance-vector)协议。文档见 RFC1O58、RFC1723。 RIP通过广播 UDP报文来交换路由信息,每 30秒发送一次路由信息更新。RIP 提供跳跃计数(HOP COUNT)作为尺度来衡量路由距离,跳跃计数是一个包到达 目标所必须经过的路由器的数目。如果到相同目标有二个不等速或不同带宽的路 由器,但跳跃计数相同,则 RIP认为两个路由是等距离的。RIP最多支持的跳数 为 15,即在源和目的间所要经过的最多路由器的数目为 15,跳数 16表示不可 达。 1.有关命令 任务 命令 指定使用 RIP协议 router rip 指定 RIP版本 version{112}1 指定与该路由器相连的络 network network 注:Cisco的 RIP版本 2支持验证、密钥管理、路由汇总、无类域间路由(CIDR)和变 长子掩码(VLSMs) 2.举例: Router1: router rip version 2 network 192.2O0.10.O network 192.20.10.O ! 相关调试命令: show ip protocol show ip route 3.2. IGRP协议 IGRP(Interior Gateway Routing Protocol)是一种动态距离向量路由协 议,它由 Cisco公司八十年代中期设计。使用组合用户配置尺度,包括延迟、带 宽、可靠性和负载。 缺省情况下,IGRP每 90秒发送一次路由更新广播,在 3个更新周期内(即 270秒),没有从路由中的第一个路由器接收到更新,则宣布路由不可访问。在 7 个更新周期即 63O秒后,Cisco IOS软件从路由表中清除路由。 1.有关命令 任务书 命令 指 定 使 用 RIP协 议 router igrp autonomous-system1 指定与该路由器相连的络 network network 指定与该路由器相邻的节点地址 neighbour ip-address 注:1、autonomous-system可以随意建立,并非实际意义上的 autonomous-system,但要想 交换路由更新信息其 autonomous-system需相同。 2.举例 Routerl: router igrp 2O0 network 192.200.10.0 network 192.20.10.0 ! 3.3. OSPF协议 OSPF( Open Shortest Path First)是一个内部关协议( Interior GatewayProtocol,简称 IGP),用于在单一自治系统(autonomous-system , AS)内决策路由。与 RIP相对,OSPF是链路状态路由协议,而 RIP丛是距离相 量路由协议。 链路是路由器接口的另一种说法,因此 OSPF也称为接口状态路由协议。OSPF 通过路由器之间通告络接口的状态来建立链路状态数据库,生成最短路径树, 每个 OSPF路由器使用这些最短路径构造路由表。 文档见 RFC2178。 1.有关命令 全局设置 任务 命令 指定使用 OSPF协议 router ospf process-id 1 指定与该路由器相连的络 network address wildcard- mask area area-id 2 指定与该路由器相邻的节点地址 neighbour ip-address 注:1、OSPF路由进程 proceee-id必须指定范围在 1-65535,多个 OSPF进程可以在同一个 路由器上配置,但最好不这样做。多个 OSPF进程需要多个 OSPF数据库的副本,必须运行多 个最短路径算法的副本。process-id只在路由器内部起作用,不同路由器的 Process-id可 以不同。 2、wildcard-mask是子掩码的反码,络区域 ID area-id在此期 0-4294967295 内的十进制数,也可以是带有 IP地址格式的 x.x.x.x。当络区域 ID为佳或 0.0.0.0时为 主干域。不同络区域的路由器通过主干域学习路由信息。 2.基本配置举例: Routerl: interface ethernet O iP address 192.1.O.129 255.255.255.192 ! interface serial0 ip address 192.2O0.10.5 255.255.255.252 ! router ospf lOO network 192.200.10.4 0.0.0.3 area 0 network 192.1. 0.128 0.0.0.63 area 1 ! Router2: interface ethernet O ip address 192.1.0.65 255.255.255.192 ! interface serial O ip address l92.200. 10.6 255.255.255.252 ! Router ospf 200 network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.64 0.0.O.63 area 2 ! Router3 interface ethernet 0 ip address 192.1.0.130 255.255.255. 192 ! router ospf 300 network 192.1.0.128 0.0.O.63 area l ! Router4: interface ethernet0 iP address 192.1.0.66 255.255.255.192 ! router ospf 400 network 192.1.0.64 0.O.O.63 area 1 ! 相关调试命令: debug ip ospf events debug ip ospf packet show ip ospf show ip ospf database show ip ospf interface show ip ospf neighbor show ip route 3.使用身份验证 为了安全的原因,我们可以在相同 OSPF区域的路由器上启用身份验证的 功能,只有经过身份验证的同一区域的路由器才能互相通告路由信息。 在默认情况下不使用区域验证。通过两种方法可启用身份验证功能,纯文本 身份验证和消息摘要(md5)身份验证。纯文本身份验证传送的身份验证口令为 纯文本,它会被络探测器确定.所以不安会,不建议使用。而消息摘要(md5) 身份验证在传输身份验证口令之前,要对口令进行加密,所一般建议使用此种方 法进身份验证。 使用身份验证时,区域内所有的路由器接口必须使用相同的身份验证方法。 为起用身份验证,必须在路由器接口配置模式下,为区域的每个路由器接口配置 口令。 任务 命令 指定身份验证 area area-id authentication [message-digest] 使用纯文本身份验证 ip ospf authentication-key password 使用消息消息摘要(md5)身份验证 ip ospf message-digest-key kcyid md5 key 一 以下列举两种验证设置的示例,示例的络分布及地址分配环境与以上基 本配置举例相同,只是在 Router1和 Router2的区域 O上使用了身份验证的功 能。: 例 1.使用纯文本身份验证 Router1: interface ethernet 0 ip address 192.1.0.129 255.255.255.192 ! interface serial0 ip address 192.200.10.5 255.255.255.252 ip ospf authentication-key cisco ! router ospf 1OO network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.128 0.0.0.63 area 1 ! Router2: interface ethernet 0 ip address 192.1.0.65 255.255.255.192 ! interface serial 0 ip address 192.200.10.6 255.255.255.252 ip ospf authentication-key cisco ! router ospf 200 network 192.200.10.4 0.O.0.3 area 0 network 192.1.O.64 0.0.O.63 area 2 area O authentication ! 例 2.消息摘要(md5)身份验证: Routerl: interface ethernet 0 iP address 192.l.O.129 255.255.255.192 ! interface serial0 ip address 192.2O0.10.5 255.255.255.252 ip ospf message-digest-key 1 md5 cisco ! router ospf 100 network 192.200. 10.4 0.0.0.3 area 0 network 192.1.0.128 O.0.0.63 area 1 area 0 authentication message-digest ! Router2: Interface ethernet O iP address 192.1.0.65 255.255.255.192 ! Interface serial 0 iP address 192.2O0.10.6 255.255.255.252 ip ospf message-digest-key l md5 cisco ! router ospf 200 network 192.200.10.4 O.O.O.3 area 0 network 192.1.0.64 0.O.O.63 area 2 area 0 authentication message-digest ! 相关调试命令: debug ip ospf adj debug ip ospf events 3.4. 重新分配路由 在实际工作中,我们会遇到使用多个 IP路由协议的络。为了使整个络 正常地工作,必须在多个路由协议之间进行成功的路由再分配。 以下列举了 OSPF与 RIP之间重新分配路由的设置范例: Routerl的 Serial O端口和 Router2的 Serial 0端口运行 OSPF,在 Routerl 的 Ethernet O端口运行 RIP 2,Router3 运行 RIP2, Router2有指向 Router4的 192.168.2.0/24的静态路由,Router4使用默认静态路由。需要在 Router1和 Router3之间重新分配 OSPF和 RIP路由,在 Router2上重新分配 静态路由和直连的路由。 范例所涉及的命令 任务 命令 重新分配直连的路由 redistribute connected 重新分配静态路由 redistribute static 重新分配 ospf路由 Redistribute ospf process-id metric metric-value 重新分配 rip路由 Redistribute rip metl network 192.200.10.4 0.0.O.3 area O ! router rip version 2 redistribute ospf 100 metric 1 network 192.168.1.0 ! Router2: Interface loopback 1 ip address 192.168.3.2 255.255.255.O ! Interface ethernet O iP address 192.168.O.2 255.255.255.0 ! Interface serial 0 ip address 192.2OO.10.6 255.255.2550.252 ! router ospf 200 redistribute connected sutnet redistribut static subnet network 192.2O0.10.4 O.O.0.3 area 0 ! ip route 192.168.2.0 255.255.255.0 192.168.0.1 ! Router 3: interface ethernet O ip address 192.168.l.2 255.255.255.0 ! router rip version 2 network 192.168. 1.O ! Router4: interface ethernet O ip address 192.168.O.1 255.255.255.0 ! interface ethernet 1 ip address 192.168.2.1 255.255.255.O ! ip route 0.O.O.0.O.0.0.O 192.168.0.2 ! 3.5. IPX协议设置 IPX协议与 IP协议是两种不同的络层协议,它们的路由协议也不一样,IPX 的路由协议不象 IP的路由协议那样丰富,所以设置起来比较简单。但 IPX协议 在以太上运行时必须指定封装形式。 1. 有关命令 启动 IPX路由 Ipx routing 设置 IPX络及以太封装形式 Ipx network network [encapsulation encapsulation-types] 指定路由协议,默认为 RIP Ipx router {eigrp autonomous-system-number |number|nlsp [tag]|rip} 注:1.network范围是 1到 FFFFFFFD +IPX封装类型列表 接口类型 封装类型 IPX帧类型 Ethernet Novell-ether(默认) Arpa Snap Ethernet_802.3 Ethernet_II Sap Snap Ethernet_802.2 Ethernet_snap Token ring Sap() Snap Token-Ring Token-802.2 FDDI Snap() Sap Novell-fddi Fddi_snap Fddi_802.2 Fddi_raw 举例: 在此例中,WAN的 IPX络为 3a00,Router1 所连接的局域 IPX络号 为 2aOO在此局域有一台 Novell服务器,IPX络号也是 2aOO,路由器接口 的 IPX络号必须与在同一络的 Novell服务器上设置的 IPX络号相同,路 由器通过监听 SAP来建立已知的 Novell服务器上的络地址表,并每 6O秒发送一次自己的 SAP表。 Router1: ipx routing interface ethernet 0 ipx network 2a00 encapsulation sap ! Interface serial 0 ipx network 3aOO ! ipx router eigrp 10 network 3aOO network 2a00 ! Router2: ipx routing Interface ethernet 0 ipx network 2bOO encapsulation sap ! Interface serial 0 ipx network 3aOO ! ipx router eigrp 10 network 2bOO network 3aOO ! 相关调试命令: debug ipx packet debug ipx routing debug ipx sap debug ipx spoof debug ipx spx show ipx eigrp interfaces show ipx eigrp neighbors show pX eigrp topology 4. 服务质量及访问控制 4.1. 协议优先级设置 1.有关命令 任务 命令 协议优先级表项目 Priority-list list-number protocol protocol{high|medium|normal|low} queue-keyword key word-value 使用指定的优先级表 Priority-group list-number 2.举例 Router1 priority-list 1 protocol ip high tcp telnet priority-list 1 pfotocol ip low tcp ftp priority-list 1 default normal Interface serial 0 priority-group 1 4.2. 队列定制 1.有关命令 任务 命令 设置队列表中包含协议 Queue-list list-number protocol protocol-name queue-number queue-keyword keyword-value 设置队列表中队列的大小 Queue-list list-number queue queue-number byte-count byte-count-number 使用指定的队列表 Custom-queue-list list 2.举例 Router1: queue-list 1 protocol ip 0 tcp telnet queue-list 1 protocol ip 1 tcp mtu 1500 said 100001 state active set vlan 777 name rgw type ethernet mtu 1500 said 100777 state active set vlan 888 name qbw type ethernet mtu 1500 said 100888 state active set vlan 1002 name fddi-default type fddi mtu 15OO said 101002 state active set vlan 1OO4 name fddinet-default type fddinet mtu 15OO said 101004 said active bridge 0x0 stp ieee set vlan 1005 name trnet-default type trbrf mtu 1500 said 101O05 state active bridge 0x0 stp ibm set vlan 1O03 name token-ring-default type trcrf mtu 1500 said 1O10O3 state active parent 0 ring 0x0 mode srb aremaxhop 7 stemaxhop 7 ! #set boot command set boot config-register 0x102 set boot system flash bootflash:cat50O0sup3.4-3-la.bin ! #module 1:2-port 1OOOBaseLX Supervisor set module name 1 set vlan 1 1/1-2 set port enable l/1-2 ! #module 2 : empty ! #module 3:24-port 1O/100BaseTX Ethernet set module name 3 set module enable 3 set vlan 1 3/l-22 set vlan 777 3/23 set vlan 888 3/24 set trunk 3/1 on isl 1-1005 #module 4 empty ! #module 5 empty ! #module 6:1-port Route Switch set module name 6 set port level 6/1 normal set port trap 6/l disable set port name 6/1 set cdp enable 6/l set cdp interval 6/l 60 set trunk 6/1 on isl 1-1005 ! #module 7 :24-port 10/1OOBaseTX Ethernet set module name 7 set module enable 7 set vlan 1 7/1-22 set vlan 888 7/23-24 set trunk 7/1 on isl l-1005 set trunk 7/2 on isl l-l005 ! #module 8 emply ! #module 9 empty ! #module 1O:12-port 100BaseFX MM Ethernet set module name 10 set module enable 10 set vanl l 10/1-12 set port channel 10/l-4 off set port channel 10/5-8 off set port channel 1O/9-12 off set port channel l0/l-2 on set port channel 10/3-4 on set port channel 10/5-6 on set port channel 10/7-8 on set port channel 10/9-10 on set port channel 10/11-12 on #module 11 empty ! #module 12 empty ! #module l3 empty ! #switch port analyzer !set span 1 1/l both inpkts disable set span disable ! #cam set cam agingtime l-2,777,888,1OO3、1OO5 30O end 5500C>(enable) WS-X5302路由模块设置: Router#writ Building configuration… Current configuration: ! version ll.2 no service password-encryption no service udp-small-servers no service top-small-servers ! hostname Router ! enable secret 5$1$wlkK$AJK69fGOD7BqKhKcSNBf6. ! ip subnet-zero ! interface Vlan1 ip address 10.230.2.56 255.255.255.0 ! interface Vlan777 ip address 10.230.3.56 255.255.255.0 ! interface Vlan888 ip address 10.230.4.56 255.255.255.0 ! no ip classless ! line con O 1ine aux 0 line vty 0 4 password router login ! end Router# 3.1.例二: 交换设备仍采用 Catalyst5500交换机 1台,安装 WS-X553O-E3管理引擎 多块 WS-X5225R在交换机内划有 3个虚拟,分别名为为 default、qbw、rgw,.通 &