精簡整理 Cisco 路由器最核心的 5 大功能模組配置指令,適合考證複習與現場速查。
router rip
network 172.17.0.0
passive-interface fastethernet 0/1
neighbor 172.17.12.67
version 2
no auto-summary
interface fastethernet 0/1
ip rip send version 1
ip rip receive version 2
no ip split-horizon
router ospf 10
network 192.168.10.0 0.0.0.255 area 0
area 1 stub
area 1 stub no-summary # Totally Stubby
area 1 nssa
area 25 range 172.16.0.0 255.240.0.0
area 100 virtual-link 192.168.100.33
# LSA 資料庫檢視
show ip ospf database router 192.168.30.10
show ip ospf database network 192.168.17.18
show ip ospf database summary 172.16.121.0
show ip ospf database asbr-summary
show ip ospf database external 10.83.10.0
show ip ospf database nssa-external
interface fastethernet 0/0
standby 172 ip 172.16.10.254
standby 47 priority 150
standby 47 preempt
standby 47 timers 2 9
standby 47 track serial 0 100
show standby brief
# 標準 ACL
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 deny 192.168.10.2 0.0.0.255
access-list 1 permit any
access-list 1 permit host 172.30.16.29
# 延伸 ACL
access-list 101 deny tcp 172.16.4.0 0.0.0.255 172.16.3.0 0.0.0.255 eq 21
# 命名 ACL
ip access-list extended cisco
# 奏用
interface fastethernet 0/0
ip access-group 1 in
ip access-group 1 out
interface serial 0
ip address 61.159.62.129 255.255.255.248
ip nat outside
interface ethernet 0
ip address 192.168.100.1 255.255.255.0
ip nat inside
ip nat inside source static 192.168.100.2 61.159.62.130
access-list 1 permit 192.168.100.0 0.0.0.255
ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.248
ip nat inside source list 1 pool chen
interface serial 0; ip nat outside
interface ethernet 0; ip nat inside
access-list 1 permit 192.168.100.0 0.0.0.255
ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.248
ip nat inside source list 1 pool chen overload
interface serial 0; ip nat outside
interface ethernet 0; ip nat inside
關鍵差異: 靜態 NAT 適合伺服器發布;動態 NAT 需公網 IP 池等同內部主機數;PAT 單一公網 IP 承載眾多內部主機,企業上網首選。