
路由基础配置命令.docx
9页路由基础配置命令UTP双绞线类型:直通线:交叉线:广域网线缆连接类型:DTE:DCE:时钟速率:路由器的接口:(作用)1. 广域网接口: serial 2. 内网接口: fastethernet3. 管理接口: console (控制台) AUX(备份)连接两个设备:1. 物理连接2. 逻辑连接配置网络设备:1. 管理属性:用户名 密码 描述 警告2. 协议地址:IP IPX3. 协议策略:vlan 静态 访问控制 交换机 直接可以应用路由器 需要初始配置才能应用设备启动过程:1. 加电自检2. 查找加载操作系统3. 查找加载配置文件配置网络设备方式:1. 初始配置:console 2. 初始配置后通过interface(拥有ip地址的接口): 1)telnet 2)TFTP 3)WEB 4)网络管理工具: SNA SDM 配置直接应用到内存登陆路由器:Router>Router>enable /*进入特权模式Router#Router#disable /*退出特权模式Router>Router>logout /*退出路由器Router>exit /*退出路由器路由器IOS帮助功能:?的三个用法1/ 直接问号2/ Router#cl?clear clock Router#cl3/Router#clock% Incomplete command.Router#clock ? set Set the time and dateRouter#clock 问号的帮助功能:(查找路由器设置时间的命令并设置时间)Router#cl?clear clock Router#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 month MONTH 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?set Router#clock sRouter#show history /*查看输入的历史命令 clock set 10:41:30 clock set 10:41:30 22 clock set 10:41:30 22 dec 2009 clok clock sit configure terminal clo configure terminal history show history Router#查看操作系统版本:Router#show version 查看配置文件:1. 查看正在运行的配置文件 (工作在内存 RAM)Router#show run 2. 查看启动的配置文件(存储过的配置文件 NVRAM)Router#show startRouter#show startup-config startup-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-encryption Console接口有用的命令:1.设置超时时间R1(config)#line con 0R1(config-line)#exec-timeout 0 02. 设置console的同步:R1(config)#line con 0R1(config-line)#logging synchronous 3. 关闭路由器名称查找功能R1(config)#no ip domain-lookupRouter#adfdsafTranslating "adfdsaf"% Unknown command or computer name, or unable to find computer addressRouter#设置路由器的协议地址: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.0 R1(config-if)#no shutdown (开启接口)测试接口的连通性:Type 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 HD64570 Description: To R2 S0/0/0 MTU 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 ha。
