路由交换配置命令大全之路由配置(一)-路由交换
交换路由配置命令

交换路由配置命令Rip邻居认证第一步:在路由器Router1定义密钥链和密钥串Router1(config)# key chain ripkey !定义一个密钥链ripkey,进入密钥链配置模式Router1(config- keychain)# key 1 !定义密钥序号1,进入密钥配置模式Router1(config- keychain-key)# key-string keya !定义密钥1的密钥内容为keyaRouter1(config- keychain-key)#accept-lifetime 00:00:00 oct 1 2004 infinite!定义密钥1的接收存活期从2004年10月1日至无限(infinite)Router1(config- keychain-key)#send-lifetime 00:00:00 oct 1 2004 infinite!定义密钥1的发送存活期为从2004年10月1日至无限第二步:在接口模式下定义认证模式,指定要引用的密钥链Router1(config)# interface serial 0Router1(config-if)#ip rip authentication mode md5 ! 定义认证模式为md5,若用text则表示明文认证,若不指明模式则缺省用明文认证Router1(config-if)#ip rip authentication key-chain ripkey !引用密钥链ripkeyOSPF邻居认证R1(config)#router os 1R1(config-router)#area 0 authentication message-digest !配置区域间认证需要加密方式R1(config)#int s0R1(config-if)#ip ospf message-digest-key 1 md5 star !配置加密认证密码R2(config)#router os 1R2(config-router)#area 0 authentication message-digestR2(config)#int s0R2(config-if)#ip ospf message-digest-key 1 md5 starFrame-relay交换机主机配置:FR(config)#frame-relay switching ! 路由器模拟成帧中继交换机FR(config)#interface serial 0 !进入广域网接口serial 0FR(config-if)#encapsulation frame-relay ietf ! 封装帧中继并封装其格式为ietfFR(config-if)#frame-relay intf-type dce !封装帧中继接口类型为dceFR(config-if)#frame-relay lmi-ty ansi ! 定义帧中继本地接口管理类型FR(config-if)#cloclk rate 64000 !定义时钟速率FR(config-if)#fram route 20 interface serial 1 21!设定帧中继交换,指定两个同步口之间的dlci互换FR(config-if)#fram route 30 interface serial 3 31!设定帧中继交换,指定两个同步口之间的dlci互换FR(config-if)#no sh !启用该接口FR(config-if)#end副机配置:R1(config)#int s0R1(config-if)#ip add 192.168.123.1 255.255.255.0R1(config-if)#encapsulation frame-relay ietf ! 封装帧中继并封装其格式为ietfR1(config-if)#no frame-relay inverse-arp !禁止帧中继特定的协议dlci使用反向ARP !禁止动态学习地址和DLCI之间的映射R1(config-if)#frame-relay lmi-type ansi ! 定义帧中继本地接口管理类型,R1(config-if)#frame-relay map ip 192.168.123.2 20 ! 建立帧中继静态地址映射R1(config-if)#frame-relay map ip 192.168.123.3 30 ! 建立帧中继静态地址映射R1(config-if)# no sh基于时间的ACL定义时间段Router(config)#time-range freetimeRouter(config-time-range)#absolute start 8:00 1 jan 2006 end 18:00 30dec 2010 !定义绝对时间段Router(config-time-range)#periodic daily 0:00 to 9:00 !定义周期性时间段Router(config-time-range)#periodic daily 17:00 to 23:59!定义周期性时间段定义访问控制列表规则Router(config)#access-list 100 permit ip any host 160.16.1.1!定义扩展访问控制列表,允许访问主机160.16.1.1Router(config)#access-list 100 permit ip any any time-range freetime! 关联time-range接口t1,允许在规定时间段访问任何网络注:访问控制列表的隐含规则是拒绝所有数据包。
交换机路由器配置命令大集合

配置命令大集合一、常用的子网掩码及反掩码/30 255.255.255.252 0.0.0.3/29 255.255.255.248 0.0.0.7/28 255.255.255.240 0.0.0.15/27 255.255.255.224 0.0.0.31/26 255.255.255.192 0.0.0.63/25 255.255.255.128 0.0.0.127/24 255.255.255.0 0.0.0.255/23 255.255.254.0 0.0.1.255/22 255.255.252.0 0.0.3.255/21 255.255.248.0 0.0.7.255/20 255.255.240.0 0.0.15.255二、锐捷交换机交换技术1、跨交换机实现VLAN互通交换机间相连端口模式下switch(config-if)#switchport mode trunk2、Trunk 口的运行VLAN列表步骤1:进入全局配置模式Switch#configure terminal步骤2:进入需要配置为Trunk的端口Switch(config)#interface interface步骤3:定义该端口模式为TrunkSwitch(config-range-if)#switchport mode trunk步骤4:定义Trunk的VLAN列表Switch(config-if)#switchport trunk allowed vlan { all | [ add | remove | except ] } vlan-list3、Native VLAN的概念与配置步骤1:进入到需要配置的Trunk端口中swtich(config)#interface interface步骤2:配置Trunk的Native VLANSwitch(config-if)#switchport trunk native vlan vlan-id4、链路聚合的配置建立聚合端口switch(config)#interface range fastEthernet 0/1 – 2switch(config-if-range)#port-group 1聚合端口设Trunk口switch(config)#interface aggregateport 1switch(config-if)# switchport mode trunk5、交换机上配置TelnetTelnet密码型:switch(config)#enable passwd 0 star //配置enable 密码或switch(config)#enable secret level 15 0 start(默认是level 15)switch(config)#line vty 0 4switch(config-line)#password 0 star //配置Telnet密码或switch(config)#enable secret level 1 0 start (level 1 为Telnet密码)switch(config-line)#loginTelnet用户+密码型:switch(config)#enable passwd 0 star //配置enable 密码switch(config)#username 用户名password 密码//配置Telnet用户和Telnet 密码switch(config)#line vty 0 4 switch(config-line)#login local6、生成树协议技术switch(config)#spanning-tree mode stp/rstp/mstpswitch(config)#spanning-tree mst configurationswitch(config-mst)#instance <实例名> vlan <vlanid 1> ,<vlanind 2>…switch(config-mst)#name <mst 配置名>switch(config-mst)#revision <版本名>switch(config-mst)# spanning-tree mst <实例名> priority <优先级号>(数字越小,优先级越高,最小者为根网桥)7、VRRP(虚拟路由冗余协议)技术(有几个vrrp网关就要设几个,每个交换机都要设置)switch(config-if)#vrrp <组名> ip <ip-address>switch(config-if)#vrrp <组名> preempt //设置抢占模式switch(config-if)#vrrp <组名> priority <优先级号>(数字越小,优先级越高,默认为100,最小者为主控虚拟路由,其余为备份虚拟路由)三、锐捷路由器路由技术1、三层交换机路由功能配置switch(config)#ip routing switch(config-if)#no switchport2、SVI实现VLAN间路由步骤1 开启路由功能(默认)Switch(config)#ip routing步骤2 创建VLAN Switch(config)#vlan vlan-id步骤3 进入VLAN的SVI接口配置模式Switch(config)#interface vlan vlan-id 步骤4 给SVI接口配置IP地址Switch(config-if)#ip address ip-address mask (如果VLAN内没有激活的端口,相应VLAN的SVI端口将无法被激活)交换机相连端口设置为tag vlan 模式,PC网关为相应VLAN的SVI接口地址3、单臂路由实现VLAN间路由Router(config)#int 端口Router(config-if)#no ip add Router(config-if)#no shu步骤1:创建以太网子接口Router(config)#interface interface.sub-port步骤2:为子接口封装802.1q协议,并指定接口所属的VLANRouter(config-subif)#encapsulation dot1q vlan-id步骤3:为子接口配置IP地址Router(config-subif)#ip address ip-address mask-address步骤4:启用子接口Router(config-subif)#no shutdown在给理由器子接口配置ip地址前先封装dot1q协议,各个Vlan的主机要以相应VLAN子接口的IP地址作为网关。
华为路由器交换机配置命令大全

华为路由器交换机配置命令大全华为路由器交换机配置大全本文提供XXX路由器交换机的配置命令,包括计算机命令和交换机命令。
一、计算机命令以下是一些常用的计算机命令:shutdown-hnow;关机init 0;关机logout;用户注销login;用户登录ifconfig;显示IP地址ifconfig eth0 netmask;设置IP地址ifconfig eht0 netmask down;禁用IP地址route add 0.0.0.0 gw;设置网关route del 0.0.0.0 gw;删除网关route add default gw;设置网关route del default gw;删除网关route;显示网关ping;发ECHO包;远程登录二、XXX路由器交换机配置命令以下是一些常用的XXX路由器交换机配置命令:Quidway]dis cur;显示当前配置Quidway]display n;显示当前配置Quidway]display interfaces;显示接口信息Quidway]display vlan;显示vlan信息Quidway]display n;显示版本信息Quidway]super password;修改特权用户密码Quidway]sysname;交换机命名Quidway]XXX;进入接口视图Quidway]interface vlan x;进入接口视图Quidway-Vlan-interface x]ip address 10.65.1.1 255.255.0.0;配置VLAN的IP地址Quidway]Ip route-static 0.0.0.0 0.0.0.0 10.65.1.2;静态路由=网关Quidway]rip;rip协议Quidway]local-user ftpQuidway]user-interface vty 0 4;进入虚拟终端S3026-ui-vty0-4]n-mode password;设置口令模式首先,这篇文章需要进行重新排版和编辑,以便更清晰地传达信息。
路由器配置命令大全

路由器配置命令大全路由器配置命令大全1.连接路由器1.1 使用串行控制台线连接路由器1.2 使用以太网接口连接路由器1.3 使用无线网络连接路由器2.基本配置2.1 配置主机名router(config)hostname [hostname]2.2 配置域名解析router(config)ip domn-name [domn-name] 2.3 配置密码router(config)enable secret [password] router(config)line console 0router(config-line)password [password] router(config-line)loginrouter(config-line)exitrouter(config)line vty 0 15router(config-line)password [password]router(config-line)loginrouter(config-line)exit2.4 配置管理IP地质router(config)interface [interface]router(config-if)ip address [ip-address] [subnet-mask]router(config-if)no shutdown3.网络协议配置3.1 配置静态路由router(config)ip route [destination-network] [subnet-mask] [next-hop]3.2 配置动态路由router(config)router [routing-protocol]router(config-router)network [network-address] [subnet-mask]3.3 配置带宽管理router(config)interface [interface]router(config-if)bandwidth [bandwidth-in-kbps]3.4 配置ACL(访问控制列表)router(config)access-list [access-list-number] [permit/deny] [source-network] [source-wildcard]4.NAT(网络地质转换)配置4.1 配置静态NATrouter(config)ip nat inside source static [inside-local-address] [outside-global-address]4.2 配置动态NATrouter(config)ip nat pool [pool-name] [start-ip-address] [end-ip-address] netmask [subnet-mask]router(config)ip nat inside source list [access-list] pool [pool-name]4.3 配置PAT(端口地质转换)router(config)interface [interface]router(config-if)ip nat insiderouter(config)interface [interface]router(config-if)ip nat outside5.VLAN(虚拟局域网)配置5.1 配置VLANrouter(config)vlan [vlan-id]router(config-vlan)name [vlan-name]5.2 配置接口VLANrouter(config)interface [interface]router(config-if)switchport mode accessrouter(config-if)switchport access vlan [vlan-id]5.3 配置Trunk接口router(config)interface [interface]router(config-if)switchport mode trunkrouter(config-if)switchport trunk allowed vlan [vlan-list]6.特定协议配置6.1 配置DHCP(动态主机配置协议)router(config)ip dhcp pool [pool-name]router(dhcp-config)network [network-address] [subnet-mask]router(dhcp-config)default-router [default-gateway]router(dhcp-config)dns-server [dns-server-ip]6.2 配置NTP(网络时间协议)router(config)ntp server [ntp-server-ip]router(config)ntp update-calendar6.3 配置SNMP(简单网络管理协议)router(config)snmp-server community [community-string] [ro/rw]router(config)snmp-server host [host-ip] [community-string]7.安全配置7.1 配置SSH(安全外壳协议)router(config)hostname [hostname]router(config)ip domn-name [domn-name]router(config)crypto key generate rsarouter(config)ip ssh version 2router(config)line vty 0 15router(config-line)transport input sshrouter(config-line)login localrouter(config-line)exit7.2 配置防火墙router(config)access-list [access-list-number] [permit/deny] [source-network] [source-wildcard] router(config)interface [interface]router(config-if)ip access-group [access-list-number] [in/out]附件:无法律名词及注释:- IP地质:Internet Protocol Address,互联网协议地质,用于标识网络上主机的唯一数字标识。
路由与交换的配置命令

1、switch>:用户模式——能查看版本信息2、在用户模式下输入enable会进特权模式——它能保存、修改、删除这一系列的配置switch>enable→switch#:特权模式,下面有一些命令就在此命令下完成:①、删除vlan的文件配置:delete flash:vlan.dat②、删除vlan中的配置文件:erase startup-config③、查看vlan配置文件是否被删除及vlan的是否创建:show vlan④、重新启动交换机:reload⑤、查看当前交换机的配置:show running-config⑥、保存对交换机所配置的内容,即是保存在Nvram:copy running-configstartup-config⑦、检查Nvram的内容:show startup-config⑧、检查虚拟接口 vlan的特征:show interface vlan 1⑨、查看接口IP的属性:show ip interface vlan 1⑩、查看cisco的信息:show version⑪、查看交换机所用快速以太网接口的默认属性:show interface fastethernet 0/18⑫、查看闪存目录中的内容:show flash 或dir flash3、在特权模式下输入configure terninal后会进入全局模式,一切的配置必须在此模式中进行配置Switch#configure terninal→switchp(config)#:全局模式①、配置路由器设备的名字:switch(config)#hostname + 交换机的名字②、配置进入特权模式的密码,即使能密码:switch(config)#enable password +密码③、配置非明文密码:switch(config)#enable secret + 密码4、为交换机配置console口①、进入现成配置模式,即进入console口:switch(config)# line console 0②、设置密码(重新启动时需要此密码):switch(config-line)#password + 密码③、允许登录:switch(config-line)#login5、配置远程登录的密码:①、首先要配置使能密码②、允许让几个人登录:switch(config)#line vty 0 4(即允许五个登录)③、设置密码:switch(config-line)#password + 密码④、允许远程登录:switchp(config-line)#login6、在全局模式下的有关命令①对所有密码进行加密:switch(config)#service password-encryption②、不解析错误的命令:switch(config)#no ip domain-lookup7、创建vlan(2—1001,注vlan 1既不可以创建,也不可以删除)①、创建vlan :vlan + 要创建vlan的值②、给vlan取名:switch(config-vlan)#name + 名字(此步可以不要)③、把PC与交换机相连的端口添加到相应的vlan中:a、Switch(config)#interface + 端口b、Switch(config-if)#switchport access vlan + 相应vlan的值④、需要传递多个vlan信息就要打中继口,即trunka、switch(config)#interface + 交换机另一端口b、switch(config-if)#switchport mode trunk8、传统vlan 的通信(1)、router的配置①、为接口配置IP地址(该IP是相应vlan的PC网关)②、激活端口:no shutdown(2)、switch的配置①、创建vlan,将PC端口划入相应vlan②、将switch与router相连的端口划入相应的vlan(3) 、PC的配置:就是给PC配置IP,注PC的默认网关与router的IP相同,网关相同9、单臂路由实现vlan的通信(1)router配置①、添加子接口:interface f0/0.1(此处有多少个vlan就添加多少个子接口)②、将子接口封装到相应的vlan:encapsulation dot + 相应vlan的值③、将子接口配置IP:ip add +ip地址 + 子网掩码④、激活物理接口:no shutdown(2)、switch的配置①、创建 vlan,交PC的端口划入到相应vlan②、与router相连的端口打trunk(3)、配置PC的IP9、三层交换(1)、配置三层交换①、启用三层交换:(config)#ip routing②、创建vlan:(config)# vlan + 要创建vlan的值③、把相应的vlan配置IPa、指定一个vlan:(config)#interface vlan + vlan相应的值c、配置IP:(config-if)#ip add + ip + 子网掩码(2)、配置switch①、每个交换机创建vlan②、把端口划分到相应的vlan中③、打中继口(trunk)Show命令1、show version 这个命令可以查看IOS版本号,已启动时间,Flash中的IOS 的文件名,router里面共有什么端口,寄存器的值等等。
(完整word版)路由器配置命令大全,推荐文档

路由器配置命令大全视图模式介绍:普通视图router>特权视图router# /在普通模式下输入enable全局视图router(config)# /在特权模式下输入config t接口视图router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0路由协议视图router(config-route)# /在全局模式下输入router 动态路由协议名称1、基本配置:router>enable /进入特权模式router#conf t /进入全局配置模式router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字router(config)#enable password /设置特权口令router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密router(config)#line vty 0 4 /进入设置telnet服务模式router(config-line)#password xxx /设置telnet的密码router(config-line)#login /使能可以登陆router(config)#line con 0 /进入控制口的服务模式router(config-line)#password xxx /要设置console的密码router(config-line)#login /使能可以登陆2、接口配置:router(config)#int s0 /进入接口配置模式serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口)router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码router(config-if)#enca hdlc/ppp 捆绑链路协议hdlc 或者ppp 思科缺省串口封装的链路层协议是HDLC所以在show run配置的时候接口上的配置没有,如果要封装为别的链路层协议例如PPP/FR/X25就是看到接口下的enca ppp或者enca frrouter(config)#int loopback /建立环回口(逻辑接口)模拟不同的本机网段router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码给环回口在物理接口上配置了ip地址后用no shut启用这个物理接口反之可以用shutdown管理性的关闭接口3、路由配置:(1)静态路由router(config)#ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 下一条或自己的接口router(config)#ip route 0.0.0.0 0.0.0.0 s 0 添加缺省路由(2)动态路由rip协议router(config)#router rip /启动rip协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#version 2 转换为rip 2版本router(config-router)#no auto-summary /关闭自动汇总功能,rip V2才有作用router(config-router)# passive-int 接口名/启动本路由器的那个接口为被动接口router(config-router)# nei xxx.xxx.xxx.xxx /广播转单播报文,指定邻居的接ip,igrp协议-----内部网关路由协议(IGRP:Interior Gateway Routing Protocol)router(config)#router igrp xxx /启动igrp协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡eigrp---Enhanced Interior Gateway Routing Protocol(增强网关内部路由线路协议)router(config)#router eigrp xxx /启动协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡router(config-router)#no auto-summary /关闭自动汇总功能ospf协议----开放最短路径协议(OSPF)协议router(config)#router ospf xxx /启动协议启动一个OSPF协议进程router(config-router)#network xxx.xxx.xxx.xxx area xxx /宣告自己的接口或网段在ospf的区域中,可以把不同接口宣告在不同区域中router(config-router)#router-id xxx.xxx.xxx.xxx /配置路由的idrouter(config-router)#area xxx stub /配置xxx区域为末梢区域,加入这个区域的路由器全部要配置这个条命令router(config-router)#area xxx stub no-summary /配置xxx区域为完全末梢区域,只在ABR上配置router(config-router)#area xxx nssa /配置xxx区域为非纯末梢区域,加入这个区域的路由器全部要配置这个条命令router(config-router)#area xxx nssa no-summary /配置xxx区域为完全非纯末梢区域,只在ABR上配置,并发布缺省路由信息进入这个区域内的路由器4、保存当前修改/运行的配置:router#write /将RAM中的当前配置存储到NVRAM中,下次路由器启动就是执行保存的配置router#Copy running-config startup-config /命令与write效果一样5、一般的常用命令router(config-if)#exitrouter(config)#router(config-router)#exitrouter(config)#router(config-line)#exitrouter(config)#router(config)#exitrouter#exit命令/从接口、协议、line等视图模式下退回到全局配置模式,或从全局配置模式退回到特权模式router(config-if)#endrouter(config-router)#endrouter(config-line)#endrouter#end命令/从任何视图直接回到特权模式router#Logout /退出当前路由器登陆模式相对与windows的注销router#reload /重新启动路由器(热启动)冷启动就是关闭路由器再打开电源开关特权模式下:router#show ip route /查看当前的路由表router#clear ip route * /清楚当前的路由表router#show ip protocol /查看当前路由器运行的动态路由协议情况router#show ip int brief /查看当前的路由器的接口ip地址启用情况router#show running-config /查看当前运行配置router#show startup-config /查看启动配置router#debug ip pack /打开ip报文的调试router#terminal monitor /输出到终端上显示调试信息router#show ip eigrp neighbors /查看eigrp协议的邻居表router#show ip eigrp top //查看eigrp协议的拓朴表router#show ip eigrp interface /查看当前路由器运行eigrp协议的接口情况router#show ip ospf neighbor /查看当前路由器的ospf协议的邻居表router#show ip ospf interface /查看当前路由器运行ospf协议的接口情况router#clear ip ospf process /清楚当前路由器ospf协议的进程router#Show interfaces /显示设置在路由器和访问服务器上所有接口的统计信息. 显示路由器上配置的所有接口的状态router#Show interfaces serial /显示关于一个串口的信息router#Show ip interface /列出一个接口的IP信息和状态的小结, 列出接口的状态和全局参数。
最全路由交换配置命令大全

基础命令练习1.模式Router> //用户模式Router# //特权模式(也叫enable 模式)Router(config-if)# //接口模式Router(config-router)# //router 模式Router(config-line)# //line 模式Router(config-subif)# //子接口模式2.模式切换Router> //用户模式Router>enable //在用户模式敲入enable 进入特权模式(也叫enable 模式)Router#disable //在特权模式敲入disable 退出到用户模式Router>enable //在用户模式敲入enable 进入特权模式Router#configure terminal //在特权模式敲入configure terminal 进入到配置模式Router(config)#interface ethernet 0/0 //在配置模式敲入“interface+接口类型+接口编号”进入接口模式Router(config-if)#exit //敲入exit 退出接口模式Router(config)#router rip //敲入“router + 路由协议”进入router 模式Router(config-router)#exit //退出router 模式Router(config)#line console 0 //进入line 模式Router(config-line)#end //从line 模式退出(任何时候敲入end 会退出到特权模式)Router#conf tRouter(config)#interface ethernet 0/0.1 //进入子接口模式Router(config-subif)#end //任何时候敲入end 会退出到特权模式Router#2.为路由器定义名称router(config)#hostname xxx(xxx 为我们定义的名称)Router(config)#host fxhfxh(config)#定义路由器的名称为FXH,那么对路由器定义名称,是为了区别我们所操作所有设备的不同.3.为路由器添加特权密码router(config)#enable password sss(sss 为我们定义的明文密码)router(config)#enable secret cisco (cisco 为我们定义的密文密码)router(config)#service password-encryption //对口令进行加密,加密console 口或VTY 或是enable password 设置的密码,密码不再显示明文4.不执行DNS 解析router(config)#no ip domain-lookup (这条命令的作用是:当我们在执行命令错误的时候,路由器会认为这条命令没有错误,它只是一个域名的形式,那么他会给你解析,这样,很浪费我们宝贵的时间5.配置路由器,使得控制台端口不会中止你的连接。
路由器交换机配置口令大全

一、路由器配置>Enable 进入特权模式#Ex IT返回上一级操作模式#del flash:config.text 删除配置文件(交换机及1700系列路由器)#erase startup-config 删除配置文件(2500系列路由器)#write memory 或copy running-config startup-config 保存配置#Configure terminal 进入全局配置模式(config)# hostname routerA 配置设备名称为routerA(config)#banner motd & 配置每日提示信息&为终止符(config)# enable secret star 或者:enable password star设置路由器的特权模式密码为star;secret 指密码以非明文显示,password指密码以明文显示查看信息#show running-config 查看当前生效的配置信息#show interface fastethernet 0/3 查看F0/3端口信息#show interface serial 1/2 查看S1/2端口信息#show ip interface brief 查看端口信息#show version 查看版本信息#show running-config 查看当前生效的配置信息#show controllers serial 1/2 查看该端口信息, 用于R2501#show ip route 查看路由表信息#show access-lists 1 查看标准访问控制列表1的配置信息远程登陆(telnet)(config)# line vty 0 4 进入线路0~4的配置模式,4为连续线路最后一位的编号,线路为0~4 (conifg-line)#login(config-line)#password star 配置远程登陆密码为star(config-line)#end 返回上层端口的基本配置(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式(config)#interface range fa 0/1-2 进入F01至F0/2的端口配置模式(config-if)#speed 10 配置端口速率为10M,可选10,100,auto(config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应) (config-if)#no shutdown 开启该端口(config)# interface serial 1/2 进入端口S1/2的配置模式(config-if)# ip address 1.1.1.1 255.255.255.0 配置端口IP及掩码(config-if)# clock rate 64000 配置时钟频率(单位为K , 仅用于DCE端)(config-if)# bandwidth 512 配置端口带宽速率为512KB(单位为KB)(config-if)# no shutdown 开启该端口(config-if)#encapsulation PPP 定义封装类型为PPP,可选项:Frame-relay 帧中继Hdlc 高级数据链路控制协议lapb X.25的二层协议PPP PPP点到点协议X25 X.25协议路由协议(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口)(config)# router rip 开启RIP协议进程(config-router)# network 172.16.1.0 申明本设备的直连网段信息(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)(config-router)# network 192.168.1.0 0.0.0.255 area 0申明直连网段信息,并分配区域号(area0为骨干区域)注意:如果是Rip Version1,那么在不连续的子网中,需要为中间网段的两个路由器都配置子接口!!!RA(config)#int serial0RA(config-if)#ip address 172.16.2.1 255.255.255.0 secondaryRB(config)#int serial0RB(config-if)#ip address 172.16.2.2 255.255.255.0 secondaryPAP路由器Ra为被验证方、Rb为验证方;两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:Rb(config)# username Ra password 0 star 验证方配置被验证方的用户名,密码Rb(config)# intterface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation ppp 定义封装类型为PPPRb(config-if)# ppp authentication pap PPP启用PAP认证方式Ra(config)# itnterface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation ppp 定义封装类型为PPPRa(config-if)# ppp pap sent-username Ra password 0 star 设置用户名为ra 密码为star,用于发送到验证方进行验证#debug ppp authentication 可选命令:观察PAP验证过程(如果没看到验证消息,则将端口shutdown,然后再no shutdown,即可看到验证过程的相关信息)CHAP路由器Ra、Rb, 两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:被验证方配置:Ra(config)# username Rb password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Ra(config)# interface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation PPP 定义封装类型为PPP验证方配置:Rb(config)# username Ra password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Rb(config)# interface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation PPP 定义封装类型为PPPRb(config-if)# ppp authentication chap PPP启用CHAP方式验证PAP与CHAP的区别:1. PAP:被验证方发送用户名、密码到验证方进行身份验证,所以需要在端口模式下设置Ra(config)#ppp pap sent-username Ra password 0 star;验证方需要定义用户和密码配对数据库记录,所以要定义命令:Rb(config)# username Ra password 0 star2. Chap:CHAP由验证方主动发起挑战,由被验证方应答进行验证(三次握手),所以验证方要配置命令:Rb(config-if)# ppp authentication chap。