本帖最後由 张无忌 於 2025-9-9 13:17 編輯
MikroTik container + V2Ray in HK connected to mainland China
In the past I used V2Ray [1,2] in Raspberry Pi Hong Kong. Now V2Ray is in Docker image form and stocked in a USB container in MikroTik hAP ac3 in Hong Kong and connected to mainland China.
HK MikroTik hAP ac3 + USB container (V2Ray) <---> mainland China (PassWall / V2RayN)
The basic network of the container- /interface/bridge add name=dockers
- /ip/address add address=172.16.77.1 interface=dockers
- /interface/veth add name=veth3 address=172.16.77.4/24 gateway=172.16.77.1
- /interface/bridge/port add bridge=dockers interface=veth3
- /ip/firewall/nat add chain=scrnat action=masquerade src-address=172.16.77.0/24
複製代碼 Docker configuration- /container config
- add registry-url=https//registry-1.docker.to tmpdir=disk1/pull
複製代碼 Loading Docker image- /container add remote-image=teddysun/v2ray:latest interface=veth3 root-dir=disk1/v2ray
- /container print
- 2 ... status=extracting
- /container print
- 2 ... status=stopped
複製代碼 Entering V2Ray shell- /container shell 2
- / #
- / # cat /etc/v2ray/config.json
- {
- "inbounds": [{
- "port": 9000,
- "protocol": "vmess",
- "settings": {
- "clients": [
- {
- "id": "11c2a696-0366-4524-b8f0-9a9c21512b02",
- "level": 1,
- "alterId": 64
- }
- ]
- }
- }],
- "outbounds": [{
- "protocol": "freedom",
- "settings": {}
- }]
- }
複製代碼 V2Ray to operate with network, input packet from ether1 tcp-port=38566 converting 172.16.77.4 to-ports=9000- /ip/firewall/nat add chain=dstnat action=dst-nat protocol=tcp to-address=172.16.77.4 to-ports=9000 in-interface=ether1 dst-port=38566
複製代碼 Container image startA Windows V2RayN was used in mainland China and followed "config.json" to adjust the settings.
- 别名(remarks)=veth3
- 地址(address)=abc.xyz.org
- 端口(port)=38566
- 用户 ID(id)=11c2a696-0366-4524-b8f0-9a9c21512b02
複製代碼 PassWall on OpenWrt- Node Remarks=veth3
- Type=Sing-Box
- Protocol=Vmess
- Address (Support Domain Name)=abc.xyz.org
- Port=38566
- ID=11c2a696-0366-4524-b8f0-9a9c21512b02
複製代碼 香港的hAP ac3 container安装V2Ray了,而大陆可以用Windows V2RayN和PassWall on OpenWrt连接上。用现在config.json只是很简单的,需要改做比较复杂的,效果更加好 [3]。
References:
[1] teddysun/v2ray
[2] v2ray-examples
[3] How to choose a V2Ray plan?
目录帖子GL.iNet and OpenWrt Contents |