通過telnet訪問路由器(通過telnet訪問路由器實驗)
本實驗通過PNET Lab 4.2.9為基礎環境,使用vios-adventerprisek9-m.SPA.159-3.M3鏡像演示。
思科15.x 版本之后需要加上transport input telnet 這條命令才能事先telnet訪問。
網絡結構
第一部分 配置
1、通過PNET Lab在實驗室中網絡環境搭建
前面已經寫過相關操作步驟,在此不在贅述。
2、telnet訪問客戶端路由器設置
Router>enable // 進入特權模式
------------------------------------------------------------------------------------------------
Router#configure terminal // 進入全局模式
Router(config)#hostname R1 // 更改路由器名字
------------------------------------------------------------------------------------------------
R1(config)#interface GigabitEthernet 0/0 // 進入串行接口G0/0配置模式
R1(config-if)#ip address 12.1.1.1 255.255.255.0 //配置串行接口G0/0 ip地址
R1(config-if)#no shutdown //啟用端口
3、telnet服務器端路由器設置
Router>enable //進入特權模式
------------------------------------------------------------------------------------------------
Router#configure terminal //進入全局模式
Router(config)#hostname R2 //更改路由器名字
R2(config)#enable password cisco //配置特權模式密碼
------------------------------------------------------------------------------------------------
R2(config)#interface GigabitEthernet 0/0 //進入串行接口G0/0配置模式
R2(config-if)#ip address 12.1.1.2 255.255.255.0 //配置串行接口G0/0 ip地址
R2(config-if)#no shutdown //啟用端口
------------------------------------------------------------------------------------------------
R2(config-if)#line vty 0 4 //配置vty線路
R2(config-if)#transport input telnet//允許遠程連接的協議
R2(config-line)#password cisco //配置遠程登錄密碼
R2(config-line)#login //允許登錄
R2(config-line)#exit //退回到上一級
------------------------------------------------------------------------------------------------
R2(config)#line console 0 //配置console端口模式
R2(config-line)#logging synchronous //配置日志同步
第二部分 測試
1、查看本地接口狀態
R1#show interface stats
2、測試網絡是否正常
R1#ping 12.1.1.2
3、通過telnet遠程連接路由器
R1#telnet 12.1.1.2