Skip to main content
Topic: No internet connection when using WireGuard (Read 375 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

No internet connection when using WireGuard

Hello. I use artix linux with openrc, KDE and networkmanager respectively. My problem is that after importing my wg configuration, I can't access the Internet - nothing is loaded or pinged. After disconnecting, everything works. Please clarify what my mistake is and how to fix it? It seems to me that the problem is in the routers
Code: [Select]
default via 192.168.1.1 dev eth0 proto static metric 100 
127.0.0.0/8 via 127.0.0.1 dev lo
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.153 metric 100
Quote
[Interface]
PrivateKey = somekey
Address = 172.16.0.2/32
Address = [redacted ipv6]/128
DNS = 1.1.1.1
MTU = 1280
[Peer]
PublicKey = somekey
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
Endpoint = ipv4:2408
[/Interface]

Re: No internet connection when using WireGuard

Reply #1
Try using wg-quick, found in package wireguard-tools.
What tags are you 'closing' in your actual cfg file, cause i see at least an '[/Interface]' next to the other messed up forum code tag which i edited, i'm not sure if any of that is standard.
https://bash-prompt.net/guides/wireguard-setup/

Re: No internet connection when using WireGuard

Reply #2
Hi! Thank you very much for the reply.
Try using wg-quick, found in package wireguard-tools.
It works if I add the following lines to the configuration file:
Code: [Select]
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
Without them, the behavior is similar - there is no Internet at all. Of course, wg-quick is a solution, but since I use KDE together with networkmanager, I would like to connect to VPN directly with one click.
What tags are you 'closing' in your actual cfg file, cause i see at least an '[/Interface]' next to the other messed up forum code tag which i edited, i'm not sure if any of that is standard.
https://bash-prompt.net/guides/wireguard-setup/
It seems that forum editor itself handles tags incorrectly, mistaking them for BB-codes. Config is correct, and it is used on both Windows and Android, without changes above, which I wrote about (PostUp and PostDown)
https://ibb.co/2jYkGM7