Routing
As stated before, the main use case for point-to-point style networks is to connect two remote networks over a secure tunnel. In the previous example, the secure tunnel was established, but no network routes were added.
For the next example, consider the following network layout:
The client-side network 192.168.4.0/24 (with netmask 255.255.255.0) needs to be routed over the VPN tunnel to the server.
On the listening end (server), we start:
[root@server] # openvpn \ --ifconfig 10.200.0.1 10.200.0.2 \ --dev tun \ --secret secret.key 0\ --route 192.168.4.0 255.255.255.0 \ --daemon --log /var/log/movpn-02-server.log
On the client side, the ...
Get Mastering OpenVPN now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.