The route
Tell clients where the network is
server.conf
push "route 192.168.10.0 255.255.255.0"Turn on forwarding
On the server
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-ovpn.conf
sudo sysctl --systemThe way back
A device inside gets a packet from 10.9.0.x and does not know where to reply. Choose one:
| Way | How | Benefit |
|---|---|---|
| Static route | On the office router send 10.9.0.0/24 to the OpenVPN server | You see real sources |
| NAT | Rewrite the source on the server | The router stays as it is |
With NAT
sudo iptables -t nat -A POSTROUTING -s 10.9.0.0/24 -o eth0 -j MASQUERADEStill nothing
- ping 10.9.0.1Fails: the tunnel
- ping the server's internal addressFails: the route was not pushed
- ping another device insideFails: forwarding or the way back
- Shares do not openWindows Firewall allows only its own network; add 10.9.0.0/24
My home is 192.168.10.x too?
Clashing networks go to the wrong place. In the long run change one of them to something less common.
And the office reaching devices at my home?
Add iroute for your certificate and a matching route on the server. That is called site-to-site.
Walk onAll traffic through the gate