Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Connect to DigitalOcean droplet localhost through WireGuard
I used a PiVPN setup at home and was able to access localhost resources using my mobile phone successfully. I now however am looking to access some localhost resources hosted on a DigitalOcean doplet. I have managed to install PiVPN the same way, and I am able to connect to the wireguard server and route all traffic through the VPS successfully (my IP shows as the DigitalOcean server IP).
What I can not do however, is access localhost resources. For testing I installed an Nginx server running on localhost, which is at 10.18.0.5 on the droplet, but I can not reach this from my home computer.
Configs are as follows:
Home computer (named alice for testing):
[Interface] PrivateKey = ILLHtp3d6qyP2wfWvBgsys3tTGfLUv6at7Jf9t/Y2X4= Address = 10.6.0.2/24 DNS = 22.214.171.124, 126.96.36.199 [Peer] PublicKey = XXX PresharedKey = XXX Endpoint = XX.XX.XX.XX:51820 (VPS IP address) AllowedIPs = 0.0.0.0/0, ::0/0
[Interface] PrivateKey = XXX Address = 10.6.0.1/24 ListenPort = 51820 PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQ> PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MA> ### begin alice ### [Peer] PublicKey = XXX PresharedKey = XXX AllowedIPs = 10.6.0.2/32 ### end alice ###
Some extra notes:
- I can reach the Nginx server with curl 10.18.0.5 on the VPS, the Nginx server does run
- I am able to ping 10.6.0.1 and 10.18.0.5 from the home computer
Any help would be appreciated!