Skip to content

Commit 13008ef

Browse files
authored
docs: expand FAQ on accessing server's LAN (angristan#1434)
## Summary - Expands the FAQ entry about accessing computers on the server's LAN - The previous answer only mentioned pushing a route, which is insufficient for most setups - Added explanation of the return routing requirement with two options: - Static route on router (recommended) - Masquerade rule (when router can't be modified) Closes angristan#1126
1 parent cf4a6a7 commit 13008ef

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

FAQ.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,38 @@ Sysctl options are at `/etc/sysctl.d/99-openvpn.conf`
108108

109109
---
110110

111-
**Q:** How can I access computers the OpenVPN server's remote LAN?
111+
**Q:** How can I access computers on the OpenVPN server's LAN?
112112

113-
**A:** Add a route with the subnet of the remote network to `/etc/openvpn/server/server.conf` and restart OpenVPN. Example: `push "route 192.168.1.0 255.255.255.0"` if the server's LAN is `192.168.1.0/24`
113+
**A:** Two steps are required:
114+
115+
1. **Push a route to clients** - Add the LAN subnet to `/etc/openvpn/server/server.conf`:
116+
117+
```
118+
push "route 192.168.1.0 255.255.255.0"
119+
```
120+
121+
Replace `192.168.1.0/24` with your actual LAN subnet.
122+
123+
2. **Enable routing back to VPN clients** - Choose one of these options:
124+
- **Option A: Add a static route on your router** (recommended when you can configure your router)
125+
126+
On your LAN router, add a route for the VPN subnet (default `10.8.0.0/24`) pointing to the OpenVPN server's LAN IP. This allows LAN devices to reply to VPN clients without NAT.
127+
128+
- **Option B: Masquerade VPN traffic to LAN**
129+
130+
If you can't modify your router, add a masquerade rule so VPN traffic appears to come from the server:
131+
132+
```bash
133+
# iptables
134+
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -d 192.168.1.0/24 -j MASQUERADE
135+
136+
# or nftables
137+
nft add rule ip nat postrouting ip saddr 10.8.0.0/24 ip daddr 192.168.1.0/24 masquerade
138+
```
139+
140+
Make this persistent by adding it to your firewall scripts.
141+
142+
Restart OpenVPN after making changes: `systemctl restart openvpn-server@server`
114143

115144
---
116145

0 commit comments

Comments
 (0)