When you're unable to reach services in your VPN's LAN while connected through WireGuard on Fedora Linux, but it works perfectly on your Android smartphone, the issue is likely related to routing or firewall settings on your Fedora system. Follow these steps to troubleshoot and potentially resolve the issue:
1. Check WireGuard Interface Status
First, ensure your WireGuard interface is active and correctly configured after running wg-quick up. Use the following commands:
bash
wg show
ip addr show wg0
Replace wg0 with your WireGuard interface name if it's different. These commands let you verify that the interface is up and running and has the correct IP address assigned.
2. Validate Routing Table
Next, inspect your routing table:
bash
ip route show
Ensure there's a route directing LAN traffic through the WireGuard interface. You're looking for entries that route traffic for your VPN's LAN (for example, 10.8.0.0/24) through wg0. If you only see a default route via wg0 but no specific route for the LAN, there might be an issue with the AllowedIPs directive configuration or routing setup on your Fedora system.
3. Firewall Configuration
Fedora Linux uses firewalld by default, which can block incoming or outgoing traffic on the WireGuard interface. Ensure that traffic is allowed through the wg0 interface:
If the output of these commands is 0, then you need to enable IP forwarding. Edit /etc/sysctl.conf or create a new .conf file in /etc/sysctl.d/ with the following lines:
sysctl -p /etc/sysctl.conf
# Or if you created a new file
sysctl -p /etc/sysctl.d/yourfile.conf
4. PersistentKeepalive Setting
Although in your configuration PersistentKeepalive is set to 0, setting it to a low value like 25 can be helpful if you're behind NAT. It ensures the NAT traversal keeps the connection alive:
ini
PersistentKeepalive = 25
5. DNS Resolution
If the issue is specifically with reaching services by names within the VPN's LAN, ensure that the DNS resolution is working correctly with the DNS server you specified (1.1.1.1). You might need to configure your system to use the DNS provided by WireGuard, especially if you're using systemd-resolved on Fedora.
Conclusion
After trying these troubleshooting steps, attempt to reconnect using wg-quick up and check if you can reach the services in your VPN's LAN. If the problem persists, double-check the configuration details provided by your VPN administrator to ensure they match what's configured on your Android smartphone, focusing on AllowedIPs, Endpoint, and DNS settings.