彙整 Cisco IOS 核心配置指令,按功能模組分類:標準/擴展/命名 ACL、DCE 時鐘速率、PPP 封裝與 CHAP/PAP 認證 (單向/雙向)、NAT 動態靜態、VTY 遠端管理、動態路由啟用。每模組提供可直接套用的配置片段與關鍵參數說明。
access-list 10 permit 192.168.1.0 0.0.0.255
interface Gig0/1
ip access-group 10 in
access-list 101 permit tcp 192.168.1.0 0.0.0.255 host 1.1.1.1 eq 80
access-list 101 deny ip any any log
interface Gig0/1
ip access-group 101 out
ip access-list extended WEB_ALLOW
permit tcp any host 1.1.1.1 eq 80
permit tcp any host 1.1.1.1 eq 443
deny ip any any log
interface Gig0/1
ip access-group WEB_ALLOW in
show controllers Serial0/0 ! 確認 DCE
interface Serial0/0
clock rate 64000 ! bps,常見 64k/128k/256k/2M
username RouterB password Secret123
! Server 端
interface Serial0/0
encapsulation ppp
ppp authentication pap
! Client 端
interface Serial0/1
encapsulation ppp
ppp pap sent-username RouterA password Secret123
! Router A
username RouterB password Secret123
interface Serial0/0
encapsulation ppp
ppp authentication chap
ppp chap hostname RouterA
ppp chap password Secret123
! Router B
username RouterA password Secret123
interface Serial0/1
encapsulation ppp
ppp authentication chap
ppp chap hostname RouterB
ppp chap password Secret123
access-list 1 permit 192.168.1.0 0.0.0.255
interface Gig0/0
ip nat inside
interface Gig0/1
ip nat outside
ip nat inside source list 1 interface Gig0/1 overload
ip nat inside source static tcp 192.168.1.10 80 203.0.113.5 8080 extendable
line vty 0 15
password VtyPass
login local
transport input ssh
exec-timeout 10 0
access-class 23 in
! OSPF
router ospf 1
router-id 1.1.1.1
network 192.168.1.0 0.0.0.255 area 0
passive-interface default
no passive-interface Gig0/0
! EIGRP
router eigrp 100
network 10.0.0.0
no auto-summary
! BGP
router bgp 65001
neighbor 1.1.1.2 remote-as 65002
address-family ipv4
network 192.168.1.0 mask 255.255.255.0
hostname R1
enable secret StrongPass
service password-encryption
no ip domain-lookup
ip domain-name corp.local
crypto key generate rsa modulus 2048
ip ssh version 2
ntp server 192.168.100.10
logging host 192.168.100.50
logging trap notifications