拓扑图

image.png

路由器配置

教程

  1. 第一步:在路由器上配置路由器名和fastethernet0端口的IP地址
  2. Red-Giant>enable !进入特权模式
  3. Red-Giant # configure terminal !进入全局配置模式
  4. Red-Giant (config)# hostname RouterA !配置路由器名称为 RouterA
  5. RouterA(config)# interface fastethernet 0 !进入路由器接口配置模式
  6. RouterA(config-if)# ip address 192.168.0.138 255.255.255.0 !配置路由器管理接口IP地址
  7. RouterA(config-if)# no shutdown !开启路由器fastethernet0接口

操作

路由器

第一步:在路由器上配置路由器名和fastethernet0端口的IP地址

image.png

  1. #configure terminal
  2. (config)#hostname ZWF_201921098102
  3. ZWF_201921098102(config)#interface fastethernet0/0
  4. ZWF_201921098102(config-if)#ip address 192.168.0.138 255.255.255.0
  5. ZWF_201921098102(config-if)#no shutdown
  6. ZWF_201921098102(config-if)#exit
  7. ZWF_201921098102(config)#exit
  8. ZWF_201921098102#
  9. 测试连接代码
  10. ZWF_201921098102#show ip interface fastethernet0/0

image.png
验证测试:验证路由器接口fastethernet0的IP地址已经配置和开启
RouterA#show ip interface fastethernet0 !验证接口fastethernet0的IP地址已经配置和开启
或RouterA#show ip interface brief !验证接口fastethernet0的IP地址已经配置和开启

第二步:配置路由器远程登录密码

  1. 第二步:配置路由器远程登录密码
  2. RouterA(config)# line vty 0 4 !进入路由器线路配置模式
  3. RouterA(config-line)# login !配置远程登录
  4. RouterA(config-line)# password star !设置路由器远程登录密码为 star
  5. RouterA(config-line)#end
  1. ZWF_201921098102#configure terminal
  2. Enter configuration commands, one per line. End with CNTL/Z.
  3. ZWF_201921098102(config)#line vty 0 4
  4. ZWF_201921098102(config-line)#login
  5. % Login disabled on line 66, until 'password' is set
  6. % Login disabled on line 67, until 'password' is set
  7. % Login disabled on line 68, until 'password' is set
  8. % Login disabled on line 69, until 'password' is set
  9. % Login disabled on line 70, until 'password' is set
  10. ZWF_201921098102(config-line)#password star
  11. ZWF_201921098102(config-line)#end
  12. ZWF_201921098102#
  13. %SYS-5-CONFIG_I: Configured from console by console
  14. ZWF_201921098102#

image.png
验证测试:验证从PC机可以通过网线远程登录到路由器上
C:>telnet 192.168.0.138 !从PC机登录到路由器上

第三步:配置路由器特权模式密码

  1. RouterA(config)#enable password star
  1. ZWF_201921098102>
  2. ZWF_201921098102>enable
  3. ZWF_201921098102#configure terminal
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. ZWF_201921098102(config)#enable password star
  6. ZWF_201921098102(config)#

image.png
验证测试:验证从PC机通过网线远程登录到路由器上后可以进入特权模式
C:>telnet 192.168.0.138 !从PC机登录到路由器上
image.png
image.png

第四步:保存在路由器上所做的配置

  1. RouterA# copy running-config startup-config ! 保存路由器配置
  2. RouterA# write memory
  1. ZWF_201921098102(config)#exit
  2. ZWF_201921098102#
  3. %SYS-5-CONFIG_I: Configured from console by console
  4. ZWF_201921098102#write memory
  5. Building configuration...
  6. [OK]
  7. ZWF_201921098102#

image.png
验证
验证测试:验证路由器配置已保存
RouterA#show startup-config ! 验证路由器配置已保存
image.png

收尾:

RouterA#erase startup-config
RouterA#reload !重启
提示是否保存配置选择“N”
重启后会出现这样的提示:Would you like to enter the initial configuration dialog? 【yes】:N

  1. ZWF_201921098102#erase startup-config
  2. Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
  3. [OK]
  4. Erase of nvram: complete
  5. %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
  6. ZWF_201921098102#reload
  7. Proceed with reload? [confirm]
  8. %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.
  9. System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
  10. Copyright (c) 2000 by cisco Systems, Inc.
  11. cisco 2620 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
  12. Self decompressing the image :
  13. ########################################################################## [OK]
  14. Restricted Rights Legend
  15. Use, duplication, or disclosure by the Government is
  16. subject to restrictions as set forth in subparagraph
  17. (c) of the Commercial Computer Software - Restricted
  18. Rights clause at FAR sec. 52.227-19 and subparagraph
  19. (c) (1) (ii) of the Rights in Technical Data and Computer
  20. Software clause at DFARS sec. 252.227-7013.
  21. cisco Systems, Inc.
  22. 170 West Tasman Drive
  23. San Jose, California 95134-1706
  24. Cisco Internetwork Operating System Software
  25. IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
  26. Technical Support: http://www.cisco.com/techsupport
  27. Copyright (c) 1986-2005 by cisco Systems, Inc.
  28. Compiled Wed 27-Apr-04 19:01 by miwang
  29. cisco 2620 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
  30. .
  31. Processor board ID JAD05190MTZ (4292891495)
  32. M860 processor: part number 0, mask 49
  33. Bridging software.
  34. X.25 software, Version 3.0.0.
  35. 1 FastEthernet/IEEE 802.3 interface(s)
  36. 32K bytes of non-volatile configuration memory.
  37. 63488K bytes of ATA CompactFlash (Read/Write)
  38. --- System Configuration Dialog ---
  39. Continue with configuration dialog? [yes/no]: no
  40. Press RETURN to get started!

image.png