Connecting two networks using OpenVPN (all computers). Is that possible only from OpenVPN client's gateway or any computer?

10,272

YES.

What you want is called site to site VPN. Usually, one would use IPSEC here. It can be done with OpenVPN as well, though. You would install OpenVPN server on one machine, and a client on a machine in the other network. Then you set a route on all machines to the other network, giving the OpenVPN machine as gateway. The simplest solution would be to use your standard gateway though, because then you do not need to set other routes. Here is a step by step on how to do it:

http://www.smallnetbuilder.com/other/security/security-howto/30353-how-to-set-up-a-site-to-site-vpn-with-openvpn

However, it might be easier to actually use IPSEC here. You can set up a free router OS like pfsense, even on a VM, and use it as a VPN modem. If you have pfsense on both sides it is fairly easy to set up. Then, on all your machines just add a route to the other network using pfsense as gateway.

Share:
10,272

Related videos on Youtube

laimison
Author by

laimison

Updated on September 18, 2022

Comments

  • laimison
    laimison over 1 year

    An example:

    LAN A - NO EXTERNAL IP - OPENVPN CLIENT:
    192.168.1.1 gw
    192.168.1.2 pc
    192.168.1.3 pc
    
    LAN B - EXTERNAL IP - OPENVPN SERVER:
    10.0.0.1 gw
    10.0.0.2 pc
    10.0.0.3 pc
    

    All the computers should be able to reach each other. Where I need to setup OpenVPN client? Is that only 192.168.1.1 gw possible or any computer on LAN A?

    I expect to get answer NO or YES with some details.

    (I have some limitations to start OpenVPN on my router 192.168.1.1, also OpenVPN client cannot be installed on some hosts from 192.168.1.x to connect to OpenVPN server individually)

  • laimison
    laimison almost 8 years
    Thanks for response. Am I right that 192.168.1.2 (OpenVPN client) should be gateway for 192.168.1.3? This means 192.168.1.3 should have gw 192.168.1.2 in network configuration.