一、基礎路由器檢視指令
| 指令 | 用途 |
show version | 顯示 IOS 版本、硬體資訊、啟動時間、配置暫存器值 |
show processes | 查看 CPU 使用率、進程狀態 |
show protocols | 顯示已啟用的路由協議與介面狀態 |
show memory | 記憶體使用統計 |
show ip route | 顯示路由表 |
show startup-config | 查看 NVRAM 中的啟動配置 |
show running-config | 查看記憶體中當前生效配置 |
show flash | 顯示 Flash 記憶體檔案清單 |
show interfaces | 介面詳細狀態、計數器、錯誤統計 |
二、基礎路由配置指令
1. 進入配置模式
config terminal ! 從終端機進入全域配置模式
config memory ! 從 NVRAM 載入配置
config network ! 從 TFTP 伺服器載入配置
2. 常用配置指令
| 功能 | 指令範例 |
| 主機名稱 | hostname R1 |
| 登入橫幅 | banner motd # Authorized Access Only # |
| 介面進入 | interface serial 0/0 |
| VTY 密碼 | line vty 0 4 login password cisco |
| 啟用密碼 | enable secret cisco123(加密)
enable password cisco(明文) |
3. 介面參數配置(序列介面為例)
interface serial 0/0
clock rate 64000 ! DCE 端設定時鐘速率
bandwidth 56 ! 設定頻寬(預設 56 Kbps)
no shutdown ! 啟用介面
write memory ! 存檔
4. 開機與註冊值
boot system flash c2600-ik9s-mz.124-15.T7.bin
boot system tftp c2600-ik9s-mz.124-15.T7.bin 192.168.1.100
boot system rom
config-register 0x2102 ! 正常開機載入 NVRAM 配置
5. CDP 鄰居探索
show cdp neighbors detail
show cdp entry R2
6. IP 位址與主機名解析
ip address 192.168.1.1 255.255.255.0
ip host R2 192.168.1.2
ip name-server 8.8.8.8 8.8.4.4
ip domain-lookup
show hosts
ping R2
trace R2
三、IP 路由配置
1. 靜態路由
ip routing
ip route 10.0.0.0 255.0.0.0 serial 0/0 permanent
2. 預設路由
ip default-network 192.168.1.0
3. 動態路由協議
RIP
router rip
network 192.168.1.0
network 10.0.0.0
show ip route
show ip protocols
debug ip rip
OSPF
router ospf 1
redistribute rip
network 192.168.1.0 0.0.0.255 area 0
area 0 range 10.0.0.0 255.0.0.0
area 0 default-cost 10
ip ospf priority 10
ip ospf cost 10
show ip ospf database
BGP
router bgp 65001
redistribute ospf 1
network 192.168.1.0 mask 255.255.255.0
aggregate-address 10.0.0.0 255.0.0.0 summary-only
neighbor 192.168.1.2 remote-as 65002
四、流量控制與存取控制
1. 被動介面
passive-interface serial 0/0
2. ACL 存取控制清單
! 標準 ACL(全域)
access-list 1 permit 192.168.1.0 0.0.0.255
! 延伸 ACL(全域)
access-list 101 permit tcp any host 192.168.1.10 eq 80
! 套用於介面
interface serial 0/0
ip access-group 101 in
! 路由發佈過濾
router rip
distribute-list 1 out serial 0/0
3. Null 0 路由(黑洞路由)
ip route 192.168.100.0 255.255.255.0 null 0
五、廣域網封裝配置
1. PPP
encapsulation ppp
ppp authentication chap
ppp chap hostname R1
ppp chap password cisco
2. X.25
encapsulation x25 dce
x25 address 123456
x25 map ip 192.168.1.2 123456
x25 pvc 1 192.168.1.2 123456
x25 route 123456 interface serial 0/0 123456
3. Frame Relay
frame-relay interface-dlci 100
frame-relay map ip 192.168.1.2 100 broadcast
frame-relay lmi-type ansi
備註:本手冊彙整 Cisco IOS 經典指令集,適用於 CCNA/CCNP 考試複習與實務操作速查。實際部署請依據網路拓撲、IOS 版本與安全策略調整參數。