r/WireGuard • u/Outrageous-Part7294 • Jan 12 '24
Can anyone give me a run down of how Wireguard works and what it can do?
Recently been looking into vpns but I don't know much, explain like I'm 5 pls
r/WireGuard • u/Outrageous-Part7294 • Jan 12 '24
Recently been looking into vpns but I don't know much, explain like I'm 5 pls
r/WireGuard • u/ferriematthew • May 08 '25
I had ChatGPT generate an idiot-proof setup script to set up WireGuard on my Pi inside my home network and also print out the tunnel configuration file that I copied to the laptop end, and IT FREAKING WORKED!!!
Here's the prompt and the response I got:
Me: "I would like you to generate a shell script to automate the server-side setup and print out the full text of what the client side conf should be."
CGPT: "Hereâs a server-side setup shell script for the Raspberry Pi and a fully generated client config file. This script automates everything including key generation, IP forwarding, firewall rules, and basic WireGuard config.
Save this as setup_wireguard_server.sh and run with sudo bash setup_wireguard_server.sh.
#!/bin/bash
set -e
echo "[+] Installing WireGuard..."
apt update && apt install wireguard -y
echo "[+] Enabling IP forwarding..."
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sysctl -p
echo "[+] Creating WireGuard directory..."
mkdir -p /etc/wireguard
cd /etc/wireguard
umask 077
echo "[+] Generating server keys..."
wg genkey | tee server_private.key | wg pubkey > server_public.key
SERVER_PRIV=$(<server_private.key)
SERVER_PUB=$(<server_public.key)
echo "[+] Generating client keys..."
wg genkey | tee client_private.key | wg pubkey > client_public.key
CLIENT_PRIV=$(<client_private.key)
CLIENT_PUB=$(<client_public.key)
echo "[+] Creating WireGuard config file..."
cat > wg0.conf <<EOF
[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = ${SERVER_PRIV}
SaveConfig = true
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = ${CLIENT_PUB}
AllowedIPs = 10.0.0.2/32
EOF
echo "[+] Enabling and starting WireGuard..."
systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
echo "[+] Done. Below is your client config â copy it to your laptop:"
echo
echo "-----------------------------------------------"
echo "[Interface]"
echo "PrivateKey = ${CLIENT_PRIV}"
echo "Address = 10.0.0.2/24"
echo "DNS = 1.1.1.1"
echo
echo "[Peer]"
echo "PublicKey = ${SERVER_PUB}"
echo "Endpoint = <YOUR_PUBLIC_IP_OR_DDNS>:51820"
echo "AllowedIPs = 0.0.0.0/0"
echo "PersistentKeepalive = 25"
echo "-----------------------------------------------"
echo
echo "[!] IMPORTANT: Replace <YOUR_PUBLIC_IP_OR_DDNS> with your actual IP or dynamic DNS domain."Youâll see this printed at the end:
[Interface]
PrivateKey = <ClientPrivateKeyGenerated>
Address = 10.0.0.2/24
DNS = 1.1.1.1
[Peer]
PublicKey = <ServerPublicKeyGenerated>
Endpoint = <YOUR_PUBLIC_IP_OR_DDNS>:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25Just replace <YOUR_PUBLIC_IP_OR_DDNS> with your home IP address or DuckDNS name.
Want me to generate a matching script for the client side (like for Linux) too?"
r/WireGuard • u/brando56894 • Nov 09 '23
Edit: It looks like the ISPs have been my pain point:
If your ISP blocks all incoming connections as in the case with CGNAT, you will not be able to directly connect to your home network via WireGuard on OPNsense. You will have to consider using a Virtual Private Server (VPS) to create a VPN tunnel or some other means such as Cloudflare Argo tunnels in order to access services on your home network remotely.
I'm using AT&T Fiber, which implements CGNAT and I would have to rent a static IP from them apparently to get this to work according to what I've read.
I even stood up a clean VM in Hetzner which had nothing but WireGuard running on it, natively, and I still can't even ping my router's LAN IP (192.168.1.1). It just keeps saying "Destination host unreachable"
10.10.10.1 is the WG "server" on OpnSense in my LAN, 192.168.1.1 is OpnSense's LAN IP
root@wg-test:~# ping 10.10.10.1
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
64 bytes from 10.10.10.1: icmp_seq=1 ttl=64 time=135 ms
...
^C
--- 10.10.10.1 ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 8011ms
rtt min/avg/max/mdev = 134.700/135.279/136.070/0.424 ms
root@wg-test:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 10.10.10.5 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Required key not available
....
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2042ms
root@opnsense:~ # ping 10.10.10.5
PING 10.10.10.5 (10.10.10.5): 56 data bytes
64 bytes from 10.10.10.5: icmp_seq=0 ttl=64 time=136.887 ms
64 bytes from 10.10.10.5: icmp_seq=1 ttl=64 time=135.927 ms
^C
--- 10.10.10.5 ping statistics ---
3 packets transmitted, 2 packets received, 33.3% packet loss
round-trip min/avg/max/stddev = 135.927/136.407/136.887/0.480 ms
root@wg-test:~# ip route
default via 172.31.1.1 dev eth0 proto dhcp src <public Hetzner IP> metric 100
10.10.10.0/24 dev wg0 scope link
172.31.1.1 dev eth0 proto dhcp scope link src <public Hetzner IP> metric 100
185.12.64.1 via 172.31.1.1 dev eth0 proto dhcp src <public Hetzner IP> metric 100
185.12.64.2 via 172.31.1.1 dev eth0 proto dhcp src <public Hetzner IP> metric 100
192.168.1.0/24 via 10.10.10.5 dev wg0Here's the relevant firewall rules from OpnSense
root@opnsense:~ # pfctl -s rules | grep wg
scrub on wg1 all fragment reassemble
block drop in on ! wg1 inet from 10.10.10.0/24 to any
pass in quick on wg1 inet from (wg1:network) to any flags S/SA keep state label "c17fe93ec844ff0346ab97952fc597d3"Maybe it's because I've been using OpenVPN for a decade on and off, but I find it significantly easier to get it working than WireGuard. I have literally been trying for years to get WireGuard working so that a remote client can access my internal network and the furthest I've ever gotten was getting in, but can't contact anything outside of the tunnel.
I'm a Linux System Engineer, so I'm no noob when it comes to Linux and networking, I've also setup an OpenVPN server from scratch and had it working perfectly. WireGuard on the other hand? It's like quantum physics to me....
I've attempted it natively on baremetal Linux servers, docker on a BM server, running in on OpnSense, and other ways and I pretty much get nowhere.
I just spent about two hours first setting up a client using the wg-easy docker container, ensuring that the port is open on my router and I could get my phone (while on the cell network, not wifi) to connect to the tunnel, but I couldn't ping anything on my LAN.
WG_ALLOWED_IPS is set to 0.0.0.0./0 (I've also tried something like 10.10.10.2/32 and 10.10.10.0/24) [my lan subnet is 192.168.1.0/24]
WG_HOST is set to my public IP
WG_PORT is set to 51280
After creating a container and creating a client, I'd import that client into the WireGuard app on my Android phone, I'd see it connect, but that's about it. Pinging 192.168.1.1 from my phone on the cell network would give zero responses. I also attempted to set it up on my VM in Hetzner (using the Arch Wiki, even though it's running Ubuntu) and OpnSense in my LAN and that went nowhere either, even though 51280 was open on both firewalls.
Getting fed up, I enabled OpenVPN (which I already had setup previously, from a year or more back when I had last used OpnSense), browsed to the LAN IP on my phone and the Client Export section under OpenVPN, typed in my Public IP in the hostname section (my FQDN is still registered to my Hetzner VM ATM), downloaded the config on my phone and imported it into the OpenVPN app on Android, connected and it worked perfectly. I could hit every LAN IP from the cell network.
I always see everywhere that WireGuard is supposed to be super easy/dead simple to setup and I'm like "WTF am I doing wrong that it literally never works the way I want it to?"
r/WireGuard • u/SkysTheLimit888888 • Sep 28 '24
OpenVPN feels a lot faster when connected to mapped network drives. SMB drives disconnect constantly over WG, directory listings, and transfers feelconsiderably slower as well.
I am using an ASUS RT-88XU with merlin firmware. My wireguard configuration is sparse. I did add an MTU of 1320, and that helped a little but still doesn't feels as snaps as openvpn. Are the any other settings that would be useful to look into?
r/WireGuard • u/Danylorus • Aug 27 '26
Hi, I am completely new to the world of VPNs, basically I want to use chatgpt with my windows PC but it is blocked by the country, I tried using other regular vpns by they are cutting the wifi speed by 100x. I have never coded in my entire life and I don't totally understand how wireguard works
VPN providers have servers, each server has an IP adress (like an identity) and they can generate a QR code with this identity, you have to scan the QR code so the information can be processed into a file that you put into your wireguard installer on your PC. Is that right ?
That leads me with other questions: once you do that, do you still have to pay for the VPN subscription ? how do you actually get that information if you a server ? Is there public QR codes of servers that I can use to set up my wireguard?
Thank you very much
PS: I don't really like computers, totally new, if you just want to showcase how dumb I am please refrain yourself from doing so, highly appreciated
r/WireGuard • u/Nantioze • Jan 01 '25
I'm using Wireguard for a lan to lan connection between my travel router and my router at home.
This way I can use my home internet connection when browsing the web while travelling and also connect to my lan devices as at home.
This has always worked perfectly until now. The hotel wifi I'm on now, uses a 10.0.10.x range and my home LAN uses a 10.2.x.x range.
I am able to browse the net using my home Internet connection but I'm not able to connect to the devices on my home lan.
Is there any config what would this work? Or is it impossible because the hotel wifi I'm on and my home lan are both using the 10.x.x.x range?
r/WireGuard • u/TOWER-PC • Jul 02 '26
I'm trying to implement WireGuard in a company with approximately 20 laptops. My main problem is that once the WireGuard tunnel is connected, it doesn't disconnect despite restarts, shutdowns, sleep, hibernation, etc. On one hand, I'm trying a scheduled task to close the tunnel with these power events so that even if the user forgets the tunnel is connected at the end of the day, it disconnects every time there's a shutdown/sleep event. Another idea is to make it persistent and use a rule in the company's network controller to prevent WireGuard from connecting when the employee is physically in the office, so that all traffic goes through the computer's "original" network. But I see that in this last case, if the office's ISP were to change its public IP address (or if WAN1 goes down and WAN2 remains as a backup), the connection of users who are connected wouldn't renew the IP address of the subdomain configured on the peer. I would inevitably have to deactivate and reactivate the tunnel. How have you implemented WireGuard in companies, whether small, medium, or large? Thank you, and please excuse my "translated" English.
r/WireGuard • u/No-Main_007 • Aug 31 '25
r/WireGuard • u/trireme32 • Sep 05 '24
When my sonâs Win11 PC is on his school network and I have Wireguard enabled he is unable to access the internet at all. I understand this is because of how most school networks route traffic. If there is a way to fix that, that would be ideal.
If not, how can I configure the VPN client to exclude the schoolâs SSID?
r/WireGuard • u/Gray48621 • Feb 06 '24
I am trying to set up a wire guard server (mainly so that I can use it as a school to get around restrictions) but I soon realized that my school blocks most direct IP address access. I tried to use my domain, which I know is unblocked, but Wireguard seems to get the IP address it points to instead of just using it directly, which causes an error due to my IP being blocked. I can host an HTTP server from my domain, pointing to the same IP, and it works fine, but not if I directly access my IP (this is why I think my IP is blocked but not my domain). I have no idea if I'm understanding this correctly, just guessing based on my basic understanding of IPs and domains. Does anybody have any ideas on how to get around this?
My config file for the client is currently this:[Interface]
PrivateKey = (private key)
Address = 192.168.6.20/24
[Peer]
PublicKey = MLUabEP5mTlTo+k5JfZbmit9/9rk2VDQ4yMUrfnGqgk=
AllowedIPs = 0.0.0.0/0
Endpoint = MY-DOMAIN:51820
r/WireGuard • u/TinyIntention6424 • Nov 21 '25
I am deploying wireguard thru Netmaker and everything is working like a charm but DNS. I need that clients connect to server by hostname and not IP because they either connect by VPN or locally and in this last scenario the ip will be different. Also hostname.nm.xxx is not a valid solution, i will need hostname only.
r/WireGuard • u/[deleted] • Apr 06 '20
subj
r/WireGuard • u/meeninta • Dec 14 '23
I tested using the same exact devices on both sides (server and client). Same exact connection methods. Same everything.
Wireguard speeds: 100 mb
OpenVPN speeds: 900+ mb
How is this possible?
r/WireGuard • u/phects • 7d ago
I have been building juist, a mesh VPN where nothing runs in the middle, neither a vendor's server nor your own. WireGuard is used for the p2p tunnels, and NAT traversal comes from Tailscale's open-source (BSD) libraries.
I use it to reach my homelab (because Tailnet Lock or Headscale did not go far enough for me).
Tunnels are quantum-safe: Every WireGuard handshake mixes in a preshared key that each pair of devices agrees on with ML-KEM-768 after the first log sync. The log itself is signed with ML-DSA-44.
Features:
No control plane: devices find each other on the LAN, through each other, or via the public BitTorrent DHT. They punch through NAT and fall back to a relay that one of your own devices runs.
Membership is a signed log: adding or removing a device takes a k-of-n quorum of admins, whose keys stay on their own devices. Every device checks the log itself.
Fail-closed if you want: always-on "voucher" devices vouch hourly. A device that has not been vouched for in 48h keeps tunnels only to vouchers.
Homelab services: access policies, exit nodes, subnet routes, names, publishing services through an ingress.
Linux (Debian/Ubuntu/Fedora packages) and FreeBSD, plus an Android app (F-Droid repo).
Install: curl -fsSL https://juist.nning.io/install | sh
Repo: https://github.com/nning/juist
Docs: https://juist.nning.io
Disclaimer: Juist has been developed with AI agents (Opus 5.5). I direct the design and test it on my own hardware but I did not write any line of code and no human has audited it yet. The docs explain the architecture, design, development process, and quality assurance. Feedback and breaking it are very welcome, do not run anything critical behind it yet.
r/WireGuard • u/Available_Leading556 • Nov 08 '25
Wireguard can ping 8.8.8.8 success but can not ping Google.com ,dns already set 8.8.8.8ïŒhow to solve this problem
r/WireGuard • u/StruggleElegant3855 • May 15 '23
r/WireGuard • u/[deleted] • Sep 09 '21
Can someone clarify something for me?
I've been using OpenVPN for the longest time and like how you not only need the .ovpn file to connect, you also need to provide username/password authentication as the second factor.
With WireGuard, my experience so far is there is no authentication other than taking a file exported from the server and adding it to the client. Instinctively, that feels very wrong and sounds like just anyone can brute force/monkey their own config file if they knew enough information.
Am I missing something here? Why is WireGuard like this? Can someone break down why it does not provide a second factor of authentication?
I'm also kind of bothered by the lack of logging or verbosity on failed connection attempts. OpenVPN is very good about this, while WireGuard seems to have almost no logging available unless you have a Linux kernel that supports dynamic debugging and then set up logging via a workaround.
r/WireGuard • u/ZeroArc • May 15 '25
Does anyone how to fully remove these adapters from my pc? I've been trying with no luck whatsoever
r/WireGuard • u/hidemevpn • Dec 18 '25
r/WireGuard • u/markham8927 • Mar 10 '26
Bonjour,
Je tente de déployer des configurations client sur les postes, mais je rencontre un problÚme :
La commande wireguard /installtunnelservice crĂ©e bien un service, mais celui-ci utilise directement le fichier de configuration en clair Ă son emplacement dâorigine, au lieu de gĂ©nĂ©rer une version chiffrĂ©e DPAPI dans le dossier Data/Configurations. De plus, la configuration nâapparaĂźt pas dans lâinterface du client WireGuard, ce qui empĂȘche lâutilisateur de gĂ©rer son activation ou sa dĂ©sactivation.
Comment procĂ©der pour dĂ©ployer automatiquement la configuration de la mĂȘme maniĂšre que si lâutilisateur lâavait installĂ©e via lâinterface WireGuard ?
En vous remerciant
EDIT :
Je viens de trouver la solution Il suffit de copier le .conf dans %programfiles%\wireguard\Data\Configurations
si les dossier n'existe pas, lancer une fois wireguard.exe avec un compte a privilege
si le fichier de conf n'est pas converti elancer le service wireguard Manager ou redémarre la machine, le profile sera automatiquement convertit au bon format
r/WireGuard • u/Jeremy11one • May 09 '24
Sorry if this is a dumb question, but I couldn't find the answer documented anywhere. I use WireGuard For Windows, and my firewall is noticing wireguard.exe tries to connect to 136.144.57.121:443 (abercrombie.zx2c4.com) randomly, even while I have no tunnels activated and the GUI is not running. The only thing running is the WireGuard Manager service.
Is this for usage tracking from the developer? Here is the source code in case it helps.

r/WireGuard • u/nanoosx • Feb 27 '22
good day,
I'm using wireguard and Google can still know my real country, I tried Google Chrome and Firefox both in incognito mode but still can know. I tried testing DNS Leak, IP Leaks and other stuff and shows no problem.
also, the wireguard is installed on a Seedbox server which is pre configured.
r/WireGuard • u/horsesaysmoo • Apr 05 '26
Got this working after some digging â sharing the steps since the permission part is not obvious at all. Yes, I asked Claude to put together this summary after working with it to figure this out.
You'll need WireGuard and MacroDroid installed, plus a computer with ADB to do a one-time permission grant.
1. Enable remote control in WireGuard
Three-dot menu â Settings â enable Allow remote control apps.
2. Enable USB debugging on your phone
Go to Settings â About Phone and tap Build Number 7 times until you get a message saying you're a developer. Then find Developer Options (usually at the bottom of the main Settings screen) and enable USB Debugging.
3. Grant the CONTROL_TUNNELS permission to MacroDroid via ADB
This is the key step. WireGuard requires a custom permission to accept broadcasts from other apps and there's no UI to grant it â you have to do it once via ADB. Connect your phone to your computer, accept the USB debugging prompt on your phone, and run:
adb shell pm grant com.arlosoft.macrodroid com.wireguard.android.permission.CONTROL_TUNNELSNo output means it worked. After this you can turn off USB debugging and Developer Options if you want â the permission sticks.
4. Set battery optimization to Unrestricted for both apps
Settings â Apps â WireGuard â Battery â Unrestricted. Do the same for MacroDroid. Without this, Android may kill WireGuard's receiver when the app isn't open and the intent will silently fail.
5. Create the MacroDroid macro
Trigger: Wi-Fi Disconnected â select your home SSID
Action: Send Intent
Target: Broadcast
Action: com.wireguard.android.action.SET_TUNNEL_UP
Package: com.wireguard.android
Extra key: tunnel
Extra value: your tunnel name exactly as shown in WireGuard (case-sensitive)
For the reverse, duplicate the macro with a Wi-Fi Connected trigger and action com.wireguard.android.action.SET_TUNNEL_DOWN.
Tested on Android 16 with WireGuard from the Play Store.