路由器基本配置命令-如何用命令配置路由器

小编:小丢 更新时间:2022-08-03


1.1:配置console永不超时命令。

1.2:配置console的日志同步,关闭域名解析。

1.3:配置设备时间。

1.4:配置console密码,特权模式密码,VTY线路密码。

1.5:配置标识符(banner)和接口描述信息。

路由器基本配置命令-如何用命令配置路由器

拓扑图

Router>enable //特权模式

Router#configure terminal //全局配置模式

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1 //配置设备名字为R1

R1(config)#line console 0 //进入console 0接口

R1(config-line)#exec-timeout 0 0 //配置console永不超时。

R1(config-line)#logging synchronous // 配置console日志同步,输入命令时不会被信息打断。

R1(config)#no ip domain lookup //关闭域名解析

R1#clock set 20:24:29 4 oct 2020 //修改设备时间为20:24:29 4 oct 2020

R1(config)#clock timezone GMT +8 //修改时区

R1#show clock //查看设备时间

04:25:52.732 GMT Mon Oct 5 2020

R1(config)#line console 0 //进入console 0接口

R1(config-line)#password cisco //配置console密码cisco

R1(config-line)#login //配置使上述密码生效,且登入时需要密码。

R1(config)#enable password cisco //配置特权enable明文密码cisco

R1(config)#enable secret cisco //配置特权enable密文密码cisco

The enable secret you have chosen is the same as your enable password.

This is not recommended. Re-enter the enable secret. //密文密码生效。

R1(config)#line vty 0 4 //进入vty虚拟线路

R1(config-line)#password cisco //配置VTY密码cisco

R1(config-line)#login //配置使上述密码生效,且登入时需要密码。

R1(config)#service password-encryption //配置使明文密码显示加密,保证安全。

R1(config)#banner motd # //配置标识符,登入设备时显示信息以#开始。

Enter TEXT message. End with the character '#'. //表示以#结尾

hello word //标识的内容

# //和开始的符号一致,表示以#结尾。

R1(config)#interface ethernet 0/0 //进入接口E0/0

R1(config-if)#ip address 12.1.1.1 255.255.255.0 //配置IP地址为12.1.1.1

R1(config-if)#description R1toR2 //配置接口描述信息R1toR2