flineca / blog

To use issues as a blog.
MIT License
0 stars 0 forks source link

OpenWrt VPN #10

Open flineca opened 2 years ago

flineca commented 2 years ago

I tried PPTP on LuCI and successfully connect to it with my phone(data roaming), but others can not.

It is said that only via local net can we visit this vpn. So I changed the firewall configuration(indiscriminately by myself...), then my network suddenly shut down... And the wan light flashed red... Super sorry at that time but fortunately it returned normal after nearly 15 minutes.

Maybe I'll try openVPN in the furure. Here is the openVPN server tutorial Here is the openVPN tutorial in Chinese.

flineca commented 1 year ago

I think backup can be done before all configuration and after generating the client profile.

flineca commented 1 year ago

I updated the system and followed the official tutorial to build openVPN server. Successfully it works.

Then for clients(PC/Mac/Phone) the "openVPN connect" software is needed, but the official site https://openvpn.net/ also need a ladder for mainland (orz)

Notes:

Q1

When it comes to this section:

# Fetch FQDN from DDNS client
NET_FQDN="$(uci -q get ddns.@service[0].lookup_host)"
if [ -n "${NET_FQDN}" ]
then OVPN_SERV="${NET_FQDN}"
fi

My result is like below, the defaut set:

root@OpenWrt:~# echo $NET_FQDN
yourhost.example.com
root@OpenWrt:~# echo $OVPN_SERV
yourhost.example.com

Q2

root@OpenWrt:~# openvpn --genkey tls-crypt-v2-server ${EASYRSA_PKI}/private/server.pem
Options error: Unrecognized option or missing or extra parameter(s) in [CMD-LINE]:1: genkey (2.4.11)
Use --help for more information.

The solution is here

flineca commented 1 year ago

Other useful blogs:

multi-client

Linux server and clients
How to make one single ovpn work for multi clients Win/Mac client tutorial <-But in fact it is simple, just download softwares on the official sites. How to generate multiple creds for clients

flineca commented 10 months ago

If you want to use DDNS

I recommend YDNS, cause