二、登录方式代码
要求:
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 4 Router(config-line)#pas Router(config-line)#password cisco Router(config-line)#login Router(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.1 Password: Password: Router>en Password: Router#conf Configuring 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设置 config ip http server ip domain www.cisco.com<br> HTTP网页登录成功 |
用户名输入命令行中的用户名R1 密码输入telnet的密码