二、登录方式代码
要求:
1.console口进入操作界面必须接对口
2.HTTP登录时,登录名称是CISCO路由器名,密码是登录Telnet密码
3.Telnet登录必须在网卡网段与远方设备需同一网段
连线结构如右:

C3电脑绑定了实际物理网卡,在路由器没有设置Telnet时连线无效

![]()
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Telnet设置:需要write后PC登录才能生效Router(config)#line vty 0 4Router(config-line)#pasRouter(config-line)#password ciscoRouter(config-line)#loginRouter(config-line)#exec-timeout 0 10 #0这个位置代表分钟 10这个位置代表秒钟--设置的都是光标退出时间PC输入,提示设置enable密码Router>en% No password set.回路由器输入下列代码Router(config)#enable password 123 ##注意secret的密码优先级比password密码优先级高,并且show run查询的时候在前面Router(config)#do write下面是PC输入的反馈信息pc>telnet 1.1.1.1Password:Password:Router>enPassword:Router#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#Telnet设置成功 |
HTTP设置方式
|
1
2
3
4
|
HTTP设置configip http serverip domain www.cisco.com<br> HTTP网页登录成功 |
用户名输入命令行中的用户名R1 密码输入telnet的密码










