路由器基本配置

分以下5点

  • 最基本的配置
  • 设置路由器的时区、日期和时钟
  • 设置路由器接口的IP地址
  • 设置密码
  • 创建静态hostname表,然后使用该表对直连路由器进行telnet访问

如下

最基本的配置

重命名路由器

1
Router(config)#hostname r2

关闭域名查找

1
r2(config)#no ip domain-lookup

设置输入同步

1
2
r2(config)#line console 0
r2(config-line)#logging synchronous

设置执行会话时间为20分钟

1
r2(config-line)#exec-timeout 2000


设置路由器的时区、日期和时钟

1
2
3
r1#sh clock
r1(config)#clock timezone beijing 8
r1#clock set 10:09:09 mar 31 2010

设置路由器接口的IP地址

1
2
router(config)#int f0/1 //int为interface缩写,以f0/1口为例
router(config-if)#ip add 127.2.2.2 255.255.255.0

设置密码

1
2
3
4
5
6
7
8
9
10
11
12
r3(config)#enable password 111   //设置enable的明文密码
r3(config)#enable secret password 222 //设置enable的密文密码
//如果明文密码,密文密码都设置了;密文的优先级较高,即密文密码有效

//设置本地密码,进入特权模式需要的密码
r3(config)#line console 0
r3(config-line)#password cisco

//设置远程登陆的密码
r3(config)#line vty
r3(config)#line vty 0 4 //设置0~4口,共5个
r3(config-line)#password cisco //将密码设为cisco

创建静态hostname表,然后使用该表对直连路由器进行telnet访问

r3(config)#ip host r3 192.168.23.2
//设置之后,PC机就可以远程管理路由器了