收藏 分享(赏)

路由器基本配置命令.docx

上传人:gnk289057 文档编号:6806795 上传时间:2019-04-22 格式:DOCX 页数:10 大小:27.43KB
下载 相关 举报
路由器基本配置命令.docx_第1页
第1页 / 共10页
路由器基本配置命令.docx_第2页
第2页 / 共10页
路由器基本配置命令.docx_第3页
第3页 / 共10页
路由器基本配置命令.docx_第4页
第4页 / 共10页
路由器基本配置命令.docx_第5页
第5页 / 共10页
点击查看更多>>
资源描述

1、1DZYNQ-BLGLA-ZJKMY-UBDSZenable 从非特权模式进入特权模式conf t 进入全局配置模式hostname RX 配置一个路由器的名字no ip domain-lookup 去消域名解析 禁用 DNS 查找ip classless 支持可变长子网掩码长度ip subnet-zero 支持零子网int fa2/0 配接口ip address 201.0.0.1 255.255.255.0 IP 地址no shutdown 激活end 返回特权模式show ip interface brief 显示接口的状况对路由器应用启动脚本之前,需要对某些命令进行编辑或添加一些命令。

2、其中一些更改包括:为正在使用的 FastEthernet 接口和串行接口添加 no shutdown 命令。将 enable secret 命令中的加密文本替换成正确的口令。从接口中清除 mac-address 命令。清除 ip classless 命令。清除不使用的接口。路由器基本配置命令语法为路由器命令 Router(config)#hostname name设置口令 Router(config)#enable secret password 设置进入特权执行模式的加密口令Router(config)#Line console 0 进入控制台线路的线路配置模式Router(config-l

3、ine)#password password 设置控制台口令Router(config-line)#Login 来要求登录时输入口令Router(config)#line vty 0 4 进入所有五条虚拟终端线路的线路配置模式Router(config-line)#password password 设置 vty 口令Router(config-line)#login 来要求登录时输入口令按 Ctrl+z 退出配置模式。输入命令 copy running-config startup-config,将更改保存到 NVRAM。出现提示时,按 Enter 确认目标文件名配置登录提示文字 Route

4、r(config)#banner motd # message #配置接口 Router(config)#interface type numberRouter(config-if)#ip address address mask 2Router(config-if)#description description Router(config-if)#no shutdown保存路由器更改 Router#copy running-config startup-config 使用 copy running-config startup-config 命令保存 Router 配置检查 show 命令

5、的输出 Router#show running-config 显示当前运行配置文件的内容Router#show ip route Router#show ip interface briefRouter#show interfaces路由器第一次启动时会进入设置模式,以便用户执行基本路由器配置。Packet Tracer 仅支持基本的管理设置,因此您只能配置一个接口来连接到管理系统,从而通过该系统执行其余配置。清除所有现有配置:RouterenableRouter#erase startup-config 重新启动路由器:RouterenableRouter#reload输入 yes 确认使用

6、配置对话框 Continue with configuration dialog? yes/no: yes configuration:n. 配置;结构;外形 dialog:n. 对话;会话键入 yes 以便输入基本管理设置 Would you like to enter basic management setup? yes/no: yes输入 class 作为使能加密口令 Enter enable secret: class输入 cisco 作为使能口令 Enter enable password: cisco输入 cisco 作为虚拟终端口令 Enter virtual terminal

7、 password: cisco输入 FastEthernet0/0 作为用来连接到管理网络的接口 Enter interface name used to connect to themanagement network from the above interface summary: FastEthernet0/0接受默认设置以将此配置保存到 nvram 并退出 Save this configuration to nvram and exit输入命令 enable secret class,设置进入特权执行模式的加密口令。输入命令 line con 0 进入控制台线路的线路配置模式。注

8、意提示符发生了改变。输入命令 password cisco 设置控制台口令。输入命令 login 来要求登录时输入口令。输入命令 exit 返回全局配置模式。输入命令 line vty 0 4 进入所有五条虚拟终端线路的线路配置模式。输入命令 password cisco 设置 vty 口令。输入命令 login 来要求登录时输入口令。按 Ctrl+z 退出配置模式。输入命令 copy running-config startup-config,将更改保存到 NVRAM。出现提示时,按 Enter 确认目标文件名。3校验配置:show running-config 显示当前运行配置文件的内容s

9、how startup-config 显示启动配置show ip routeshow interfaces 显示所有接口的统计信息show ip interface brief 显示每个接口的使用情况信息摘要show version 显示有关当前加载软件版本的信息,以及硬件和设备信息路由器创建路由表时会首先添加自身接口上配置的 IP 地址所在的网络。这些网络是与该路由器直接相连的网络。当所有的接口均已配置有正确的地址,但接口状态为 shutdown,是不是在激活这些接口是不需在 ip address ip mask?静态路由由网络管理员配置,包括远程网络的网络地址和子网掩码,以及下一跳路由器的

10、 IP 地址或本地路由器的送出接口。路由器能够通过静态路由或动态路由获知远程网络。RouterenableRouter#show ip routeRouter#configure terminalRouter(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1Router(config)#end静态路由是由网络管理员配置的,它包括:? 网络地址。? 远程网络的子网掩码。? 下一跳路由器的 IP 地址或本地路由器的送出接口。动态路由协议可让路由器从其它路由器那里自动获知远程网络。通过路由协议获知的网络以及到达每个网络的最佳路径会自动加入路

11、由表中。4一、用户模式Router二、特权模式Routerenablepassword:Router#三、设置模式四、全局配置模式Router#configure terminalEnter configuration commands,one per line,End with CNTL/ZRouter( config)#五、其它配置模式1、接口配置模式Router(config)#int f0/12Router(config-if)#2、虚拟终端配置模式Router(config)#line vty 015 Router(config-line)#3、 RIP 路由协议配置模式Router

12、(config)#router ripRouter(config-router)#六、RXBOOT 模式设置系统时钟Router#calendar set 10:24:00 22 march 2007保存配置Router#write memoryRouter#write networktftp删除配置Router#write erase网络的基本检测命令1、 telnetRoutertelnet parisRouter2、 ping5Routerping 182.105.130.110Type escape sequenc to abort.Sending 5,100-byte ICMP Ec

13、hos to 182.105.130.110,timeout is 2 seconds:!Success rate is 100 percent(5/5),round-trip min/avg/max=4/4/4ms3、 traceRoutertrace 137.189.11.73Routertraceroute 4、 showa、查看 flash:Routershow flash System flash directory: File length Name/statusb、查看系统时钟Routershow clock*23:36:09.614 UTC Thu Apr 14 1994Ro

14、uterc、查看路由器软、硬件版本Routershow versionCisco internetwork Operating System Software.d、查看路由器配置Router#show configurationUsing 6907 out of 32762 bytes!.e、查看路由表Router#show ip route f、查看 IP 路由协议的详细信息:Router#show ip protocolsRouting Protocol is “rip“.接口配置1、配置接口描述信息Router(config)#int g6/0Router(config-if)#desc

15、ription To-Beijing Roreign Studies UniversityRouter(config-if)#(注:描述信息说明该接口连接到北京外国语大学)2、配置接口带宽Router(config)#interface POS3/0Router(config-if)#bandwidth 2500000 (设置接口带宽为 2.5Gbps)6Router(config-if)#3、配置接口的 IP 地址Router(config)#interface f2/3Router(config-if)#ip address 202.112.7.249 255.255.255.252Rou

16、ter(config-if)#4、接口的开启与关闭Router(config)#interface f2/3Router(config-if)#shutdown (关闭接口)Router(config-if)#Router(config-if)#no shutdown (开启接口)Router(config-if)#局域网接口配置1、配置标准以太网接口Router(config)#interface Ethernet0Router(config-if)#description To HuabeiDiQuWANGRouter(config-if)ip address 202.112.7.4 25

17、5.255.255.0Router(config-if)#bandwidth 10000Router(config-if)#no shutdownRouter(config-if)#exitRouter(config)#exitRouter#2、配置快速以太网接口Router(config)#interface f2/1Router(config-if)#description To-XianDaiKuan-YuanXiaoRouter(config-if)#ip address 202.112.41.145 255.255.255.240Router(config-if)#bandwidth

18、 100000Router(config-if)#duplex fullRouter(config-if)#no ip directed-broadcastRouter(config-if)#no ip proxy-arpRouter(config-if)#no shutdownRouter(config-if)#exitRouter(config)#exitRouter#3、配置千兆以太网接口Router(config)#interface g0/1Router(config-if)#description To-BeiJingWaiGuoYuDaXueRouter(config-if)#i

19、p address 202.112.41.49 255.255.255.252Router(config-if)#bandwidth 1000000Router(config-if)#duplex fullRouter(config-if)#no ip directed-broadcastRouter(config-if)#no ip proxy-arpRouter(config-if)#no shutdownRouter(config-if)#exit7Router(config)#exitRouter#广域网接口配置1、配置异步串行接口Router(config)#interface a1

20、Router(config-if)#ip unnumbered ethernet0Router(config-if)#iencapsulation pppRouter(config-if)#async default ip address 202.332.7.129Router(config-if)#async dynamic routingRouter(config-if)#async mode interactiveRouter(config-if)#no shutdownRouter(config-if)#exitRouter(config)#exitRouter#2、配置高速同步串行接

21、口Router(config)#interface s1/1Router(config-if)#description To-shenzhenRouter(config-if)#bandwidth 2048 (带宽为 2M)Router(config-if)#ip address 212.112.41.81 255.255.255.252Router(config-if)#encapsulation hdlc (封装 HDLC 或 PPP 协议,HDLC 为缺省值)Router(config-if)#no ip directed-broadcastRouter(config-if)#no ip

22、 proxy-arpRouter(config-if)#no shutdownRouter(config-if)#exitRouter(config)#exitRouter#3、配置 POS 接口Router(config)#interface POS3/0Router(config-if)#description To TianJingDaXueRouter(config-if)#bandwidth 2500000Router(config-if)#ip address 212.12.37.18 255.255.255.252Router(config-if)#crc 32Router(co

23、nfig-if)#pos framing sdhRouter(config-if)#no ip directed-broadcastRouter(config-if)#pos flag s1s0 2Router(config-if)#no shutdown Router(config-if)#exitRouter(config)#exitRouter#loopback 接口的配置Router(config)#int loopback 08Router(config-if)#ip address 192.167.167.6 255.255.255.255Router(config-if)#no

24、ip route-cacheRouter(config-if)#no ip mroute-cacheRouter(config-if)#exitRouter(config)#exitRouter#静态路由的配置命令格式:ip route Router(config)#ip route 59.65.96.0 255.255.240.0 222.112.37.1Router(config)#动态路由配置一、RIP 动态路由协议的配置1、 RIP 的基本配置Router(config)#router ripRouter(config-router)#network 159.105.0.0Router

25、(config-router)#network 212.112.7.0Router(config-router)#exitRouter(config)#exitRouter#2、 RIP 的高级配置a、配置被动接口Router(config)#router rip Router(config-router)#passive-interface ethernet 0Router(config-router)#exitRouter(config)#exitRouter#b、配置路由过滤Router(config)#access-list 12 deny anyRouter(config)#rout

26、er ripRouter(config-router)#distribute-list 12 in ethernet0Router(config-router)#endRouter#c、配置管理距离Router(config)#router rip Router(config-router)#distance 50Router(config-router)#exitRouter(config)#exitRouter#d、定义邻居路由器Router(config)#router rip 9Router(config-router)#neighbor 202.112.7.2Router(confi

27、g-router)#exitRouter(config)#exitRouter#二、OSPF 动态路由协议的配置1、 OSPF 的基本配置(1 )使用 network 命令定义参与 OSPF 的子网地址a、单个 IP 地址参与 OSPFRouter(config)#router ospf 63Router(config-router)#network 131.107.25.1 0.0.0.0 area 0Router(config-router)#exitRouter(config)#exitRouter#b、网络地址参与 OSPFRouter(config)#router ospf 63Ro

28、uter(config-router)#network 133.181.0.0 0.0.255.255 area 0Router(config-router)#exitRouter(config)#exitRouter#(2 )使用 area range 命令定义参与 OSPF 的子网地址Router(config)#router ospf 63Router(config-router)#area 0 range 212.37.123.0 255.255.255.0Router(config-router)#exitRouter(config)#exitRouter#2、几个常用 OSPF 参

29、数的配置(1 )配置被动接口a、路由器的配置命令Router(config)#router ospf 63Router(config-router)#passive-interface ethernet 0Router(config-router)#endRouter#b、第三层交换机的配置命令Router(config)#router ospf 63Router(config-router)#passive-interface vlan37Router(config-router)#endRouter#(2)配置路由过滤Router(config)#access-list 12 deny a

30、nyRouter(config)#router ospf 63Router(config-router)#red-list 12 in serial 0Router(config-router)#endRouter#(3)配置管理距离10Router(config)#router ospf 63Router(config-router)#distance 10Router(config-router)#endRouter#(4)配置引入外部路由到 OSPF 的参数a、配置 OSPF 引入外部路由的花费值Router(config)#router ospf 63Router(config-rou

31、ter)#redistribute metric 100Router(config-router)#end Router#b、配置引入外部路由时缺省的标记值Router(config)#router ospf 63Router(config-router)#redistribute tag 10Router(config-router)#endRouter#c、配置引入外部路由时缺省的外部路由类型Router(config)#router ospf 63 Router(config-router)#redistribute connected metric-type 1 subnetsRout

32、er(config-router)#endRouter#3、一个 OSPF 路由协议的配置信息(1 )路由器的 OSPF 路由协议的配置信息router ospf 63 area 0 range 166.105.0.0 255.255.0.0area 0 range 212.112.7.0 255.255.255.0. Cisco 发现协议 (CDP)Cisco 发现协议 (CDP) 属于 OSI 第 2 层协议,工作在 Cisco 设备(如路由器和交换机)之间。CDP 消息包含有关设备的信息,如设备 ID、平台、连接的接口、 IOS 版本以及第 3 层地址。因为 CDP 工作在第 2 层,所以只有直接相连的设备才能交换信息。show cdp 输出中会显示计时器信息和版本信息 show cdp interface 输出中会显示路由器上所有接口的计时器信息show cdp neighbors 查看 CDP 邻居信息show cdp entry R2 显示路由器 R2 更为详细的信息show cdp entry *=show cdp neighbors detail 显示所有直接相连设备的详细信息no cdp enable 命令在该接口上禁用 CDP

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报