Access to a NATed LAN Network without public ip address using VPN and Apache Virtual Host

08
2014-07
  • Questioner

    my question is: I need to access from the outside to a DVR that in my LAN has the local ip: 192.168.1.x I have multiple LANs located in 3 different places not connected each other at the moment. I am behind NATed IP address, and I cannot access my DVR with a port forwarding through the router. My idea is:

    • I have a CENTOS Server, with a public IP address.
    • I install OPENVPN on it, and I put 3 OPENVPN clients into the 3 LANs.(OPENVPN Server will have an address of the type: 10.1.0.1 and OPENVPN clients of the type 10.1.0.x)

    I need to access the DVR on LOCAL LANs from outside. How can I setup iptables and route table to get this? My idea was to:

    • install Apache on the VPN Server, and use its VIRTUAL HOST feature to redirect a third level domain to the right VPN CLient IP Address, and later, MASQUERADE on the Local LANs the incoming request from VPN to the DVR Address.

    Can you help me with some configurations since I am a noob on networking?

    Thanks.

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    networking - Windows host with SSTP VPN, VirtualBox guest cannot access VPN resources
  • Joshua

    So my problem is relatively simple. I have a host OS (Vista) that connects to a Windows 2008-based SSTP VPN. I have a virtualized guest OS, Windows XP, that I need to access resources over the VPN.

    When a new VPN configuration is created in Windows, Windows sets it up as another connection in the Network & Sharing Center. However, VirtualBox config is unable to see this connection when choosing a connection to bridge to.

    My local network is 192.168.1.x My remote (over VPN) network is 192.168.10.x

    The problem is that the guest takes its DHCP / IP's from my local network (not remote VPN), so the IP address assigned to it is usually 192.168.1.x. Virtualbox is not properly seeing the VPN.

    Any ideas on how to make it work properly? Both the physical adapter and the "virtual" adapter (VPN) have the VirtualBox Bridged Networking Driver enabled and checked.

    Thanks in advance.

    Update: Using "NAT" instead of "Bridged" on the VirtualBox configuration worked -- but only partially. Now it connects and accesses resources, but new problem arises. The virtual instance itself is given an IP address of 10.0.2.x -- we don't have any servers in this range. What's up with that? What do I need to do to get it in the 192.168.10.x range?

    Or rather, I want to access that machine from other machines on the network. How?


  • Related Answers
  • John Douthat

    Switch the virtual machine's network interface from bridged to NAT and it should work fine.

  • Barnubus

    I had the same issue. I got VPN working in the guest by going into the Network settings in Oracle VM manager. I changed "Attached to" to "Bridged Adapter." I then selected a different adapter type than what was listed and set the promisuous mode to allow all.