Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to make computes on local network accessible for VPN clients. My server is available on 10.0.2.1 from VPN but I can't connect to other computers on local network of the server. How can I do this? Server has internal IP address on network 192.168.2.163 and I want connect to 192.168.2.182 from VPN.

    mode server
    port 27015
    proto tcp-server
    tls-server
    dev tap0
    ##dev tun0

    ifconfig 10.0.2.1 255.255.255.0
    ifconfig-pool 10.0.2.100 10.0.2.105 255.255.255.0
    duplicate-cn

    ca /etc/openvpn/cert/cacert.pem
    cert /etc/openvpn/cert/cert.pem
    key /etc/openvpn/cert/key.pem
    dh /etc/openvpn/cert/dh1024.pem

    log-append /var/log/openvpn
    status /tmp/vpn.status 10

    user root
    group root
    comp-lzo
    verb 3

    keepalive 1 220

netstat:

0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 eth0
10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 tap0
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
share|improve this question

1 Answer 1

Assuming the must-haves are in place (the server is happy to forward traffic, it has no iptables rules preventing this), then as with every IP conversation, there are two important traffic directing steps that must be taken: the client must know that it should use the VPN tunnel to talk to the remote system, and the remote system must know that it should use the VPN tunnel to reply.

The former is achieved by telling your openvpn server to advertise a route to the office network, to the clients, with the following statement in server's openvpn.conf:

push "route 192.168.2.0 255.255.255.0"

The latter is achieved either by having all the remote systems use the openvpn server as their default gateway or by setting routes back to the openvpn address space via the server. Assuming that the remote openvpn server is not already the office default gateway, the route can be set by doing

route add -net 10.0.2.0/24 gw 192.168.2.163

on the server 192.168.2.182.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.