萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 網路安全 >  >> 網路應用技術 >> 應用程式教學

網咖交換機配置實戰教學:從 Console 連線到基礎設定

網咖交換機配置是網管必修課。本文以圖文步驟帶您完成Console 連線建立、超級終端機設定、基礎管理 IP 配置全流程。

前置準備

  • Console 線(RJ-45 轉 DB-9/USB)
  • 管理電腦:Windows 2003/2008/10/11 均可
  • 終端軟體:Putty / Tera Term / SecureCRT(現代替代超級終端機)

步驟 1:檢查/安裝終端軟體

Win10/11 內建無超級終端機,建議下載 Putty(免費、支援 SSH/Serial/Logging)。

步驟 2:建立 Serial 連線

  1. Console 線連接交換機 Console 埠與電腦 COM 埠(或 USB 轉接器)。
  2. 開啟 Putty → Connection type 選 Serial → Serial line 填入 COM1(或裝置管理員查到的 COMx)。
  3. Speed 設定 9600(大多數交換機預設),Data bits 8, Stop bits 1, Parity None, Flow control None。
  4. 點選 Open,按 Enter 應出現 Switch> 提示符。

步驟 3:進入特權模式與全域配置

Switch> enable
Switch# configure terminal
Switch(config)#

步驟 4:配置管理 IP(VLAN 1 或專用管理 VLAN)

Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.1.254 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# ip default-gateway 192.168.1.1   ! 指向上層路由器

步驟 5:啟用 SSH 遠端管理(安全替代 Telnet)


Switch(config)# ip domain-name netcafe.local
Switch(config)# crypto key generate rsa modulus 2048
Switch(config)# ip ssh version 2
Switch(config)# line vty 0 15
Switch(config-line)# transport input ssh
Switch(config-line)# login local
Switch(config-line)# exit
Switch(config)# username admin privilege 15 secret StrongP@ssw0rd

步驟 6:基礎安全強化

  • service password-encryption 加密所有明文密碼。
  • banner motd # Unauthorized access prohibited! # 登入警告。
  • logging buffered 40960 logging trap notifications logging host 192.168.1.100 送 Syslog。
  • spanning-tree portfast default spanning-tree bpduguard default 存取埠加速與保護。

步驟 7:儲存與驗證


Switch(config)# end
Switch# write memory
Switch# show running-config | include ip address
Switch# show ip ssh
Switch# copy running-config startup-config

常見問題排查

現象可能原因對策
Putty 開啟無回應COM 埠號錯誤/驅動未裝/波特率不符裝置管理員確認 COM 埠、調整 Speed 9600/115200
輸入亂碼Flow control 設定錯誤設為 None
無法 SSH 登入未生成 RSA 金鑰/未建立本地用戶/未開啟 vty transport ssh依步驟 5 逐項檢查

完成上述配置,交換機即具備遠端安全管理、基礎存取安全、可監控日誌能力,可投入網咖生產環境。

copyright © 萬盛學電腦網 all rights reserved