路由基础配置命令UTP双绞线类型:直通线:交叉线:广域网线缆连接类型:DTE:DCE:时钟速率:路由器的接口:(作用)1. 广域网接口: serial2. 内网接口:fastethernet3. 管理接口:console (控制台)AUX(备份)连接两个设备:1. 物理连接2. 逻辑连接配置网络设备:1. 管理属性:用户名密码描述警告2. 协议地址:IP IPX3. 协议策略:vlan 静态访问控制交换机直接可以应用路由器需要初始配置才能应用设备启动过程:1. 加电自检2. 查找加载操作系统3. 查找加载配置文件配置网络设备方式:1. 初始配置:console2. 初始配置后通过interface(拥有ip地址的接口):1)telnet2)TFTP3)WEB4)网络管理工具:SNA SDM配置直接应用到内存登陆路由器:Router>Router>enable /*进入特权模式Router#Router#disable /*退出特权模式Router>Router>logout /*退出路由器Router>exit /*退出路由器路由器IOS帮助功能:?的三个用法1/ 直接问号2/Router#cl?clear clockRouter#cl3/Router#clock% Incomplete command. Router#clock ?set Set the time and dateRouter#clock问号的帮助功能:(查找路由器设置时间的命令并设置时间)Router#cl?clear clockRouter#clock% Incomplete command.Router#clock ?set Set the time and dateRouter#clock set% Incomplete command.Router#clock set ?hh:mm:ss Current TimeRouter#clock set 11:04:50% Incomplete command.Router#clock set 11:04:50 ?<1-31> Day of the monthMONTH Month of the yearRouter#clock set 11:04:50 15% Incomplete command.Router#clock set 11:04:50 15 ?MONTH Month of the yearRouter#clock set 11:04:50 15 09^% Invalid input detected at '^' marker.Router#clock set 11:04:50 15 ?MONTH Month of the yearRouter#clock set 11:04:50 15 sep ?<1993-2035> YearRouter#clock set 11:04:50 15 sep 2009Router#Router#clokTranslating "clok"...domain server (0.0.0.0)% Unknown command or computer name, or unable to find computer addressRouter#clok /* 输入快捷键“Ctrl+Shift+6”Translating "clok"...domain server (0.0.0.0) % Name lookup abortedRouter#clock sit^% Invalid input detected at '^' marker.Router#Router#clock s?setRouter#clock sRouter#show history /*查看输入的历史命令clock set 10:41:30clock set 10:41:30 22clock set 10:41:30 22 dec 2009clokclock sitconfigure terminalcloconfigure terminalhistoryshow historyRouter#查看操作系统版本:Router#show version查看配置文件:1. 查看正在运行的配置文件(工作在内存RAM)Router#show run2. 查看启动的配置文件(存储过的配置文件NVRAM)Router#show startRouter#show startup-configstartup-config is not present /*没有启动的配置文件Router#路由器的硬件:RAM:内存NVRAM:存储配置文件FLASH:存储IOSROM:类似计算机BIOS,Interface:CPU:保存路由器的配置文件:Router#copy run startDestination filename [startup-config]? Building configuration...[OK]Router#writeBuilding configuration...[OK]Router#重新启动路由器:Router#reloadProceed with reload? [confirm]设置路由的标识符:1. 路由器的名称Router#conf tRouter(config)#hostname R1R1(config)#2. 每日欢迎信息R1(config)#banner motd # This is R1, shenyang ,Don't shutdown it!! # 重新登录路由器3. 端口描述R1(config)#interface serial 0/0/0 (进入接口的子模式)R1(config-if)#description To R2 S0/0/0(端口的描述信息)R1(config-if)#查看端口信息:R1#show interfaces fastEthernet 0/0R1#show run路由器的密码:1. 控制台管理接口的密码:R1(config)#line console 0 (进入console接口的配置模式)R1(config-line)#password cisco (密码是cisco)R1(config-line)#login (登陆过程中,检查密码)R1(config-line)#2. 用户到特权模式的密码R1(config)#enable password 1234 (明文方式显示密码)R1(config)#enable secret 4321 (加密方式显示密码,权限比明文高)3. 删除密码:R1(config)#no enable passwordR1(config)#no enable secret4. 启动密码的加密服务:R1(config)#service password-encryptionConsole接口有用的命令:1.设置超时时间R1(config)#line con 0R1(config-line)#exec-timeout 0 02. 设置console的同步:R1(config)#line con 0R1(config-line)#logging synchronous3. 关闭路由器名称查找功能R1(config)#no ip domain-lookupRouter#adfdsafTranslating "adfdsaf"% Unknown command or computer name, or unable to find computer address Router#设置路由器的协议地址:1. 配置路由器广域网接口(serial)R1(config)#interface serial 0/0/0R1(config-if)#exitR1(config)#int s0/0/0R1(config-if)#clock rate 64000 (设置时钟输率)R1(config-if)#bandwidth 64 (设置接口带宽)启动路由器的接口:R1(config-if)#no shutdown (开启接口)R1(config-if)#%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up (接口的物理层UP)%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up (接口的数据链路层UP)R1(config-if)#配置接口的ip地址:R1(config)#int s0/0/0R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config-if)#no shutdown (开启接口)测试接口的连通性:R1#ping 12.1.1.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msR1#查看端口的状态:R1# show int s0/0/0Serial0/0/0 is up, line protocol is up (connected)Hardware is HD64570Description: To R2 S0/0/0Internet address is 12.1.1.1/24MTU 1500 bytes, BW 64 Kbit, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input never, output never, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0 (size/max/drops); Total output drops: 0 Queueing strategy: weighted fairOutput queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/0/256 (active/max active/max total)Reserved Conversations 0/0 (allocated/max allocated)Available Bandwidth 48 kilobits/sec5 minute input rate 5 bits/sec, 0 packets/sec5 minute output rate 5 bits/sec, 0 packets/sec5 packets input, 640 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort5 packets output, 640 bytes, 0 underruns0 output errors, 0 collisions, 2 interface resets0 output buffer failures, 0 output buffers swapped out0 carrier transitionsDCD=up DSR=up DTR=up RTS=up CTS=upR1#查看接口连接线缆的类型:R1#show controllers serial 0/0/0Interface Serial0/0/0Hardware is PowerQUICC MPC860DCE V.35, clock rate 64000idb at 0x81081AC4, driver data structure at 0x81084AC0SCC Registers:.... ....R2#show controllers serial 0/0/0Interface Serial0/0/0Hardware is PowerQUICC MPC860DTE V.35TX and RX clocks detectedidb at 0x81081AC4, driver data structure at 0x81084AC0SCC Registers:........接口状态的提示:R3#show int serial 0/3/0 /* 默认关闭的端口或手工关闭的端口Serial0/3/0 is administratively down, line protocol is down (disabled) ........Router#show int s0/0/0 /* 端口物理层有问题,远端接口没有开启Serial0/0/0 is down, line protocol is down (disabled)........Router#show int s0/0/0 /* 物理层工作正常,数据链路层有问题:1.时钟速率2.端口的封装类型3.Keeplive 周期不一样Serial0/0/0 is up, line protocol is down (disabled)........Router#show int s0/0/0 /* 物理层工作正常,数据链路层工作正常Serial0/0/0 is up, line protocol is up (connected)远程管理网络设备:设置远程登录的密码:R1#conf tR1(config)#line vty 0 4R1(config-line)#password 5678R1(config-line)#loginR1(config-line)#exitR1(config)#enable password cisco在计算机上:PC>telnet 12.1.1.1Trying 12.1.1.1 ...OpenUser Access VerificationPassword:R1>enable% Error in authentication. /* 缺少用户模式到特权模式的密码R1>enablePassword:R1#conf tEnter configuration commands, one per line. End with CNTL/Z. R1(config)#exitR1#exit /* 退出telnet会话[Connection to 12.1.1.1 closed by foreign host]PC>。