页面: 1
一、给群晖启用代理 [docker镜像在大陆地区无法正常使用]
1.在container manager中勾选Docker hub https://registry.hub.docker.com 为默认,并启用镜像仓库镜像
2.在群晖控制面面板-网络-常规-代理服务器,将填入局域网电脑的代理(clash的话,需要开启局域网链接)
二、创建softether需要存储数据的文件夹
1.在docker文件夹中创建softether文件夹,然后在softether中继续创建softether_data和softether_log
三、准备yaml文件
官网:https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/docker-compose.yaml
修改对应的端口和存储数据路径
注:
1.
59443:443 59443为群晖映射到docker里443端口2.
/volume1/docker/softether/softether_data 为对应上述创建的文件夹3.默认网络为bridge模式,若改为host模式,在添加network_mode: host 到目录中
4.使用的官方docker镜像,名称为:softethervpn 版本为:5.2.5188 改为latest也可以
5.使用4.4.2版本重启容器后不能在无法在/volume1/docker/softether/softether_data保存配置文件保存数据,不知为何
原因为每个版本的配置文件存储位置不同:
例如:5.2.5188版本,存储路径为:/var/lib/softether
4.43版本的存储位置为:/mnt
具体可以在容器中查看,最好看官方说明在container manager创建项目,其中yaml文件填写为:
services:
softether:
image: softethervpn/vpnserver:5.2.5188
hostname: softethervpnserver
cap_add:
- NET_ADMIN
restart: always
ports:
#- 53:53 #DNS tunneling
- 59443:443 #Management and HTTPS tunneling
#- 992:992 #HTTPS tunneling
#- 1194:1194/udp #OpenVPN
#- 5555:5555 #HTTPS tunneling
#- 500:500/udp #IPsec/L2TP
#- 4500:4500/udp #IPsec/L2TP
#- 1701:1701/udp #IPsec/L2TP
volumes:
- "/etc/localtime:/etc/localtime:ro"
# - "/etc/timezone:/etc/timezone:ro"
- "/volume1/docker/softether/softether_data:/var/lib/softether"
- "/volume1/docker/softether/softether_log:/var/log/softether"
# - "./adminip.txt:/var/lib/softether/adminip.txt:ro"
用softether管理软件链接群晖IP:59443 即可管理Softether
离线
前几次发现重启docker后,配置文件就后丢失,后面不知道为何也正常了。主要是
/volume1/docker/softether/softether_data/vpn_server.config 文件没有正常保存,一直是初始化的设置
如果出现上述问题,可以通过先将配置好的vpn_server.config文件,下载下来后,重新上传到服务器,替换掉即可
离线
在腾讯云中创建一个新的hub,关闭掉NAT功能,无需桥接,新建两个账户,一个给群晖中softether级联使用,一个给客户端使用。(客户端如果使用openvpn的话,账户后需要加@hub名称)
用softether管理软件,链接群晖。添加hub后,级联到腾讯云。可以不桥接(官网说明不支持桥接,但有第三方方法,没成功过),开启NAT设置。
在群晖防火墙中将softether所使用的bridge网段例如:172.22.0.0/16添加到防火墙中,允许所有端口访问。不然无法访问群晖宿主机
离线
将腾讯云中openvpn config 导出到客户端,在config文件中添加:
pull-filter ignore "dhcp-option DNS"
pull-filter ignore redirect-gateway
route 10.10.10.0 255.255.255.0 vpn_gateway
route-nopull这样VPN上网流量还是通过本机,访问家里网段10.10.10.0/24 才走VPN网关
注:腾讯云要是存在多个hub,openvpn客户端用户名需要加@被级联的那个hub名称。
例如被级联的hub名称为 hub002 里面创建了用户名vpn001
那么openvpn客户端链接使用,用户名输入:vpn001@hub002
使用softether官方客户端不需要输入,可以手动选择hub名称即可,但由于主机不支持路由推送(需要破解),建议使用openvpn
离线
忘记Softether密码,或者siomiz/softethervpn 安装不知道默认密码
1、关闭服务端的 SoftEther VPN 服务(不关闭第2步修改配置文件会失败,启动后又变成老的配置了)。
2、修改server vpn安装目录下的 vpn_server.config 文件,找到里面的”declare ServerConfiguration”部分,里面有个”byte HashedPassword xxxxxxx”,将 xxxxxxx 改为”+WzqGYrR3VYXrAhKPZLGEHcIwO8=”(默认密码为空白)。
离线
Host网络模式说明:
以下述yaml文件为例
services:
softether:
image: softethervpn/vpnserver:5.2.5188
network_mode: host
hostname: softethervpnserver
cap_add:
- NET_ADMIN
restart: always
#ports:
#- 53:53 #DNS tunneling
#- 59443:443 #Management and HTTPS tunneling
#- 992:992 #HTTPS tunneling
#- 1194:1194/udp #OpenVPN
#- 5555:5555 #HTTPS tunneling
#- 500:500/udp #IPsec/L2TP
#- 4500:4500/udp #IPsec/L2TP
#- 1701:1701/udp #IPsec/L2TP
volumes:
- "/etc/localtime:/etc/localtime:ro"
# - "/etc/timezone:/etc/timezone:ro"
- "/volume1/docker/softether/softether_data:/var/lib/softether"
- "/volume1/docker/softether/softether_log:/var/log/softether"
# - "./adminip.txt:/var/lib/softether/adminip.txt:ro"去掉端口,反正也没用。正常启用后,再停止。然后在/volume1/docker/softether/softether_data/vpnserver_config 这个的配置文件中,将其下载后,重新填写端口后(不要和宿主机相同端口),并看有没有其他端口冲突。然后重新上传后,重启项目即可。
但群晖有限制,启用host的容器和宿主机无法互通。
离线
群晖开启 bridge-host,容器直接桥接主机,使用局域网IP:
1.打开群晖控制面板 —网络—-网络界面—-管理—Open vSwitch设置-启用Open-vSwitch
2.群晖控制面板—终端机和SNMP—开启SSH功能
3.ssh登录后,输入:sudo -i 切换到root
4.执行创建网络命令,指令根据自己的IP网段修改,我的IP网段为192.168.0.X,网关地址为192.168.0.1,根据自己的情况修改。
//执行创建网络命令
docker network create –d macvlan —subnet=192.168.0.0/24 —gateway=192.168.0.1 –o parent=ovs_eth0 bridge–host5.在docker的网络中可以查看到brige-host,可以进去指定容器
离线
页面: 1