A-A+

CISCO路由器基本配置模式和步骤

2016年01月04日 站长资讯 暂无评论

CISCO路由器的一般配置步骤:

  1. Router>  
  2. Router>enable  
  3. Router#conf t  
  4. Router#conf t  
  5. Enter configuration commands, one per line.  End with CNTL/Z.  
  6. Router(config)#line console 0 /*设置从全局配置模式进入控制台线路配置模式*/  
  7. Router(config-line)#password cisco /*设置cisco为控制台密码,下次当用户使用超级终端进入控制台时,就必须先输入正确的密码*/  
  8. Router(config-line)#logging  synchronous /*启用同步,在输入Cisco命令时不会因为router自动发送信息而被它隔断,以致变成一个错误的Cisco命令,结果使输入的命令不正确。启用同步后路由器会在显示启动端口信息或发送路由信息之后,将光标返回到命令输入的后面,方便用户继续输入完整的命令。*/  
  9. Router(config-line)#exec-timeout 0 0 /*定义控制台EXEC会话超时时间。此例中设置为0 0,意思是0分0秒(即永不超时),在实际应用中,出于安全性考虑,并不建议这样设置。*/  
  10. Router(config-line)#exit  /*在任何状态下执行此命令均返回上级模式*/   
  11. Router(config)#hostname R1 /*配置路由器的名称为R1*/   
  12. R1(config)#enable password cisco /*配置路由器由用户模式进入特权模式密码(明文密码用show running-config可以查看)为cisco*/   
  13. R1(config)#enable secret cisco /*配置路由器由用户模式进入特权模式密码(加密密码用show running-config无法查看)为cisco,该命令设置的密码优先级高于enable password设置的密码*/   
  14. R1(config)#no ip domain-lookup /*关闭域名解析,打错命令时不会发送广播包,这样可以节省时间;如果打开域名解析则发送广播包到域中查找这个命令,这将会浪费时间。*/   
  15.    
  16. R1(config)#line vty 0 4  /*进入虚拟终端线路配置模式线路配置模式*/  
  17. R1(config-line)#password cisco /*设置cisco为远程登录的虚拟终端密码*/  
  18. R1(config-line)#login /*设置当用户路由器进行telnet时,路由器会给用户提示,要求输入密码*/  
  19. R1(config-line)#end  /*返回特权模式*/  
  20.    
  21. R1#show ip interface brief   /*查看路由器的接口信息*/  
  22. Interface              IP-Address      OK? Method Status                Protocol  
  23.    
  24. GigabitEthernet0/0     unassigned      YES unset  administratively down down  
  25.    
  26. GigabitEthernet0/1     unassigned      YES unset  administratively down down  
  27.    
  28. Vlan1                  unassigned      YES unset  administratively down down  
  29. R1#conf t /*进入全局配置模式*/  
  30.    
  31. R1(config)#interface g0/0  /*进入快速以太网口g0/0的接口配置模式*/  
  32. R1(config-if)#ip address 192.168.1.1 255.255.255.0  /*配置接口的IP地址与子网掩码*/  
  33. R1(config-if)#no shutdown  /*启用该端口*/  
  34.    
  35. R1#end http://www.luyouqiwang.com/cisco/  
  36. R1#copy running-config  startup-config /*保存相关配置*/  
  37. Destination filename [startup-config]?   
  38. Building configuration...  
  39. [OK]  

其他设置说明

一、设置端口描述信息

1.设置端口描述信息

  1. Router>enable   
  2. Router#configure  terminal   
  3. Router(config)# interface   fa0/0   
  4. Router(config-if)# description link to gdgm  /*描述该端口是用于连接到gdgm*/   
  5. Router(config-if)# end  

2.查看端口描述信息

Router#show interface fa0/0

二、设置路由器登录欢迎信息

  1. Router>enable   
  2. Router#configure  terminal   
  3. Router(config)# banner motd #  /*mode后的#号不能少,#前面也必须有空格*/ Welcome to gdgm #             /*两个#号要配对,中间的内容为欢迎信息*/   
  4. Router(config)#end   
  5. Router#exit  /*退出特权模式并重新进入用户模式时显示路由器登录信息*/   
  6. Press RETURN to get started Welcome to gdgm   
  7. Router>   

三、设置时区、时间和日期

1.查看路由器时间 Router#show clock 2.设置时区

  1. Router#config terminal   
  2. Router(config)#clock timezone Peking +8   
  3. Router(config)#end 3.设置时间与日期   
  4. Router#clock set 08:10:00 may 10 2007   

四、查看路由器的相关信息

1.查看路由器的IOS版本、内存和flash大小,路由器接口参数及配置登记值等参数。

Router# show version

2.查看路由器flash的大小和IOS系统文件大小及其IOS的文件名。

Router#show flash

3.查看路由器CPU资源的使用率。

Router#show processes

4.查看动态内存的大小及一些相关的信息。

Router#show memory

5.查看路由器当前正在运行的配置信息即RAM中的配置信息。

Router# show running-config

6.查看路由器保存在NVRAM中的startup-config配置文件的内容。

Router# show startup-config

7.查看登录到路由器的用户情况

Router# show user

8.查看路由器所有接口的摘要信息。

Router#show ip interface brief

9.查看路由器某接口当前运行状态信息。

Router#show running-config interface Fa0/0

10.查看路由器某接口的完整信息

Router#show interface serial 0

11.查看路由器连接线缆类型(DTE和TCE就是使用此命令查看区分的)

Router#show controllers serial 0

12.查看路由器访问控制列表

Router#show access-list

标签:

给我留言