針對採用 PPPoE 撥號的 ADSL/VDSL 環境,Cisco ISR 系列路由器需配置 VPDN、Dialer 介面、PPP 認證、NAT Overload 與預設路由。本文提供 1841 實測可用的完整配置腳本,並解釋各區塊功能。
vpdn enable
no vpdn logging
!
interface Ethernet0/0
ip address 192.168.0.1 255.255.255.0
ip nat inside
no ip mroute-cache
!
interface Ethernet0/1
no ip address
pppoe enable
pppoe-client dial-pool-number 1
!
interface Dialer1
ip address negotiated
ip nat outside
ip mtu 1492
encapsulation ppp
no ip mroute-cache
dialer pool 1
dialer-group 1
ppp authentication pap callin
ppp pap sent-username ISP帳號 password ISP密碼
!
ip classless
no ip http server
!
dialer-list 1 protocol ip permit
ip nat inside source list 1 interface Dialer1 overload
ip route 0.0.0.0 0.0.0.0 Dialer1
access-list 1 permit 192.168.0.0 0.0.0.255
!
line con 0
exec-timeout 0 0
transport input none
line vty 0 4
login local
!
end
| 區塊 | 功能 | 關鍵參數 |
|---|---|---|
| VPDN | 啟用虛擬專用撥號網絡,PPPoE 依賴此架構 | vpdn enable |
| PPPoE Client | 實體介面綁定撥號池 | pppoe-client dial-pool-number 1 |
| Dialer 介面 | 邏輯撥號介面,承載 PPP 協商、IP 協商、NAT Outside | ip address negotiated、ip mtu 1492(PPPoE 頭部 8 bytes) |
| PPP 認證 | PAP/CHAP 由 ISP 決定,範例用 PAP | ppp pap sent-username ... |
| NAT Overload | 內網 192.168.0.0/24 共用 Dialer1 動態公網 IP | ip nat inside source list 1 interface Dialer1 overload |
| 預設路由 | 指向 Dialer1,確保未知流量走撥號隧道 | ip route 0.0.0.0 0.0.0.0 Dialer1 |
show pppoe session、debug pppoe events、debug ppp negotiation;確認 Modem 為橋接模式、VPI/VCI 正確。ip tcp adjust-mss 1452 在 LAN 介面。ppp authentication chap callin + ppp chap hostname ... ppp chap password ...。ip nat inside/outside 介面方向正確,ACL 1 匹配內網網段。