vpn信息 #
名称 | vpn地址 | docker image | 备注 |
---|---|---|---|
公司 | hagb/docker-easyconnect:7.6.3 | ||
山东 | hagb/docker-easyconnect:7.6.7 |
软件安装 #
安装docker,docker-compose(自行百度) #
安装clash #
vncviewer安装 #
环境配置 #
参考 用docker封印EasyConnect并连接远程桌面和数据库 Clash for Windows
配置clash (General) #
Service Mode #
TUN Mode #
Mixin #
mixin:
hosts:
'mtalk.google.com': 108.177.125.188
'services.googleapis.cn': 74.125.203.94
'raw.githubusercontent.com': 151.101.76.133
dns:
enable: true
default-nameserver:
- 223.5.5.5
- 1.0.0.1
ipv6: false
enhanced-mode: redir-host #fake-ip
nameserver:
- https://dns.rubyfish.cn/dns-query
- https://223.5.5.5/dns-query
- https://dns.pub/dns-query
fallback:
- https://1.0.0.1/dns-query
- https://public.dns.iij.jp/dns-query
- https://dns.twnic.tw/dns-query
fallback-filter:
geoip: true
ipcidr:
- 240.0.0.0/4
- 0.0.0.0/32
- 127.0.0.1/32
domain:
- +.google.com
- +.facebook.com
- +.twitter.com
- +.youtube.com
- +.xn--ngstr-lra8j.com
- +.google.cn
- +.googleapis.cn
- +.gvt1.com
tun:
enable: true
stack: gvisor
dns-hijack:
- 198.18.0.2:53
macOS-auto-route: true
macOS-auto-detect-interface: true # 自动检测出口网卡
配置clash (Profiles) #
配置config.yaml #
# (HTTP and SOCKS5 in one port)
mixed-port: 7890
# RESTful API for clash
external-controller: 127.0.0.1:52830
allow-lan: false
mode: rule
log-level: warning
proxies:
- {
"name": "sdvpn",
"type": "socks5",
"server": "127.0.0.1",
"port": "2080"
}
- {
"name": "companyvpn",
"type": "socks5",
"server": "127.0.0.1",
"port": "3080"
}
proxy-groups:
- name: 🔰 节点选择
type: select
proxies:
- companyvpn
- sdvpn
rules:
- DOMAIN-SUFFIX,google.com,DIRECT
- DOMAIN-KEYWORD,google,DIRECT
- DOMAIN,google.com,DIRECT
- DOMAIN-SUFFIX,ad.com,REJECT
- GEOIP,CN,DIRECT
- IP-CIDR,10.210.40.0/24,sdvpn
- IP-CIDR,10.210.2.0/24,sdvpn
- IP-CIDR,172.17.1.0/24,companyvpn
- IP-CIDR,172.17.3.0/24,companyvpn
- IP-CIDR,172.17.6.0/24,companyvpn
- IP-CIDR,172.17.8.0/24,companyvpn
- MATCH,DIRECT
启动 docker vpn #
配置文件vpn.yml #
version: "3"
services:
sdvpn:
image: hagb/docker-easyconnect:7.6.7
cap_add:
- net_admin
devices:
- /dev/net/tun
environment:
- PASSWORD=123
ports:
- 5901:5901
- 2080:1080
companyvpn:
image: hagb/docker-easyconnect:7.6.3
cap_add:
- net_admin
devices:
- /dev/net/tun
environment:
- PASSWORD=123
ports:
- 15901:5901
- 3080:1080
启动vpn #
docker-compose -f vpn.yml up
启动vncviewer #
输入vpn信息,登录即可
完成 #
QA #
- 网络断开,导致vpn连接不上
docker-compose -f vpn.yml stop
docker-compose -f vpn.yml rm -f
docker-compose -f vpn.yml up
重新连接vncviewer,输入vpn账号信息