# OpenWrt IPv6 設定

##### **運行環境**  


- **OpenWrt 23.05**

##### **Dnsmasq 設定**

**篩選 IPv6 AAAA 記錄取消勾選**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/Gndimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/Gndimage.png)

##### **WAN介面(PPPOE)IPv6設定**

**刪除已有WAN6介面，在WAN介面開啟IPv6後會自動產生動態虛擬介面**

**若不勾選使用終端發布的DNS伺服器，可自訂要使用的DNS**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/Mrximage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/Mrximage.png)

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/kzMimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/kzMimage.png)

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/tnpimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/tnpimage.png)

**確認WAN介面上DHCP已關閉**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/XPoimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/XPoimage.png)

**儲存套用設定後，會出現DHCPv6 客戶端虛擬介面，確認有取得IPv6-前綴代理**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/8Aaimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/8Aaimage.png)

##### **LAN介面IPv6設定**

**LAN介面&gt;進階設定，委派 IPv6 首碼不勾選，IPv6 分配長度依照IPv6-前綴代理取得的長度設定**

**IPv6 尾碼輸入eui64**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/Jhqimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/Jhqimage.png)

**IPv6 DHCP設定，RA選伺服器模式，不勾選IPv6 DNS伺服器，用IPv4來解析IPv6域名**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/rWhimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/rWhimage.png)

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-10/scaled-1680-/cbHimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-10/cbHimage.png)

**儲存套用後設定完成**

##### **測試IPv6** 

**[https://testipv6.com/](https://testipv6.com/)**

**參考:[https://github.com/Aethersailor/Custom\_OpenClash\_Rules/wiki/OpenWrt-IPv6-%E8%AE%BE%E7%BD%AE%E6%96%B9%E6%A1%88](https://github.com/Aethersailor/Custom_OpenClash_Rules/wiki/OpenWrt-IPv6-%E8%AE%BE%E7%BD%AE%E6%96%B9%E6%A1%88)**