Giter Site home page Giter Site logo

docker-easyconnect / docker-easyconnect Goto Github PK

View Code? Open in Web Editor NEW
3.2K 16.0 313.0 422 KB

使深信服(Sangfor)开发的非自由的 VPN 软件 EasyConnect 和 aTrust 运行在 docker 或 podman 中,并作为网关和/或提供 socks5、http 代理服务

License: Do What The F*ck You Want To Public License

Dockerfile 7.37% Shell 86.55% Makefile 0.68% C 5.40%
docker easyconnect sangfor sslvpn podman docker-container docker-image podman-image

docker-easyconnect's Introduction

docker-easyconnect

让深信服开发的非自由的 VPN 软件 EasyConnect 或 aTrust 运行在 docker 中,提供 socks5 和 http 代理服务和网关供宿主机连接使用。

本项目基于 EasyConnect 官方“Linux”版的 deb 包、@shmille 提供的命令行版客户端 deb 包、aTrust 官方“Linux”版 deb 包,这些 deb 包的版权归深信服(Sangfor)所有,请不要滥用本项目。本项目不是深信服官方项目。

欢迎批评、指正,提交 issue、PR,包括但不仅限于 bug、各种疑问、代码和文档的改进。

详细用法见于 doc/usage.md,常见问题见于 doc/faq.md,自行构建可参照构建说明 doc/build.md

简明使用步骤

使用下述方式登录后,可以通过 127.0.0.1:1080127.0.0.1:8888 分别访问 socks5 和 http 代理

纯命令行版 EasyConnect(amd64 架构)

注意,纯命令行版本仅支持下列登录方式:用户名+密码、硬件特征码。

  1. 安装Docker并运行
  2. 在终端输入:
    docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti -p 127.0.0.1:1080:1080 -p 127.0.0.1:8888:8888 -e EC_VER=7.6.3 -e CLI_OPTS="-d vpnaddress -u username -p password" hagb/docker-easyconnect:cli
    其中 -e EC_VER=7.6.7 表示使用 7.6.7 版本的 EasyConnect,请根据实际情况修改版本号(选择 7.6.77.6.3,详见 EasyConnect 版本选择);
  3. 根据提示输入服务器地址、登录凭据。

图形界面版 EasyConnect(x86、amd64、arm64、mips64el 架构)

  1. 安装Docker并运行
  2. 在终端输入: docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti -e PASSWORD=xxxx -e URLWIN=1 -v $HOME/.ecdata:/root -p 127.0.0.1:5901:5901 -p 127.0.0.1:1080:1080 -p 127.0.0.1:8888:8888 hagb/docker-easyconnect:7.6.7(末尾 EasyConnect 版本号 7.6.7 请根据实际情况修改;arm64 和 mips64el 架构需要加入 -e DISABLE_PKG_VERSION_XML=1 参数);
  3. 使用vnc客户端连接vnc, 地址:127.0.0.1,端口: 5901, 密码 xxxx;
  4. 成功连上后你应该能看到 EasyConnect 的登录窗口,填写登录凭据并登录,若需要 web 登录可参看 web 登录

图形界面版 aTrust(amd64、arm64、mips64el 架构)

  1. 安装Docker并运行
  2. 在终端输入: docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti -e PASSWORD=xxxx -e URLWIN=1 -v $HOME/.atrust-data:/root -p 127.0.0.1:5901:5901 -p 127.0.0.1:1080:1080 -p 127.0.0.1:8888:8888 -p 127.0.0.1:54631:54631 hagb/docker-atrust
  3. 使用vnc客户端连接vnc, 地址:127.0.0.1,端口: 5901, 密码 xxxx;
  4. 成功连上后你应该能看到 aTrust 的登录窗口;若需要 web 登录,在宿主机的浏览器打开 aTrust 弹出的网址网址登录即可。

拉取

从 Docker Hub 上直接获取:

docker pull hagb/docker-easyconnect:TAG

其中 TAG 可以是如下值(不带 VNC 服务端的 image 比带 VNC 服务端的 image 小):

  • latest: 默认值,带 VNC 服务端的7.6.7版 image,
  • cli: 多版本(7.6.3, 7.6.7, 7.6.8)纯命令行版
  • vncless: 不带 VNC 服务端的7.6.7版 image
  • 7.6.3: 带 VNC 服务端的7.6.3版 image
  • vncless-7.6.3: 不带 VNC 服务端的7.6.3版 image
  • 7.6.7: 带 VNC 服务端的7.6.7版 image
  • vncless-7.6.7: 不带 VNC 服务端的7.6.7版 image

参考资料

登录过程的一个 hack (docker-root/usr/local/bin/start-sangfor.sh)参考了这篇文章:https://blog.51cto.com/13226459/2476193。在此对该文作者表示感谢。

其他 EasyConnect 相关项目

版权及许可证

Copyright © 2020 contributors

This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.

   DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE  
               Version 2, December 2004  

Copyright (C) 2004 Sam Hocevar [email protected]

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE  

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. You just DO WHAT THE FUCK YOU WANT TO.

docker-easyconnect's People

Contributors

chroming avatar dhy2000 avatar ghdefe avatar hagb avatar jhees avatar lishoujun avatar lrtfm avatar mac-zhou avatar morooi avatar myuanz avatar ofey404 avatar redjumper avatar sadpencil avatar sasaju avatar weearc avatar yakumioto avatar ztongxue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-easyconnect's Issues

[讨论&建议]构建一个纯CLI登录的docker image

#35 (comment)
7.6.8(CLI)的基础上,我们应该可以为7.6.3,7.6.7分别构建一个纯CLI登录的image。

  • 仍基于 debian:buster-slim
  • 最好不要 dpkg 安装7.6.8(CLI),因为里面有许多mac上的文件。
    只保留 /usr/share/sangfor/EasyConnect/resources/bin(甚至是只留ECAgenteasyconn )
  • 同样7.6.3,7.6.7 安装包内/usr/share/sangfor/EasyConnect/resources/的文件, 按 #35 (comment) 保留需要的
  • ldd所用命令, 排查 apt-get 安装的软件,同时删除不需要的依赖库
  • 简化启动脚本,只保留CLI相关的内容

不确定的:
如果说7.6.8(CLI)和7.6.3的 CSClient EasyMonitor svpnservice能通用,那三个版本和在一块,体积也可能不会很大。
三版本构建一个image也不错。

连接 VPN 后无法在外网访问 Docker 容器

我把这个容器搭建在了服务器上,作为中转代理,但是只要连接 VPN 后就不再能够访问容器的端口,无论是 VNC 还是 socks 代理都无法访,但是服务器使用 127.0.0.1:1080 是可以连接的,使用服务器内网的另一台机器也不能通过 内网IP:1080 连接代理。

7.6.7 版本容器内 DNS 解析异常

使用 7.6.7 版本有如下异常情况,DNS 解析的问题比较严重,其它的似乎不影响使用。

docker 运行环境为:WSL2 Ubuntu

DNS 解析异常

现象为,通过 VPN 无法使用域名访问任何服务,但内网 IP 可以正常访问。查看 /usr/share/sangfor/EasyConnect/resources/logs/DNS.log 可获得如下信息:

[2021-02-19 13:13:27][INFO][ 753][DnsProxyExecution]DNS socket bind upd port: 7789
[2021-02-19 13:13:27][WARNING][ 275][ReadFile]Open /usr/share/sangfor/EasyConnect/resources/conf/svpn_service_port failed; Reason: Open file error info: File exists; Will: Cannot Read Content from /usr/share/sangfor/EasyConnect/resources/conf/svpn_service_port

[2021-02-19 13:13:27][WARNING][ 723][HookDnsServer]Failed to HookDnsServer by iptables, cmdBuf:iptables -t nat -A OUTPUT -p udp ! --sport 7789 --dport 53 -j DNAT --to-destination 127.0.0.1:5373; Reason: Maybe iptables rules invalid; Will: DNS Module will be disabled; HowTo: Add the iptables(iptables -t nat -A OUTPUT -p udp ! --sport 7789 --dport 53 -j DNAT --to-destination 127.0.0.1:5373) by hands

看上去是 iptables 兼容性的问题。尝试执行 iptables-legacy -t nat -A OUTPUT -p udp ! --sport 7789 --dport 53 -j DNAT --to-destination 127.0.0.1:5373 后,DNS 解析正常。

启动时执行 start.sh 报错

同样和 iptables 有关。这个问题似乎并未影响使用。

iptables v1.8.2 (nf_tables): Couldn't load match `state':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.2 (nf_tables): Couldn't load match `connmark':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.2 (nf_tables): Couldn't load match `connmark':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.2 (nf_tables): unknown option "--set-mark"
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.2 (nf_tables): Chain 'MASQUERADE' does not exist
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.2 (nf_tables): Chain 'REJECT' does not exist
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.8.2 (nf_tables):  RULE_INSERT failed (No such file or directory): rule in chain INPUT
iptables v1.8.2 (nf_tables):  RULE_INSERT failed (No such file or directory): rule in chain INPUT
iptables v1.8.2 (nf_tables): Couldn't load match `state':No such file or directory

登录成功后窗口消失

登录 VPN 账号成功后,应该显示一个悬浮窗。但实际上窗口完全消失,后台服务正常运行。

容器Iptables异常

Debian 10(buster) 的 iptables 默认是使用 nf_tables。
在一些主机系统不支持 nf_tables 的容器内部,会报错

iptables/1.8.2 Failed to initialize nft: Protocol not supported

能否对这种环境进行优化,例如安装 kmod 包对 nt_tables 进行检测,判断是否使用 iptables-legacy

或者直接就用 iptables-legacy 代替 iptables

附件:

  1. iptables 默认版本切换方法
  2. kmod 安装信息
    apt install kmod
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following additional packages will be installed:
      libkmod2
    The following NEW packages will be installed:
      kmod libkmod2
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 143 kB of archives.
    After this operation, 375 kB of additional disk space will be used.
  3. 一些主机系统?对就是我DSM哒!
    Surprise MatherF****r

先感谢大神的辛苦工作,提一个 bug,关于 7.6.7 的自动登录的问题

您好,我是在 mac 的 bigsur 上使用您制作的镜像。
https://hub.docker.com/r/hagb/docker-easyconnect
tag 分别为 7.6.7 和 vncless-7.6.7 (目前来看应该是最新的,12 月 11 日推送的)
我将本机的一个目录(.config/easyconnect)挂载到容器的/root 目录中,正常运行登录后,会在我的本机目录下生成
easy_connect.json
.config/
.pki/
一个文件和两个目录,其中 easy_connect.json 中只有一行信息,就是设置成 en 文的设置。其它目录文件若干

但是奇怪的是,容器 rm 之后,自动登录无法使用。莫非还有别的目录要挂载。
我的启动命令如下:

IP=`ifconfig |grep "inet "|grep broadcast|awk '{print $2}'|cut -d/ -f1|head -1`
xhost + ${IP}
docker run -it --rm --device /dev/net/tun --cap-add NET_ADMIN -e EXIT=1 -e DISPLAY=${IP}:0 -e URLWIN=1 -e TYPE=x11 -v ~/.config/easyconnect:/root -p ${SOCK5_PORT}:1080 hagb/docker-easyconnect:vncless-7.6.7
xhost - $IP

走docker容器时,socket5代理连接建立失败

Discussed in #62

Originally posted by Shxuai July 13, 2021
以下为我的启动脚本

[root@localhost ~]# docker run --device /dev/net/tun --cap-add NET_ADMIN --name="vpn" -ti -v $HOME/.easyconn:/root/.easyconn -p 127.0.0.1:1080:1080 -e EC_VER=7.6.3 hagb/docker-easyconnect:cli
Authenticate failed, reason: Invalid username or password!
user "**********" auto login failed
vpn adress: https://ssl.*******.com:4451
username: **********
password: **********
user "**********" login successfully!

telnet本机1080端口可通
但是curl的时候就会提示无法建立socket5连接
以下为crul的报错信息

[root@localhost ~]# curl --proxy socks5h://localhost:1080 http://10.80.21.229:8080/#/login -v
* About to connect() to proxy localhost port 1080 (#0)
*   Trying ::1...
* 拒绝连接
*   Trying 127.0.0.1...
* Can't complete SOCKS5 connection to 172.17.0.2:47688. (4)
* Closing connection 0
curl: (7) Can't complete SOCKS5 connection to 172.17.0.2:47688. (4)

关于启动sslservice.sh的脚本简化

文档中提到的监测日志报错然后启动sslservice.sh的脚本,在Ubuntu 18.04下可以简化为

tail -n 0 -f /usr/share/sangfor/EasyConnect/resources/logs/ECAgent.log | grep "\\[Register\\]cms client connect failed" -m 1
/usr/share/sangfor/EasyConnect/resources/shell/sslservice.sh

用sudo或root用户运行该脚本即可。

GUI of 7.6.8 version

I upgrade to the latest 7.6.8 version, and run the container, the following error exists:

...
Starting applications specified in flwm
Log file is /root/.vnc/3ee1fb5fdb28:1.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /root/.vnc/passwd 3ee1fb5fdb28:1 to connect to the VNC server.

/usr/local/bin/start-sangfor.sh: line 15: /usr/share/sangfor/EasyConnect/EasyConnect: No such file or directory
/usr/local/bin/start-sangfor.sh: line 15: /usr/share/sangfor/EasyConnect/EasyConnect: No such file or directory
/usr/local/bin/start-sangfor.sh: line 15: /usr/share/sangfor/EasyConnect/EasyConnect: No such file or directory
...

VPN地址报错

命令行版本运行后,输入VPN地址就报错:
auth failed, please check if the vpn address is valid and reachable!
login failed!
svpn stop!
auto login is disabled

昨天我用这个运行时没问题的,今天就不行了,我重新换个环境也不不行。
我在windows下载客户端,填写地址是可以登录成功的。
不过windows客户端输入vpn地址之后,今天好像还加载了一会儿SSL相关的什么东西,是不是新的镜像还需要下载什么组件?

关于一例在windows上使用该方案的经验

感谢大佬的热情帮助,让我实现了在win10平台使用该方案访问内网。
首先按照教程,安装下载docker。
在开启docker的情况下,使用管理员权限,打开CMD窗口。
输入指令:
docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -e IPTABLES_LEGACY=1 -e PASSWORD=xxxx -v %appdata%/.ecdata:/root -p 127.0.0.1:5901:5901 -p 127.0.0.1:1080:1080 hagb/docker-easyconnect
等待程序下载资源,完成后,在docker界面运行easyconnect容器。
下载喜欢的VNC软件,输入::
127.0.0.1:5901
剩余按照教程操作即可。再次感谢版主的倾情帮助。

解决容器网络的连通性问题,为内网其他机器提供SOCKS5代理

使用了CLI命令行镜像。拟运行为SOCKS代理服务器供内网其他机器使用

遇到问题类似于以下issue:
#20

可以联通127.0.0.1:1080,即 nc -w3 -4 -v localhost 1080完全正常,能为宿主机提供127.0.0.1:1080 socks5 代理服务。
但是不能在局域网其他机器连接1080代理端口,甚至不能在本机联通 localIP:1080

排查过程
查看容器内路由表,发现缺少了连接局域网的路由。
添加路由后排除了故障(172地址为Docker0网卡地址)
ip route add 192.168.0.0/16 via 172.17.0.1 table local

推荐的解决方案
为一劳永逸,把路由修改脚本添加到镜像中,参考以下步骤。

修改Dockerfile.cli文件,最后一行修改为
CMD /local-route.sh && _EC_CLI=1 start.sh

之后重建镜像。

启动前可以根据自身网络情况设计local-route.sh脚本,并通过volume方式挂载到/local-route.sh

比如我的脚本内容类似于:
ip route add 192.168.0.0/16 via 172.17.0.1 table local

启动命令类似于

docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti \ -v $PWD/.easyconn:/root/.easyconn \ -v $PWD/local-route.sh:/local-route.sh \ -v $PWD/logs:/usr/share/sangfor/EasyConnect/resources/logs/ \ -p 1080:1080 -e EC_VER=7.6.3 -e EXIT=1 --name easyvpn\ vpn/docker-easyconnect

现在可以在局域网内使用socks5代理服务走EasyConnect的VPN线路了。

由于 SANGFOR_VIRTUAL iptables 设置导致 socks5 连接被 Drop

我们公司使用 EasyConnect 7.6.7 连入公司内网。使用 hagb/docker-easyconnect:7.6.7 时发现无法使用容器提供的 socks5 代理服务访问公司内网,ping、curl均无响应。但是容器内部能够 ping 通公司内部 IP。故怀疑 socks5 代理问题。

经排查,容器内部 iptables SANFOR_VIRTUAL 链最后会 DROP 掉所有的非指定链接:

root@abcc2d3caf6d:/# iptables -L -n --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0
3    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0
4    REJECT     tcp  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
1    SANGFOR_VIRTUAL  all  --  0.0.0.0/0            0.0.0.0/0

Chain SANGFOR_VIRTUAL (1 references)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            117.119.69.58
2    ACCEPT     all  --  127.0.0.0/8          0.0.0.0/0
3    ACCEPT     all  --  0.0.0.0/0            127.0.0.0/8
4    ACCEPT     all  --  10.10.240.48         0.0.0.0/0
5    ACCEPT     all  --  0.0.0.0/0            117.119.69.58
6    ACCEPT     all  --  0.0.0.0/0            172.10.80.78
7    ACCEPT     all  --  0.0.0.0/0            172.10.80.48
8    ACCEPT     all  --  0.0.0.0/0            172.10.80.48
9    ACCEPT     all  --  0.0.0.0/0            172.10.80.48
10   ACCEPT     all  --  0.0.0.0/0            172.10.80.48
11   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
12   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
13   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
14   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
15   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
16   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
17   ACCEPT     all  --  0.0.0.0/0            172.10.80.50
18   ACCEPT     all  --  0.0.0.0/0            172.10.80.174
19   DROP       all  --  0.0.0.0/0            0.0.0.0/0

通过手动删除这条规则(iptables -D SANGFOR_VIRTUAL 19),socks5代理服务恢复。

不知道这条规则是 EasyConnect(EC) 7.6.7 默认设置的(所有遇到 EC 7.6.7的人都会出现这个问题),还是我们公司 IT 设置的。。如果是 EC 7.6.7 默认设置的,可能得在脚本里处理下,在这条规则被创建出来后删除它。

[建议] 更换版本前请清空配置文件夹

RT
不能登录的原因找到了.

如果之前用过7.6.3的image后尝试更换到7.6.7,请新建一个.ecdata或者清空全部内容.

否则会出现版本号识别错误无法登录的问题.

easyconnect登录后代理端口被关闭(并不)

使用情况:
部署在家里服务器中,通过v2ray将外部访问转发到easyconnect

问题描述:
未登录时,代理端口是打开的且可以正常使用(可以访问无需代理的页面)
登录后,代理端口被关闭(无论页面是否需要代理,均无法访问)(报错read/write on closed pipe
注销后,代理端口恢复正常

运行环境:

  • 系统 部署于pve的ubuntu 16.04 server
  • 使用镜像
    • hagb/docker-easyconnect:7.6.7
    • v2fly/v2fly-core:latest (4.32.0)

其他:
之前是在ubuntu 16.04 desktop部署的,可以正常使用,但不久前服务器被我配置坏了
于是我重装了系统,顺便把使用的系统镜像也换成了server版
这其中是否有什么联系呢

此外,easyconnect的服务端是可用的,这点是经过验证的(朋友在Windows下可正常使用官方的easyconnect并连接)


docker-easyconnect启动参数

docker run \
    -d \
    --name ▮▮数据删除▮▮ \
    --device /dev/net/tun \
    --cap-add NET_ADMIN \
    -e PASSWORD=▮▮数据删除▮▮ \
    -e ECPASSWORD=▮▮数据删除▮▮ \
    -v $HOME/▮▮数据删除▮▮/ecdata:/root \
    -p 5901:5901 \
    -p 4600:1080 \
    --restart unless-stopped \
    hagb/docker-easyconnect:7.6.7

docker-easyconnect输出(全部)

rm: cannot remove '/usr/share/sangfor/EasyConnect/resources/conf/easy_connect.json': No such file or directory
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.
/usr/bin/xauth:  file /root/.Xauthority does not exist
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.

New '32854b9d32b2:1 (root)' desktop at :1 on machine 32854b9d32b2

Starting applications specified in flwm
Log file is /root/.vnc/32854b9d32b2:1.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /root/.vnc/passwd 32854b9d32b2:1 to connect to the VNC server.

Nov  6 13:55:56 (1604670956.409357) danted[458]: warning: checkconfig(): setting the unprivileged uid to 0 is not recommended for security reasons

v2ray输出(正常/未登录)

2020/11/06 14:16:10 [Info] [437636436] v2ray.com/core/proxy/vmess/inbound: received request for tcp:▮▮URL▮▮:443
2020/11/06 14:16:10 [Info] [437636436] v2ray.com/core/app/dispatcher: taking detour [▮▮TAG▮▮] for [tcp:▮▮URL▮▮:443]
2020/11/06 14:16:10 [Info] [437636436] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:magi.lan:4600
2020/11/06 14:16:10 ▮请求代理的IP▮:60851 accepted tcp:▮▮URL▮▮:443 [▮▮TAG▮▮]

v2ray输出(异常/登录 )

2020/11/06 13:56:45 [Warning] [3944754685] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/socks: failed to establish connection to server > v2ray.com/core/proxy/socks: server rejects request: 4
2020/11/06 13:56:45 [Info] [3944754685] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vmess/inbound: connection ends > io: read/write on closed pipe

error submitting hardware id

背景

有mac地址验证

问题

无法登陆

配置

version: "2"
services:
  easyconnect:
    image: hagb/docker-easyconnect:7.6.7
    restart: unless-stopped
    mac_address: xx:xx:xx:xx:xx:xx
    devices:
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - NET_ADMIN
    volumes:
      - ./.ecdata:/root
    ports:
      - "5901:5901"
      - "1080:1080"

证书路径问题(cert pathname)

我使用的vpn需要证书验证,在7.6.8命令行版本中,输入证书路径(cert pathname)时,尝试路径/root/xxxxxx.p12提示找不到文件(实际root目录有xxxx.p12文件),我想确认一下命令行客户端应该如何使用证书
vpn adress: https://xxxxxxxx
username: xxxxxx
password: xxxxxxxx
cert pathname: /root/xxxx.p12
cert password: xxxxxxx
import certificate failed, reason: !
user "xxxxx" login FAILED!
svpn stop!
auto login is disabled

Loading failed!

通过命令启动:

docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -e PASSWORD=xxxx -v ~/.tools/easy-connect/config:/root -p 127.0.0.1:5901:5901 -p 127.0.0.1:1080:1080 hagb/docker-easyconnect:7.6.7

通过 VNC 登录并能正确获取手机验证码,但是输入手机验证码登录后,提示 Loading failed,如下图:

image

日志

/usr/share/sangfor/EasyConnect/resources/logs/CSClient.log

[2021-05-10 07:30:21][I][  75][StartServices][cs] RcService service start success.
[2021-05-10 07:30:21][I][  77][StartServices][cs] HardIDService service start success.
[2021-05-10 07:30:21][I][  79][StartServices][cs] TrayService service start success.
[2021-05-10 07:30:21][I][  81][StartServices][cs] TimeQryService service start success.
[2021-05-10 07:30:21][I][ 320][InitService][Browse] Start Service sucess.
[2021-05-10 07:30:21][I][  83][StartServices][cs] BrowseService service start success.
[2021-05-10 07:30:21][I][  87][StartServices][cs] all services start success.
[2021-05-10 07:30:21][I][ 114][ProcessMessage][browser] recv msgLen:123, msg:<?xml version="1.0" encoding="utf-8"?>
<BsClient>
<Type>GETALLHARDID</Type>
<Argument></Argument>
<Note></Note>
</BsClient>.
[2021-05-10 07:30:21][I][ 525][ProcessQryHardId][browser] handle hardid message, type = GETALLHARDID.
[2021-05-10 07:30:21][E][  73][Run][cs] local service CheckReady error, try again.
[2021-05-10 07:30:22][E][  73][Run][cs] local service CheckReady error, try again.
[2021-05-10 07:30:22][I][  54][HandleEvent]HardID recv local service hardid event.
[2021-05-10 07:30:22][I][ 129][GetHardId][hardid] recv hardid from local service, hardid = A08B0EFB38A94DC59EB6303AA3F2A3E5|02-42-ac-11-00-02|MTA3NTk1MmJiODJk.
[2021-05-10 07:30:22][E][  73][Run][cs] local service CheckReady error, try again.
[2021-05-10 07:30:23][E][  73][Run][cs] local service CheckReady error, try again.
[2021-05-10 07:30:23][E][  73][Run][cs] local service CheckReady error, try again.
[2021-05-10 07:30:24][E][  73][Run][cs] local service CheckReady error, try again.

Chinese support

Thanks for your sharing, I've tested on the debian package of version 7.6.7.3, worked like a charm.

However, one problem that annoys me sometimes is Chinese failed to render, since EasyConnect show most of its messages in Chinese and some messages are really helpful, e.g., the error message when you failed to connect.

So I tried to add Chinese support and it worked, the following are some hints in case some other guys need them:

# install a Chinese font, I just use microhei here
apt-get install locales ttf-wqy-microhei

echo "Asia/Shanghai" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
echo 'LANG="zh_CN.UTF-8"' > /etc/default/locale
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG=zh_CN.UTF-8

# and set your language environment variables
# here I set them in Dockerfile, adjust according to your needs
ENV LANG zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8

如何少创建容器

每次 docker run 之后,就会创建新的容器,所以尝试使用了 -d 参数,但是在结束掉容器之后,使用 docker start 并不能继续使用,需要怎么解决呢?

分享多个EC版本同时运行的一个方案 及纯CLI登录的讨论

首先感谢 Hagb 的详细的文档和代码,让我少踩了一些坑。
在你的基础上,我又看了安装包内的一些脚本,重新组织了代码,写了一个多个EC版本同时运行的一个方案。
顺便填坑 #25 (comment)
Hagb的多个镜像也可以同时开,我改的初衷主要是减小镜像数量和体积,多个EC版本用到时再挂载,更自由一些。

代码放在这 https://github.com/shmilee/scripts/tree/master/easyconnect-in-docker
已测试版本有 7.6.3, 7.6.7

使用分三步:

  1. 构建build一个多EC版本共用的docker镜像。
  2. 部署deploy多个EC版本到某目录,不同版本有各自的启动脚本start.sh, 以及处理各种问题、启动其他服务的脚本hook_script.sh
  3. 运行不同版本的start.sh,同时向 docker run 传所需的OPTIONS。
    运行正常后,修改版本对应的desktop文件,之后就可以不用命令行打开了。

需要注意的是有几个不同的默认值:

  1. 默认用的X11显示登录界面,VNC的安装、启动放在hook_script.sh,对于使用VNC的用户每次都需安装VNC相关的包,因此可以移入dockerfile,以节省很多时间。
  2. 默认IPTABLES的设置是关闭的。
  3. 代理软件danted配置内权限相关的部分做了修改。
  4. 添加的sshd默认是关闭的。
  5. EC调用浏览器打开网址,处理方式类似之前网址写到文件,不过打开不是在容器内窗口显示,而是在host用默认浏览器打开。
  6. 不同EC版本保存的登录信息在各自的conf目录内,不需要单独挂载处理。

其他反馈:

  1. 登陆过程中的cms client connect failed, 版本7.6.7不需hack,EC能自己处理。
  2. IPTABLES默认关闭,在我使用过程中没发现问题。
  3. 安装包内的脚本最主要的是postinst,处理文件权限相关的部分。
  4. 为了能通过desktop文件运行并且不打开终端窗口,需要docker run不带-i

wsl2下无法创建`tun0`网络设备

问题描述:
docker登陆成功后没有创建tun0网络设备,导致host(wsl2)中无法访问代理端口
docker内安装ssh后连接内网服务器正常

启动指令:

$ docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -p 127.0.0.1:1080:1080 -e EC_VER=7.6.8 -e CLI_OPTS="-d $VPNADDRESS -u USERNAME -p PASSWORD" -e IPTABLES_LEGACY=1 hagb/docker-easyconnect:cli

容器内ifconfig输出:

eth0      Link encap:Ethernet  HWaddr 02:42:AC:11:00:02
          inet addr:172.17.0.2  Bcast:172.17.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:197 errors:0 dropped:0 overruns:0 frame:0
          TX packets:202 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0
          RX bytes:80016 (78.1 KiB)  TX bytes:18759 (18.3 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:380 errors:0 dropped:0 overruns:0 frame:0
          TX packets:380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:86903 (84.8 KiB)  TX bytes:86903 (84.8 KiB)

运行docker run --cap-add NET_ADMIN --device /dev/net/tun -e CHECK_SYSTEM_ONLY=1 hagb/docker-easyconnect:cli没有任何输出。

环境:
wsl2 Ubuntu 20.04 @ Windows 10 20H2 19042.1110
Docker version 20.10.7, build f0df350
amd64 架构

not support "Token Authentication"

I encounter the follow error when I start the container according to your readme (cli version):

...
Next authentication is "Token Authentication"
But we don't support it
user "..." login FAILED!
 -> Enter 'XXX' to exit:

How can I solve this?

请问在macOS下如何转发所有(或部分)流量到socks5代理中?

我的运行指令是:

$ docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -v $HOME/.easyconn:/root/.easyconn -p 127.0.0.1:1083:1080 -e EC_VER=7.6.3 hagb/docker-easyconnect:cli

端口挂在1083是因为已经有其他软件占用了1080端口。通过1083端口,我可以成功ssh over proxy到内网的机器,但是配置System Preferences -> Network -> advanced -> Proxies -> SOCKS proxy为127.0.0.1:1083无法在浏览器上访问内网。而通过swtichyomega我可以单独配置浏览器访问内网web服务。

除了浏览器访问内网web服务之外,我还有用microsoft remote desktop远程桌面至内网机器的需求。请问大家有什么好办法配置吗?

关于docker的使用求助

首先感谢大佬的辛勤付出。我使用的是win10系统,看教程基本没法跟上步骤。大佬的教程是基于linux的吗?还是基于windows?使用docker的部分有没有具体一点的操作步骤或是教程呢?

Socks 代理无法正常访问

问题描述:

  1. CLI 版本容器重复出现:svpn stop! 日志
  2. 因为 svpn stop 太快,导致无法正常使用 Proxy

复现步骤:

按照文档的简明使用 Cli 命令行版本的 easyconnect 容器:
已确保映射宿主 easyconn 至容器

touch ~/.easyconn
docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -v $HOME/.easyconn:/root/.easyconn -p 127.0.0.1:1080:1080 -e EC_VER=7.6.3 hagb/docker-easyconnect:cli

平台:

  1. CentOS 8.2
  2. Docker version 20.10.5, build 55c4c88
  3. x64 架构

日志文件:

user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!
user "xxxxx" auto login successfully
svpn stop!

期望:

  1. 可以正常使用 Proxy

掉线自动重新登陆的次数

现在有个应用场景是docker里面运行EC,掉线后会自动重新登陆。
如果我在另外一台PC上登陆相同的账号,会把docker里面的踢掉,然后docker自动登陆把PC上登陆的踢掉。
能不能设一个变量,限制docker自动登陆的次数,比如3次。这样我PC登陆3次就可以暂时把docker停掉了。
谢谢。

错别字

在 README.md 文件中,
登陆 应改为 登录

Mac 上运行约 20min 后容器自行关闭

RT, mac 10.15.7,docker 19.03.13
运行后一直报这个日志警告,
image
每次运行大概20min左右,容器就会自行关闭,日志也只有(node:39) DeprecationWarning: Calling an asynchronous function without callback is deprecated.这一条日志,

两个问题:

  1. 运行大概20min左右后,容器自行关闭,日志仅有(node:39) DeprecationWarning: Calling an asynchronous function without callback is deprecated. 无其他日志
  2. 一直打这条日志(node:39) DeprecationWarning: Calling an asynchronous function without callback is deprecated. 调用异步函数时缺少回调函数,这个日志感觉已经成为无效日志了

docker: Error response from daemon: OCI runtime create failed:

Today, when I try to run the Hagb/docker-easyconnect image, it failed with the followng error:

$ xhost +LOCAL:
non-network local connections being added to access control list
$ docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority -e EXIT=1 -e DISPLAY=$DISPLAY -e URLWIN=1 -e TYPE=x11 -v $HOME/.ecdata:/root -p 127.0.0.1:1080:1080 hagb/docker-easyconnect
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/home/werner/.Xauthority\\\" to rootfs \\\"/var/lib/docker/overlay2/972dfca71643bda2f2af2f93930092b43b5b1fc6e8af553af3a37fc1bd69420d/merged\\\" at \\\"/var/lib/docker/overlay2/972dfca71643bda2f2af2f93930092b43b5b1fc6e8af553af3a37fc1bd69420d/merged/root/.Xauthority\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
ERRO[0000] error waiting for container: context canceled 
non-network local connections being removed from access control list
werner@X10DAi:~/Public/repo/github.com/hongyi-zhao$ sudo systemctl restart docker
werner@X10DAi:~/Public/repo/github.com/hongyi-zhao$ bash docker-easyconnect.git.sh 
non-network local connections being added to access control list
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/home/werner/.Xauthority\\\" to rootfs \\\"/var/lib/docker/overlay2/b1115099b8eee370b3d4247904378684b1a5118f85d2503d28492e6a3c601494/merged\\\" at \\\"/var/lib/docker/overlay2/b1115099b8eee370b3d4247904378684b1a5118f85d2503d28492e6a3c601494/merged/root/.Xauthority\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
ERRO[0000] error waiting for container: context canceled 

Any hints for this problem?

Regards,
HY

gui7.6.7版本,初始化服务器证书失败?

host系统: macOS 11.2.3
运行的命令:docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -e PASSWORD=xxxx -v $HOME/.ecdata:/root -p 127.0.0.1:5901:5901 hagb/docker-easyconnect
服务端的版本号: 7.6.7
本地映射路径$HOME/.ecdata也已清空或更换,都无效

出现的问题:
在输入账号密码,短信验证码后,出现如下界面
image

在启动ec客户端后, ECAgent.log中出现如下日志(已精简)
其他日志未见明显异常

[2021-04-22 09:26:11][D][ 79][Init][RunData] runtime data size check failed, stat size 0 < len 888
[2021-04-22 09:26:11][I][ 406][GetSelectLineApiResult]Found result in cache, strResult=https://vpn.xxx.com:443, tell backgound thread to refresh the cache
[2021-04-22 09:26:11][I][ 348][ThreadWorkingFunc]to update API cache, strUrl=vpn.xxx.com
[2021-04-22 09:26:11][I][ 9][GetApiResult][LineImplementor] select url(vpn.xxx.com) running enter, threadid(757290752)
[2021-04-22 09:26:11][I][ 734][InitECAgent]init ecagent type(1) address(vpn.xxx.com 443)
[2021-04-22 09:26:11][E][2376][FetchFromVPN][Agent] status(0): error(SSL connect error), url(https://1.2.3.4:443/com/server.crt)
[2021-04-22 09:26:11][E][2381][FetchFromVPN]http response is error,status(0)
[2021-04-22 09:26:11][E][2634][FetchServerCertFormVPN]fetch vpn ca req code (0) failed
[2021-04-22 09:26:11][E][ 421][InitServerCert]InitServerCert ret = 1
[2021-04-22 09:26:12][I][ 95][onGetWebContentCallback][LineSelector] onGetWebContentCallback: error=0, code=200, url=http://vpn.xxx.com
[2021-04-22 09:26:12][I][ 333][pickBestLine][LineSelector] line[0]: lineLink=https://vpn.xxx.com:443/por/login_psw.csp, testLink=
[2021-04-22 09:26:12][I][ 47][GetApiResult][LineImplementor] select url(vpn.xxx.com) running finish
[2021-04-22 09:26:12][I][ 283][GetApiResult]ApiNeedUpdateImplementor start running enter
[2021-04-22 09:26:12][I][ 154][requestForceUpdateInfo]custom value is 0, try requestForceUpdateInfo
[2021-04-22 09:26:12][E][ 80][Run]time interval not over 12 hour currentTime(1619083572), lastModifyTime(1619078214), do not request
[2021-04-22 09:26:12][I][ 148][UpdateApiCache]UpdateApiCache, strUrl=vpn.xxx.com, selectLineRet=1, strSelectLineApiResult=https://vpn.xxx.com:443, strVpnAddress=https://vpn.xxx.com:443, strNeedUpdateApiResult=3
[2021-04-22 09:26:12][I][ 500][GetNeedUpdateApiResult]Found result in cache, strResult=3

在比对正常启动的日志后,发现如下

[2021-04-22 09:26:12][D][ 79][Init][RunData] runtime data size check failed, stat size 0 < len 888 (正常启动无此报错)

[2021-04-22 09:26:12][E][2376][FetchFromVPN][Agent] status(0): error(SSL connect error), url(https://1.2.3.4:443/com/server.crt) (出于未知原因,请求了IP地址+443端口的证书,ssl校验失败,其他请求走的都是域名形式,偏偏这个请求了ip,很奇怪)
[2021-04-22 09:26:12][E][ 421][InitServerCert]InitServerCert ret = 1 (正常启动这里ret结果为0)

Failed to start docker-easyconnect with vnc based method.

On Ubuntu 20.04, according to your notes, I try to run docker-easyconnect with the vnc capability enabled as shown below:

$ docker pull hagb/docker-easyconnect
$ docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -e PASSWORD=xxxx -v $HOME/.ecdata:/root -p 127.0.0.1:5901:5901 -p 127.0.0.1:1080:1080 hagb/docker-easyconnect
rm: cannot remove '/usr/share/sangfor/EasyConnect/resources/conf/easy_connect.json': No such file or directory
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.
/usr/bin/xauth:  unable to link authority file /root/.Xauthority, use /root/.Xauthority-n
/usr/bin/xauth:  unable to link authority file /root/.Xauthority, use /root/.Xauthority-n
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.
Use of uninitialized value $proto in socket at /usr/bin/tigervncserver line 357.

New 'fd56b5125f51:1 (root)' desktop at :1 on machine fd56b5125f51

Starting applications specified in flwm
Log file is /root/.vnc/fd56b5125f51:1.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /root/.vnc/passwd fd56b5125f51:1 to connect to the VNC server.

(node:67) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
[...]

Then I installed tigervnc-viewer and log into the VNC server running in container:

$ sudo apt-get install tigervnc-viewer
# Use host: 127.0.0.1:5901 and passwd: xxxx to log into the VNC server running in container.
$ vncviewer  

Then I try to set the socks5 proxy on host as 127.0.0.1:1080 for Firefox with SwitchyOmega. But I find it can't give me access to the resources located in my organization’s intranet.

OTOH, I can do the trick with the x11-socket as shown below:

$ xhost +LOCAL:
$ docker run --device /dev/net/tun --cap-add NET_ADMIN -ti -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority -e EXIT=1 -e DISPLAY=$DISPLAY -e URLWIN=1 -e TYPE=x11 -v $HOME/.ecdata:/root -p 127.0.0.1:1080:1080 hagb/docker-easyconnect
$ xhost -LOCAL:

Any hints for this problem?

Regards,
HY

全局透明代理无效,启动后在navicat中不能访问数据库

系统是manjaro

启动脚本参照记折腾容器化 EasyConnect 的全局透明代理
可以正常启动easyconnect, 但是不能直接在浏览器和navicat中访问内网ip如:172.23.120.111, 配置SOCKS的情况下,浏览器可以访问。 怎样才能不配置SOCKS, 同时保证浏览器和navicat访问172.23.120.111呢?

#!/bin/bash
NAME='easyconnect'
NET='svpn'
# 启动并删除原来的 docker 和 网络关
docker stop  easyconnect  && docker network  rm svpn
docker network create "$NET"
xhost +LOCAL:
docker run -d --network svpn --rm --name "$NAME" --device /dev/net/tun \
    --cap-add NET_ADMIN -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v $HOME/.Xauthority:/root/.Xauthority -e DISPLAY=$DISPLAY \
    -e TYPE=x11 -v $HOME/.ecdata:/root -p 127.0.0.1:1080:1080 \
    hagb/docker-easyconnect
while docker exec $NAME [ ! -d /sys/class/net/tun0 ]
do
sleep 5
done
docker exec "$NAME" iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
IP="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$NAME")"
MTU="$(docker exec "$NAME" cat /sys/class/net/tun0/mtu)"

sudo ip route flush table 3
# sudo ip route add table 3 default via "$IP" mtu "$MTU"
sudo ip route add table 3 172.23.120.0/24 via "$IP" mtu "$MTU"
sudo ip route add table 3 172.23.1.0/24 via "$IP" mtu "$MTU"
# sudo ip route add table 3 172.23.0.0/24 via "$IP" mtu "$MTU"
sudo ip rule add iif lo table 3

启动后,配置系统的SOCKS代理127.0.0.1 1080,可以在浏览器访问内网地址如:172.23.120.111
怎样才能不配置SOCKS, 同时保证浏览器和navicat访问172.23.120.111呢?

如下是docker的日志

(node:48) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:48) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:48) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:48) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:48) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

ip link

[imic@imic my]$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether c8:5b:76:34:59:a7 brd ff:ff:ff:ff:ff:ff
3: wlp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 40:f0:2f:5c:d8:84 brd ff:ff:ff:ff:ff:ff
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:52:38:21:bc brd ff:ff:ff:ff:ff:ff
11: br-b0a8c2fca678: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default 
    link/ether 02:42:5a:e4:f3:65 brd ff:ff:ff:ff:ff:ff
13: veth94a3e88@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-b0a8c2fca678 state UP mode DEFAULT group default 
    link/ether f6:89:6f:12:e8:99 brd ff:ff:ff:ff:ff:ff link-netnsid 1

iptables -L

[imic@imic my]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy DROP)
target     prot opt source               destination         
DOCKER-USER  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER (2 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             localhost            tcp dpt:socks

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination         
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-ISOLATION-STAGE-2 (2 references)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-USER (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere    

About the socks5 proxy service supplied by this project.

Hi,

I noticed this project and it seems very interesting. As you have told in the description for this project: Let the non-free proxy software EasyConnect developed by Sangfor runs in docker cnotainer and provides a socks5 proxy service. I just want to know how you can convert a VPN service to a socks5 service. I inspected a little the danted.conf configuration file used in this project. But I still not so clear on the working mechanism. Could you please kindly give me some more explanations/hints?

Regards,
HY

与服务器版本不匹配

我用docker安装之后,运行example 依旧是显示与服务器版本不匹配,宿主机器为ubuntu18

docker-compose 运行容器,容器无法访问互联网

可以访问互联网

docker run --name="vpn" --device /dev/net/tun --cap-add NET_ADMIN -ti -v /opt/easyconnect/easyconn:/root/.easyconn -p 1080:1080 -e EC_VER=7.6.7 hagb/docker-easyconnect:cli

不可以访问互联网

version: '3.3'
services:
  easyconnect:
    image: "hagb/docker-easyconnect:cli"
    cap_add:
      - NET_ADMIN
    volumes:
      - /opt/easyconnect/easyconn:/root/.easyconn
    devices:
      - "/dev/net/tun:/dev/net/tun"
    environment:
      - EC_VER=7.6.7
      - EXIT=1
    ports:
      - "1080:1080"

ARM支持?

请问有可能添加ARM支持嘛?想独立跑在树莓派上比较安全.

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.