作者: 张无忌 時間: 2026-6-5 10:24 標題: AmneziaWG
本帖最後由 张无忌 於 2026-6-6 05:30 編輯
AmneziaWG /æmˈniː.ʒə.dʌb.əl.juː.dʒiː/
AmeziaVPN 是从俄罗斯出,WireGuard (简称 WG)出现,又整合 WG 便是为 AmneziaWG [1],中文不多只有一篇 AmneziaWG [2, 3]。
因为 GFW DPI 会知道 WG 开始
In WireGuard, the Init packet is exactly 148 bytes, Response is 92 bytes, Cookie is 64 bytes, and Data has variable size (payload). AmneziaWG adds pseudorandom prefixes S1, S2, S3, and S4 (0 to 32/64 bytes):
len(init) = 148 + S1
len(resp) = 92 + S2
len(cookie) = 64 + S3
len(data) = payload + S4
Jc, Jmin, Jmax
S1, S2, S3, S4
H1, H2, H3, H4
I1, I2, I3, I4, I5
References:
[1] https://docs.amnezia.org/documentation/amnezia-wg/
[2] https://appscross.com/blog/start ... -of-amneziavpn.html
[3] 简单搭建amneziawg VPN
作者: 张无忌 時間: 2026-6-5 10:24
本帖最後由 张无忌 於 2026-6-5 07:58 編輯
Table of contents
AmneziaWG
VPS Linux 安装 AmneziaWG
目录 AmneziaWG
作者: 张无忌 時間: 2026-6-5 10:25
本帖最後由 张无忌 於 2026-6-5 05:43 編輯
AmneziaWG
AmneziaWG operates within the framework of backward compatibility. The AmneziaWG implementation allows for the modification of certain static parameters in WireGuard, which are typically recognized by DPI systems. If these parameters are left at their default values (set to 0), the protocol functions like regular WireGuard.
In AmneziaWG, the headers of all packets are modified: the handshake packet (Initiator to Responder), the response packet (Responder to Initiator), the data packet, and a special "Under Load" packet — these are randomized values, but they can be changed in the settings. Because each user has different headers, it's virtually impossible to devise a universal rule based on headers alone to detect and block the protocol.
Another weak point of WireGuard is the size of authentication packets. In AmneziaWG, random bytes are appended to each auth packet to alter their size. Thus, the handshake packets additionally contain "garbage" at the beginning of the data, the size of which is determined by the values S1 and S2. By default, the initiating handshake packet has a fixed size (148 bytes), and after adding garbage, its size will be 148 bytes + S1.
The AmneziaWG implementation includes another trick for more reliable masking. Before starting a session, Amnezia sends a certain number of "junk" packets to thoroughly confuse DPI systems. The number of such packets and their minimum and maximum sizes in bytes are also set in the settings, with parameters Jc, Jmin, and Jmax.
In regions with a high level of internet censorship, we recommend using AmneziaWG from the first connection.
Reference:
[1] https://docs.amnezia.org/documentation/how-amnezia-works
目录 AmneziaWG
作者: 张无忌 時間: 2026-6-5 10:25
本帖最後由 张无忌 於 2026-6-12 22:15 編輯
VPS Linux 安装 AmneziaWG
但是没有 Amnezia 安装 AmneziaWG,而在 [1] 有一个 package 没有,不知道怎么进行。而 AmneziaWG 2.0 Linux 要求 Debian 13,而所有的 VPS 一般都是 Debian 12。
我早期日本买了 Linux VPS(腾讯云东京)有了 Debian 13,在安装有发现问题,于是问 Gemini 说出安装在大陆的 device 里,选用 iPhone 安装了 AmneziaVPN App,把日本 VPS 的 IP,root and password 输进去,它会自动 AmneziaWG(remote login VPS by iPhone) 安装好,在手机按 select "Connect" 一下变成 "Connected"。
AmneziaVPN(用 AmneziaWG)昨天一直连日本都没有问题,早今天一整天都没有问题。
6月9日晚上安装,connected
6月10日 connected(没有改过 settings)
6月11日 connected(没有改过 settings)
6月12日 connected(没有改过 settings)
6月13日 continued
Reference:
[1] 简单搭建amneziawg VPN
目录 AmneziaWG
作者: freshtomato 時間: 2026-6-5 18:00
本帖最後由 freshtomato 於 2026-6-6 01:25 編輯
5月中試過,Glinet router stock firmware 4.8.4 AmneziaWG server and Glinet router stock firmware 4.8.4 AmneziaWG client, server at HK netvigator home public IP, client at Guangdong, first 20 min is OK very smooth, like the normal WG, After 20 min, AmneziaWG line was QOS or broken by GFW. Don’t use anymore.
Glinet stock firmware 4.8.4 include AmneziaWG encryption, I don’t need to learn how to install it.
FYI
作者: 张无忌 時間: 2026-6-6 19:11
回覆 5# freshtomato
Based on your information stock firmware 4.8.4 GL.iNet on both routers, I believe they are of Flint 2 (GL-MT6000). They were installed AmneziaWG server in Hong Kong and client in Guangdong province. Since you had not mentioned the AmneziaWG settings Jc, Jmin, Jmax; S1, S2, S3, S4; H1, H2, H3, H4; I1, I2, I3, I4, I5, I cannot give you advice about it.
If you do not need to learn how to install it, the result was the same as ordinary WireGuard. For the time being I only use the original WireGuard and sometimes I need to adjust the port(s). Instead of directing the Hong Kong residential PCCW router, I use the transfer method via Aliyun VPS (change my Mainland residential IP transferred to Aliyun IP) to Hong Kong PCCW router. The results were very satisfactory.
作者: freshtomato 時間: 2026-6-6 22:34
All the AmneziaWG setting both server/client from Glinet, I just make sure the WG router server was HK public IP address, don’t use DDNS for safety. I also compare the AmneziaWG peer file vs Normal WG peer file, AmneziaWG client peer file have more header (like you mention above). I ask Gemini, AmneziaWG peer file is incompatible to normal WireGuard server.
Since I was successfully connected around 20 min, after a while the line was broken.
My conclusion on MY case, the AmneziaWG connection was success, but GFW find a way to detect and break the line. 道高一尺 魔高一丈 (完)
作者: jk1399 時間: 7 天前 03:24
本帖最後由 jk1399 於 2026-6-7 08:16 編輯
又係CMK,你自貼自樂,根本無人理你貼乜
作者: t101 時間: 7 天前 11:08
不如你試下搵AI試下改source code,仲多嘢可以試
我玩緊
作者: xo_ox 時間: 7 天前 12:31
這些文章,我又覺得OK wow !
參考參考ok 吖
作者: ostrich1983 時間: 6 天前 17:04
同意. 起碼有返D TECH野係HKEPC
作者: xo_ox 時間: 6 天前 22:36
以前都係因為有啲教學文章,才來hkepc的⋯
如果有Ching有任何,可行可用的,即使是舊方法,我都想學吓wow
作者: xgepc 時間: 5 天前 18:32
GFW 對 UDP 流量的「無差別限速與阻斷」
技術硬傷:AmneziaWG 核心仍是基於 UDP 協議。在中國的網絡環境中,三大電信運營商(電信、聯通、移動)為了保證網絡服務質量(QoS)或進行審查,會對未知的 UDP 流量進行嚴厲的無差別丟包、限速甚至直接阻斷。
生存期極短:即便 AmneziaWG 通過修改標頭和加入垃圾數據成功騙過了 DPI(深度封包檢測),GFW 只要發現某個境外 IP 存在大量不屬於常規網頁(如 HTTP/HTTPS)的未知 UDP 流量,就會在 24 小時內直接封鎖該 IP 或端口。
作者: kennylam777 時間: 4 天前 00:04
本帖最後由 kennylam777 於 2026-6-10 00:08 編輯
5月中試過,Glinet router stock firmware 4.8.4 AmneziaWG server and Glinet router stock firmware 4.8. ...
freshtomato 發表於 2026-6-5 18:00
本來UDP就係易死, 中國GFW根本唔你有冇特徵, 流量大就鉗死你呢個IP/Port pair, 同埋UDP響中國國內都有額外限流快唔起
即使係TCP過GFW都有類似問題, 只係比UDP寬鬆少少
仲要Wireguard一路講緊都係長連接, 根本唔使DPI都知你係VPN, 所以中國先會興起由Shadowsocks一類嘅TCP短連接扮正常網頁嘅方案。
呢啲VPN改出黎嘅obfuscation小玩具早十年響中國玩過晒, 係俄羅斯道牆冇咁高先有生存空間
我都講咗好多年話任何自建VPN響中國都唔使旨意穩定, 當GFW係傻咁, 完全唔知咩叫GFW嘅惡意設計。
但總係會有人出黎問, 然後CMK一類熱心人士走出黎長篇大論講自己用老式VPN用得(不過斷)或者將啲出現咗幾年但啱啱裝起嘅solutions當寶咁吹起話終於解決乜乜乜
作者: t101 時間: 4 天前 14:39
本帖最後由 t101 於 2026-6-10 14:48 編輯
UDP其實都有更加有效方法,只係無人做,我用AI試緊,不過俾個AI能力氣死。
TCP方法,相信都一樣,簡單就睇IP,IP睇whitelist,SNI又睇一下,係可以間中block下,block你,如果係正路app,梗會改一下,遷就下。死幾個唔重要web,問題不大,反正你地只需要上內聯網,加AI做filter外面資料,安全好多,夠了。block盡一盡唔係問題。
現在無單一方法可行,現在連roaming sim都準備block
文中,中轉方法,係可以救命,last resort方法。夠30分鐘,download一個youtube,就可以了
另外,加句,曲高和寡,本來越底層東西,越沒有人有興趣,控制一下量就可以。畢竟你不能要求觀眾太多,大多問下邊隻router抵玩,點set等等。
作者: evantkh 時間: 4 天前 22:03
Block Roaming SIM點整法?會變成點?
作者: t101 時間: 4 天前 22:41
本帖最後由 t101 於 2026-6-10 22:42 編輯
現在話,要係中國以外先activate,先可以用
以後,或者先註冊後上網
中國身分證不能買
作者: pbodq 時間: 4 天前 23:24
本帖最後由 pbodq 於 2026-6-11 08:04 編輯
https://www.eprice.com.hk/mobile/talk/3148/227418/1
其他台如Singtel係咪都一樣照跟就唔知
如果是這樣, 美國佬去內地前72小時"內", 都係係華盛頓先激活
驚你班友直接esim賣卡入內地
作者: kennylam777 時間: 3 天前 00:43
本帖最後由 kennylam777 於 2026-6-11 07:35 編輯
其實固定IP又要UDP, 咪又係跳port, Hysteria 2已經做緊client side port range support, server side再由iptables DNAT返去single port
但跳port有個問題都係唔穩定, 試咗等一等timeout你先知個port通唔通
以前有一招叫udp2raw去扮TCP都係好嘢黎
作者: evantkh 時間: 3 天前 07:02
即係要證明你唔係內地人才可以在內地漫遊之類?
咁真係涉外嘅咪連電話漫遊都用唔到?
作者: evantkh 時間: 3 天前 07:24
原來係咁,我又唔係咁理解。
CEPA本身係可以廣東省賣香港電訊商嘅電話卡但不能在內地啓動,我覺得個邏輯都似。
如果你儲值卡可以在內地啓動,就好似賣給內地用咁,可以睇下佢係咪要避哩樣野。
換句話講如果真係長期有個境外電話號碼keep住或者境外門市上台簽約的用戶應該係未見有影響。
作者: pbodq 時間: 3 天前 09:22
擺明就係杜絕呢樣野, 因大半年前, 有少規模賣左入內地
https://www.hkepc.com/forum/redi ... 07&pid=42987146
你睇佢條款寫得好絕
1.前72小時啟動, 舉例:美國, 這個很易理解, 當普通遊客搭飛機入內地遊旅
2.不能提前超過72小時, 例如你想提早5日activate, 係禁止的
講真, 原本這類漫遊生意, 市價成本都高, 普通人唔會咁玩, 都係d中產以上的人才會買來應急或日常開幾個鐘睇新聞網站使用
我意思係唔太普及(除左旅人)
至起碼,我識幾個老細都未至行呢一步
有樣野幾有趣:
理應只要有SM-DP+ , 一個能通internet的WIF (中間唔理你用VPN又好, 乜都好), 張實體esim是GSMA證書, Android就可以在內地activate, 唔需要人肉帶過關。
上文公告, 現在佢加一個額外限制條件, 張esim第一下接入網絡時,必須是國外地區落地, alive 5分鐘後才能算是完成activation workflow
但這個workflow要所有ISP跟從才能行得通, 未必咁易
有人可能會想, 就買兩張白卡
blank白卡B預先賣運內地, 白卡A在港activate後, Windows writer clone完再overwrite白卡B
但呢d野, 一般end user鬼識搞, 就算識搞都唔想做, 又要配套呢樣果樣, 老細連Windows點樣power on開機都唔識, 唔好講呢d
所以這個政策最主要係杜絕大部份賣卡的生意
作者: chanman60 時間: 3 天前 09:40
SIM cannot be cloned. But 白卡 能 clone ?
作者: t101 時間: 3 天前 10:42
其實固定IP又要UDP, 咪又係跳port, Hysteria 2已經做緊client side port range support, server sid ...
kennylam777 發表於 2026-6-11 00:43
udp2raw係好嘢,仍然在用,可以自己改code
dynamic跳port,我就係想搞呢種,有時間再試,AI改code都有D麻煩。
作者: t101 時間: 3 天前 10:47
現在唔知,最少佢目的係ban內地人買到的roaming sim,activate過程佢應該可以block到
香港人的mobile number跟大陸roaming data plan,應該仲未有問題
作者: t101 時間: 3 天前 10:54
肯定以後有方法block
因為roaming一定靠三間operator,只要operator係中間擋一下,你手機就register唔到去外國。
呢種改動太大,會影響好多外來公幹人士,但我覺得,佢好大機會會做。
operator梗係唔想,少好多收入。
作者: evantkh 時間: 3 天前 12:23
我覺得暫時唔會有進一步。個pattern我覺得同證券差唔多:
本意:互聯網證券交易為已有開戶提供便利交易服務(被動)
錯誤:違規跨境招攬、經營(主動)
造成問題:資金翻牆
糾正措施:禁止非法跨境提供服務
未禁止:自有境外資金,物理上自行到香港開戶
本意:漫遊為既有用戶提供外地免換卡的便利(被動)
錯誤:撍在外地銷售規模,打破電訊服務嘅地域屬性(主動)
造成問題:網絡翻牆
糾正措施:禁止部份地區直接在當地激活
未禁止:自行在香港門市上台
所以,佢邏輯似係境外先激活,代表你開通服務時不在內地,然後才帶入去用,咁可以避免跨境提供嘅合規問題。至於門市上台因為有月費、有簽約地同賬單地址做基礎,我估計之後都唔會有影響。
作者: t101 時間: 3 天前 12:27
本帖最後由 t101 於 2026-6-11 12:31 編輯
可以pre-activate,然後補發一次esim,呢種途徑,可能會擋。
所以,睇情況而定,GFW都會進化啦。
可能以後去鴨寮街買sim卡,係一個旅遊項目,然後又唔俾賣。
作者: evantkh 時間: 3 天前 12:30
內地ISP未必可以時時刻刻檢查到你海外記錄,但較簡單直接嘅做法係落地實名制證明你不是內地人或解釋理由和用途,而非一刀切禁止。
作者: evantkh 時間: 3 天前 12:33
我意思係,哩個可能係打擊經營資貭同走水貨問題,多過為要全漫遊都要落GFW的問題。
作者: t101 時間: 3 天前 12:34
要roaming對方operator配合,所以,只有香港邊operators先會配合,其他國家未必會。
好有可能,以後,只有簽約的主要operators係國內先可以roaming,不知名的,你就買local sim,用wechat吧啦。
作者: t101 時間: 3 天前 12:37
要睇政策目的,可能範圍唔係咁小。
你要明白,其中一個重要理由,係國家機密問題。唔係你一般平民翻牆問題。
作者: evantkh 時間: 3 天前 12:39
真係太重要嘅人可以禁你出境,否則,如果你正正常常有海外活動有外國電話,暫時唔見得佢會禁你,水貨SIM才是漏洞。
作者: 张无忌 時間: 昨天 13:38
All the AmneziaWG setting both server/client from Glinet, I just make sure the WG router server was ...
freshtomato 發表於 2026-6-6 14:34
In past posts about mainland Chinese or overseas VPS (including Hong Kong), we discussed that if WireGuard data packets pass through the GFW, they get modified—such as changing the original port 51820 to other values. However, if the destination is a residential site, the GFW normally does not modify the port number, meaning WireGuard can function normally as long as the port numbers are adjusted accordingly.
Now, regarding AmneziaWG, it is essentially WireGuard plus obfuscation. GL.iNet's new firmware (4.9.0) for models like the GL-BE9300, GL-MT6000 (op24), and GL-MT3000 (op24) now includes this WireGuard obfuscation option. I tested this by using AmneziaVPN on my iPhone 16e and a Tokyo, Japan VPS. After entering the IP, root account, and password, AmneziaVPN automatically installed AmneziaWG on the Tokyo VPS remotely. Within a few minutes, the setup was complete, and I could just press "Connect" to get started. The AmneziaWG connection between my iPhone in mainland China and the Japan VPS has been running continuously for several days without any packet loss.

