add openvpn

This commit is contained in:
dashan 2022-12-29 23:50:14 +08:00
parent 78a5165346
commit f935f57b02
5 changed files with 63 additions and 0 deletions

63
apps/openvpn/OpenVPN.md Normal file
View File

@ -0,0 +1,63 @@
openvpn-server
The git repository is available at: https://github.com/angristan/openvpn-install
##### 自定义openvpn网关
```bash
sudo vim /etc/openvpn/server.conf
#修改server.conf文件
server 10.0.11.0 255.255.255.0
```
##### 设置openvpn 客户端之间互通
```bash
sudo vim /etc/openvpn/server.conf
#在server.conf文件中添加
client-to-client
```
##### openvpn 客户端连接服务器后无法ping通内网服务
打开配置文件注释一下两行内容
```
#ignore-unknown-option block-outside-dns
#setenv opt block-outside-dns # Prevent Windows 10 DNS leak
```
添加下方配置行到配置文件底部
```
route-nopull
route 10.0.11.0 255.255.255.0 vpn_gateway
```
> 注意route后的 ip地址 需要填写你在服务器上配置的server地址默认是10.8.0.0
##### windows 客户端连接多个服务器
默认openvpn只会创建一个虚拟网卡所以同时只能连接一个服务器
打开此文件夹 `"C:\ProgramData\Microsoft\Windows\Start Menu\Program\OpenVPN\Utilities"` 双击击下方标记程序添加一个虚拟网卡然后就可以同时连接多个服务器了
![image-20221122235709604](assets/image-20221122235709604.png)
##### windows 设置openvpn gui 开机自启并且自动连接服务器
右击openvpn快捷方式图标点击属性然后在目标输入框的尾部添加 `--connect client.ovpn`
![image-20221122234949353](assets/image-20221122234949353.png)
win+R 输入`shell:startup`打开 自启文件夹
![image-20221122235136340](assets/image-20221122235136340.png)
然后将快捷方式复制到该文件夹下
![image-20221122235329742](assets/image-20221122235329742.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB