萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 伺服器教學

Cisco 交換機配置命令速查表 (Packet Tracer 實戰版)

整理 Cisco 交換機 (含三層) 基礎配置、VLAN、VTP、介面 IP、密碼、顯示等高頻指令,適合 Packet Tracer 練習與實機快速查閱。

模式切換

Switch> enable              # 特權模式
Switch# configure terminal  # 全域配置模式
Switch(config)# interface f0/1  # 介面配置模式

基本密碼與主機名

hostname SW1
enable secret cisco123      # 加密特權密碼
enable password cisco       # 明文特權密碼 (不建議)
line console 0
 login
 password console123
line vty 0 4
 login
 password vty123

VLAN 與 Trunk

vlan database
 vlan 10 name Sales
 vlan 20 name IT
exit
interface f0/1
 switchport mode access
 switchport access vlan 10
interface f0/24
 switchport mode trunk
 switchport trunk allowed vlan 1,10,20
 switchport trunk encapsulation dot1q

VTP 設定

vtp domain MYDOMAIN
vtp password vtp123
vtp mode server   # 或 client/transparent

管理介面 IP (VLAN 1 / SVI)

interface vlan 1
 ip address 192.168.1.1 255.255.255.0
ip default-gateway 192.168.1.254

三層交換機路由開啟

ip routing
interface vlan 10
 ip address 192.168.10.1 255.255.255.0
interface vlan 20
 ip address 192.168.20.1 255.255.255.0
# 實體埠改為路由埠
interface f0/5
 no switchport
 ip address 10.0.0.1 255.255.255.252

常用 Show 指令

show running-config
show vlan brief
show interfaces status
show vtp status
write memory   # 存檔

掌握上述指令集,即可完成中小型校園/企業網交換機部署與維護。

copyright © 萬盛學電腦網 all rights reserved