文章目錄
- Telnet
- server
- client
- 總結
提示:以下是本篇文章正文内容,下面案例可供參考
Telnet
步驟:
1.伺服器上設定管理IP
2.開啟Telnet功能
3.設定Telnet模式為密碼模式
4.設定明文/密文密碼
5.客戶機上設定管理IP
6.客戶機驗證Telnet伺服器是否可以登入
server
<Huawei>undo terminal monitor 關閉傳輸資訊
<Huawei>system-view 進入系統視圖
[Huawei]sysname SW1 給交換機命名為SW1
[SW1]user-interface console 0 進入console0接口
[SW1-ui-console0]idle-timeout 0 0 設定使用者界面永不逾時
[SW1-ui-console0]quit 退出console0接口
[SW1]interface Vlanif 1 進入交換機虛拟接口
[SW1-Vlanif1]ip address 192.168.1.5 255.255.255.0 設定伺服器IP位址
[SW1-Vlanif1]quit 退出到系統視圖
[SW1]user-interface vty 0 4 進入telnet
[SW1-ui-vty0-4]authentication-mode password 設定驗證模式為密碼模式
[SW1-ui-vty0-4]set authentication password simple huawei 設定明文密碼huawei
[SW1-ui-vty0-4]user privilege level 3 設定使用者權限為管理者級
[SW1-ui-vty0-4]return 退出到使用者視圖
<SW1>save 儲存目前配置檔案
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y 輸入y确認
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 0.
Save the configuration successfully. 表示儲存成功
<SW1>
client
<Huawei>undo terminal monitor 關閉傳輸資訊
<Huawei>system-view 進入系統視圖
[Huawei]sysname client 給交換機命名為client
[client]user-interface console 0 進入console0接口
[client-ui-console0]idle-timeout 0 0 設定使用者界面永不逾時
[client-ui-console0]quit 退出console0接口
[client]interface Vlanif 1 進入交換機虛拟接口
[client-Vlanif1]ip address 192.168.1.10 255.255.255.0 設定伺服器IP位址
[client-Vlanif1]return 退出到使用者視圖
<client>ping 192.168.1.5 ping伺服器
PING 192.168.1.5: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.5: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 192.168.1.5: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.1.5: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 192.168.1.5: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.1.5: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.5 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/42/60 ms
<client>telnet 192.168.1.5 遠端連接配接伺服器
Trying 192.168.1.5 ...
Press CTRL+K to abort
Connected to 192.168.1.5 ...
Login authentication
Password: 輸入密碼
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2021-08-05 20:04:11.
<SW1> 顯示出伺服器名字說明連接配接成功
總結
1.交換機的實體接口是不能配置IP位址的,交換機有一個預設的虛拟接口vlan1,我們可以給預設虛拟接口配置IP,即給二層交換機配置一個管理IP。
2.undo shutdown 開啟接口,交換機的實體接口預設是開啟狀态,不需要輸入這條指令,路由器需要。
3.設定明文密碼用simple,設定密文密碼用cipher
4.目前配置檔案斷電後會丢失,是以需要在使用者視圖下輸入save儲存目前配置檔案。