Last active
May 20, 2024 07:04
-
-
Save rameshkrishna/17e14ee67405fe41dab997d48b65f4f5 to your computer and use it in GitHub Desktop.
OpenVPN with Cloudflared Tunnels - No Port Fowarding - No Static IP - NO DDNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task: | |
Access OpenVPN or any Service on Home Network from Public Networks (Hotel) without configuring router and without static IP | |
Step 1: | |
Install OpenVPN on any device connected to Home Network (Raspberry mychoice with pivpn) | |
- Change default OpenVPN protocol from UDP to TCP (Cloudflare doesn't support UDP) | |
- Make a note of TCP port number (default is 443) | |
- Grab the OpenVPN client config file | |
Step 2: | |
Install Cloudflared on Raspberry PI | |
- Create a tunnel | |
- Add route to tunnel (cloudflared tunnel route dns tunnelName tunnelName.domain.com) | |
- Example config: | |
tunnel: 6ff42ae2-765d-4adf-8112-31c55c1551ef | |
credentials-file: /root/.cloudflared/6ff42ae2-765d-4adf-8112-31c55c1551ef.json | |
ingress: | |
- hostname: tunnelName.domain.com | |
service: tcp://127.0.0.1:443 (OpenVPN Server's Local IP ) | |
- service: http_status:404 | |
- Run the tunnel (You can also setup cloudflare service) | |
Step 3: | |
- Install Cloudflared on your Machine - OpenVPN Client Machine (Machine on Public Network) | |
- Create a connection to your OpenVPN Server | |
cloudflared access tcp --hostname tunnelName.domain.com --url 127.0.0.1:87548 (port_of_your_choice) | |
- Now update remote in OpenVPN config file with 127.0.0.1:87548 | |
- If you want to protect your openvpn with Cloudflare's free Protection add to Cloudflare Teams, When Profile is imported and | |
connected user will be prompted with login page. as a 2FA | |
Step 4: | |
- Download OpenVPN Client | |
- Import profile and Connect |
is it working?
No.. i did end up install pivpn and open port on router.. :/ but its working great!
Same setup works fine with V2Ray, CGNET works fine.
Just got this to work. Thanks!!!
The only thing that was incorrect and needed adjustment was the change in the OpenVPN config file. It needs to be 127.0.0.1 87548 instead of 127.0.0.1:87548. Whitspace instead of ":".
Everything else worked fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is it working?