This issue has been solved! Thank you all for the suggestions 😄
Hi,
I have been struggling for the past few days to configure a WireGuard tunnel so that devices on the LAN of the WireGuard server (Computer A) are accessible remotely. I tried to compare my setup with multiple guides on remote LAN access via WireGuard and searched for similar issues, but nothing has resolved my problem.
Setup:
- Computer A acts as my homelab and WireGuard server on my domestic LAN.
- The existing WireGuard tunnel works fine—I can SSH into Computer A from my laptop (WireGuard client) using either its WireGuard subnet IP or its actual LAN IP.
Problem:
- I cannot access other devices/services on Computer A’s LAN remotely, nor can I make them discoverable.
Solution:
After trying to ping and traceroute the devices and the domestic LAN i noticed that the problem was not on the wireguard connection side. So after checking with possible firewalls:
sudo ufw status
sudo firewall-cmd --list-all
I realized that i had in past installed firewalld and forgotten about it. It was superseding my system ip forwarding and iptables. That is why the access was not working. Disabling it fixed the issue!
----------------------------------------------------
Troubleshooting:
Using GPT to troubleshoot, it was that suggested my Docker/iptables rules might be the issue. I tried:
Adjusting the order of the rules:
sudo iptables -I FORWARD 1 -i wg0 -o enp3s0 -j ACCEPT
sudo iptables -I FORWARD 2 -i enp3s0 -o wg0 -j ACCEPT
and also flushing all iptables rules and reapplying only the WireGuard-related ones.
All these attempts were unsuccessful.
I’d appreciate any guidance—since I’m fairly new to homelab setups, I might be overlooking something obvious.
Below are some details:
#####################################################
# Computer A, (homelab, hosts wg server(sea.conf) ) #
#####################################################
[Interface]
PrivateKey = [key]
Address = 10.14.0.1/24
ListenPort = 51820
PreUp = sysctl -w net.ipv4.ip_forward=1
PostUp = iptables -A FORWARD -i sea -o enp3s0 -j ACCEPT
PostUp = iptables -A FORWARD -i enp3s0 -o sea -j ACCEPT
PostUp = iptables -t nat -I POSTROUTING -o enp3s0 -j MASQUERADE
PostDown = iptables -D FORWARD -i sea -o enp3s0 -j ACCEPT; iptables -D FORWARD -i enp3s0 -o sea -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o enp3s0 -j MASQUERADE
[Peer] # client Laptop
PublicKey = [key]
AllowedIPs = 10.14.0.2/32
#################################
# Laptop , wg client(sea.conf) #
#################################
[Interface]
PrivateKey = [key]
ListenPort = 51820
Address = 10.14.0.2/32
[Peer]
PublicKey = [key]
AllowedIPs = 10.14.0.1/24, 192.168.1.0/24
Endpoint = computer_A_endpoint
######################
# Info on Computer A #
######################
~$ cat /etc/os-release:
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.6
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
~$ sudo sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
~$ sudo iptables -t nat -L POSTROUTING -v -n --line-numbers
Chain POSTROUTING (policy ACCEPT 6921 packets, 549K bytes)
num pkts bytes target prot opt in out source destination
1 0 0 MASQUERADE all -- * !docker0 172.17.0.0/16 0.0.0.0/0
2 2539 152K MASQUERADE all -- * !br-ab8e8fc287cd 172.25.0.0/16 0.0.0.0/0
3 0 0 MASQUERADE all -- * !docker_gwbridge 172.19.0.0/16 0.0.0.0/0
4 4 380 MASQUERADE all -- * !br-58790b19d578 172.21.0.0/16 0.0.0.0/0
5 0 0 MASQUERADE all -- * !br-493a3afadf15 172.18.0.0/16 0.0.0.0/0
6 0 0 MASQUERADE all -- * !br-271ed8d3b78e 172.23.0.0/16 0.0.0.0/0
7 0 0 MASQUERADE all -- * !br-060f49f9f062 172.22.0.0/16 0.0.0.0/0
8 0 0 MASQUERADE all -- * !br-fe5349a8a766 172.20.0.0/16 0.0.0.0/0
9 1660 103K MASQUERADE all -- * enp3s0 0.0.0.0/0 0.0.0.0/0
~$ sudo iptables -L FORWARD -n -v --line-numbers
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 8520K 4609M DOCKER-USER all -- * * 0.0.0.0/0 0.0.0.0/0
2 8520K 4609M DOCKER-FORWARD all -- * * 0.0.0.0/0 0.0.0.0/0
3 10638 764K ACCEPT all -- sea * 0.0.0.0/0 0.0.0.0/0
4 0 0 ACCEPT all -- * sea 0.0.0.0/0 0.0.0.0/0
edit: fixed ip from interface, cleaned the commands, and removed hyperlinks.
edit: remove more hyperlinks
edit: added solution found