实验2:通过 Telnet访问路由器
1、实验拓扑
2.实验步骤
(1) 配置路由器以太网接口IP地址
路由器开机后,如果出现以下提示,我们回答“ n”结束该模式,如下: ---System Configuration Dialog--- Continue with configuration dialog? [yes/no]: Router>enable //进入路由器的模式 Router# Router#configure terminal //进入路由器的全局配置模式 Router(config)# Router(config)#interface fastEthernet 0/0 Router(config-if)# //进入路由器的以太网口fastEthernet 0/0接口,fastEthernet表示快速以太网,0/0表示是第0个插槽中的第0个接口,Serial0/0/0则表示为第0个插槽中的第0个模块上的第0个串行接口 Router(config-if)#ip address 172.16.0.1 255.255.255.0 //配置接口的IP地址 Router(config-if)#no shutdown //打开接口,默认时,路由器的所有接口都是关闭的,这一点和交换机有很大的差别。默认时,交换机所有的接口都是打开的。 Router(config-if)#end //退出全局配置模式,回到模式下
(2) 配置路由器密码 Router#configure terminal Router(config)#line vty 0 4 //进入路由器的VTY虚拟终端,“vty 0 4”表示vty 0~vty 4,共5个虚拟终端 Router(config-line)#password CISCO //配置vty的密码,即Telnet密码 Router(config-line)#login Router(config-line)#exit //回到上一级模式下 Router(config)#enable password CISCO //是配置进入到路由器模式的密码 Router(config)#end
(3)通过Telnet访问路由器
在计算机上配置网卡的IP地址为172.16.0.100/255.255.255.0,并打开DOS命令行窗口。首先测试计算和路由器的IP连通性,再进行 Telnet远程登录。如下: PC>ping 172.16.0.1 Pinging 172.16.0.1 with 32 bytes of data: Reply from 172.16.0.1: bytes=32 time=141ms TTL=255 Reply from 172.16.0.1: bytes=32 time=62ms TTL=255 Reply from 172.16.0.1: bytes=32 time=47ms TTL=255 Reply from 172.16.0.1: bytes=32 time=63ms TTL=255 Ping statistics for 172.16.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 47ms, Maximum = 141ms, Average = 78ms //以上表明计算机能PING通路由器接口“ fastEthernet0/0”的IP地址 PC>telnet 172.16.0.1 //从计算机Telnet路由器以太网卡上的IP地址 Trying 172.16.0.1 ...Open User Access Verification Password: Router>enable Password: Router# //输入VTY的密码CISCO,输入enable 的密码CISCO,能正常进入路由器的模式