# OpenWrt PPTP 穿透

#### <span style="color: rgb(0, 0, 0);">**安裝模組kmod-nf-nathelper-extra**</span>  


<div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAIBxAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-kmod-nf-nathelper-ex" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_o"><span style="color: rgb(0, 0, 0);">**`kmod-nf-nathelper-extra` 是 OpenWrt 中的一個內核模組軟體包，它的核心功能是<mark class="MAeH" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 500; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sae="" data-sfc-root="ep" data-ved="2ahUKEwjIuMmEg4qXAxVAdvUHHcIPMtYQuJAPegYIAAgHEAE" data-wiz-attrbind="class=iZCSye_r/cFwyDc"><span class="rQesXe MPyX">提供非標準網路協定的 ALG（Application Layer Gateway，應用層網關）支援，解決傳統 NAT（網路地址轉換）無法處理的複雜連線穿透問題</span></mark>。**</span></div><div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAICBAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-%E4%BB%A5%E4%B8%8B%E7%82%BA%E6%82%A8%E6%8B%86%E8%A7%A3%E5%AE%83%E7%9A%84%E5%85%B7%E9%AB%94%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86%E8%88%87%E5%8A%9F%E8%83%BD%EF%BC%9A" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_y"><span style="color: rgb(0, 0, 0);">**以下為您拆解它的具體工作原理與功能：**</span></div><div class="yhAwj" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sfc-cp="" data-sfc-inited="2" data-sfc-root="ep" id="bkmrk-" jsaction="rcuQ6b:&iZCSye_14|npT2md" jscontroller="UTzWVc#U8DOt" jsuid="iZCSye_14"><span style="color: rgb(0, 0, 0);"></span></div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 20px; font-weight: 700; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sae="" data-sfc-cp="" data-sfc-root="ep" data-wiz-attrbind="aria-level=iZCSye_15/fLk2Md" id="bkmrk-1.-%E7%82%BA%E4%BB%80%E9%BA%BC%E9%9C%80%E8%A6%81%E5%AE%83%EF%BC%9F%EF%BC%88%E8%A7%A3%E6%B1%BA-nat-%E7%9A%84%E5%85%88" jsaction="" jscontroller="a7qCn#ZxCkTb" jsuid="iZCSye_15" role="heading"><span style="color: rgb(0, 0, 0);">**1. 為什麼需要它？（解決 NAT 的先天缺陷）**</span></div><div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAIChAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-%E5%82%B3%E7%B5%B1%E7%9A%84-nat%EF%BC%88%E5%A6%82%E5%AE%B6%E7%94%A8%E8%B7%AF%E7%94%B1%E5%99%A8%E7%9A%84-ip-%E5%88%86" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_16"><span style="color: rgb(0, 0, 0);">**傳統的 NAT（如家用路由器的 IP 分享功能）只負責修改 IP 封包表頭的 <span class="rQesXe MPyX">來源/目的 IP</span> 和 <span class="rQesXe MPyX">TCP/UDP 端口號</span>。**</span></div><div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAICxAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-%E4%BD%86%E6%98%AF%EF%BC%8C%E6%9C%89%E4%BA%9B%E5%82%B3%E7%B5%B1%E7%9A%84%E7%B6%B2%E8%B7%AF%E5%8D%94%E5%AE%9A%EF%BC%88%E4%BE%8B%E5%A6%82-pptp" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_1e"><span style="color: rgb(0, 0, 0);">**但是，有些傳統的網路協定（例如 <span class="rQesXe MPyX">PPTP</span>、<span class="rQesXe MPyX">SIP</span>、<span class="rQesXe MPyX">H.323</span>）非常特殊：**</span></div>- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep">它們會把<span class="rQesXe MPyX">內網的私有 IP 或端口號，寫在封包內部的「數據載荷（Data Payload）」裡</span>。</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep">或者是除了標準的 TCP 端口外，還需要建立<span class="rQesXe MPyX">另一條完全不同協定的通道</span>（例如 PPTP 撥號除了 TCP 1723 之外，還必須傳輸 <span class="rQesXe MPyX">GRE 協定</span>的數據）。</span>**</span>

<div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAIDRAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-%E5%A6%82%E6%9E%9C%E5%8F%AA%E9%9D%A0%E6%99%AE%E9%80%9A-nat%EF%BC%8C%E8%B7%AF%E7%94%B1%E5%99%A8%E7%9C%8B%E4%B8%8D%E6%87%82%E4%B9%9F%E6%B2%92%E8%BE%A6" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_20"><span style="color: rgb(0, 0, 0);">**如果只靠普通 NAT，路由器看不懂也沒辦法修改封包裡面的私有 IP，外部伺服器就無法把資料送回內網客戶端，導致連線失敗（這就是 PPTP 常見卡在「正在核對使用者名稱和密碼」或錯誤 619 的原因）。**</span></div><div class="yhAwj" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sfc-cp="" data-sfc-inited="2" data-sfc-root="ep" id="bkmrk--1" jsaction="rcuQ6b:&iZCSye_26|npT2md" jscontroller="UTzWVc#U8DOt" jsuid="iZCSye_26"><span style="color: rgb(0, 0, 0);"></span></div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 20px; font-weight: 700; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sae="" data-sfc-cp="" data-sfc-root="ep" data-wiz-attrbind="aria-level=iZCSye_27/fLk2Md" id="bkmrk-2.-kmod-nf-nathelper" jsaction="" jscontroller="a7qCn#ZxCkTb" jsuid="iZCSye_27" role="heading"><span style="color: rgb(0, 0, 0);">**2. `kmod-nf-nathelper-extra` 的核心功能**</span></div><div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAIDxAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-%E9%80%99%E5%80%8B%E6%A8%A1%E7%B5%84%E5%8C%85%E8%A3%9D%E4%BA%86-linux-%E6%A0%B8%E5%BF%83%E7%9A%84-nf" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_29"><span style="color: rgb(0, 0, 0);">**這個模組包裝了 Linux 核心的 `nf_conntrack`（連線追蹤）與 `nf_nat` 的擴充元件，專門用來當作這些特殊協定的「翻譯官」：**</span></div>- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">深度封包解析（ALG）：</span> 它會主動去監聽、攔截並解析特定協定（如 TCP 1723 的 PPTP 控制訊號）。</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">動態修改內文：</span> 當發現內網客戶端把自己的私有 IP（如 192.168.1.100）寫在封包內文中時，該模組會動態把它<span class="rQesXe MPyX">修改為路由器的 WAN 端公網 IP</span>。</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">動態開啟防火牆通道（Pinholing）：</span> 它會告訴防火牆：「等一下會有一個關聯的 GRE 協定（協定號 47）封包進來，這是剛剛那個客戶端申請的，請主動放行並轉發給它。」</span>**</span>

<div class="yhAwj" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sfc-cp="" data-sfc-inited="2" data-sfc-root="ep" id="bkmrk--2" jsaction="rcuQ6b:&iZCSye_37|npT2md" jscontroller="UTzWVc#U8DOt" jsuid="iZCSye_37"><span style="color: rgb(0, 0, 0);"></span></div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 20px; font-weight: 700; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sae="" data-sfc-cp="" data-sfc-root="ep" data-wiz-attrbind="aria-level=iZCSye_38/fLk2Md" id="bkmrk-3.-%E9%80%99%E5%80%8B%E8%BB%9F%E9%AB%94%E5%8C%85%E8%A3%A1%E9%9D%A2%E5%8C%85%E5%90%AB%E5%93%AA%E4%BA%9B%E5%8D%94%E5%AE%9A%EF%BC%9F" jsaction="" jscontroller="a7qCn#ZxCkTb" jsuid="iZCSye_38" role="heading"><span style="color: rgb(0, 0, 0);">**3. 這個軟體包裡面包含哪些協定？**</span></div><div class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAIEhAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-kmod-nf-nathelper-ex-1" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_39"><span style="color: rgb(0, 0, 0);">**`kmod-nf-nathelper-extra` 是一個集合包，安裝它之後，您的 OpenWrt 會同時獲得以下幾種常見傳統協定的穿透能力：**</span></div>- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">PPTP / GRE</span>（虛擬專線網路）</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">AMANDA</span>（備份系統）</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">H.323</span>（舊式視訊會議/網路電話）</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">IRC</span>（網際網路中繼聊天）</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">MMS</span>（微軟早期多媒體串流協定）</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">PPTP</span>（點對點隧道協定）</span>**</span>
- <span style="color: rgb(0, 0, 0);">**<span class="iNqyIf" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-sfc-cp="" data-sfc-root="ep"><span class="rQesXe MPyX">SIP</span>（現代 VoIP 網路電話核心協定）</span>**</span>

<div class="yhAwj" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sfc-cp="" data-sfc-inited="2" data-sfc-root="ep" id="bkmrk--3" jsaction="rcuQ6b:&iZCSye_47|npT2md" jscontroller="UTzWVc#U8DOt" jsuid="iZCSye_47"><span style="color: rgb(0, 0, 0);"></span></div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 20px; font-weight: 700; margin: 24px 0px 12px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-processed="true" data-sae="" data-sfc-cp="" data-sfc-root="ep" data-wiz-attrbind="aria-level=iZCSye_48/fLk2Md" id="bkmrk-%E7%B8%BD%E7%B5%90" jsaction="" jscontroller="a7qCn#ZxCkTb" jsuid="iZCSye_48" role="heading"><span style="color: rgb(0, 0, 0);">**總結**</span></div><div aria-owns="action-menu-parent-container" class="n6owBd awi2gc" data-complete="true" data-copy-service-computed-style="font-family: Arial, sans-serif, "Noto Color Emoji"; font-size: 16px; font-weight: 400; margin: 12px 0px 16px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);" data-hveid="CAAIFRAA" data-processed="true" data-sfc-cp="" data-sfc-root="ep" id="bkmrk-%E7%B0%A1%E5%96%AE%E4%BE%86%E8%AA%AA%EF%BC%8Ckmod-nf-nathelp" jsaction="" jscontroller="TDBkbc#Ml18Xb" jsuid="iZCSye_49">**<span style="color: rgb(0, 0, 0);">簡單來說，`kmod-nf-nathelper-extra` 就是</span><span class="rQesXe MPyX"><span style="color: rgb(0, 0, 0);">讓 OpenWrt 路由器變聰明，能夠看懂 PPTP 等複雜協定的內容，並在防火牆上動態開路、修改 IP，從而完美實現 PPTP / GRE 的 NAT 穿透</span></span>。**</div><span style="color: rgb(0, 0, 0);">**從網頁介面上搜尋套件或指令安裝**</span>

```
opkg update
opkg install kmod-nf-nathelper-extra

```

<span style="color: rgb(0, 0, 0);">**重啟防火牆或重啟**</span>

```
service firewall restart
```

#### <span style="color: rgb(0, 0, 0);">**Windows 11 PPTP設定**</span>

<span style="color: rgb(0, 0, 0);">**建立PPTP VPN後更改加密設定**</span>

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2026-09/scaled-1680-/5ghimage.png)](https://note.homesitetw.com/uploads/images/gallery/2026-09/5ghimage.png)