Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Problem: I've set up a working OpenVPN server, and am able to connect to it from anywhere using my mac laptop and tunnelblick. When I connect in, I'm assigned an IP address of 10.8.0.x, the server is 10.8.0.1, so I have no problems SSHing into it. Once SSHd in, I can even ping other machines (obviously) on my home network (192.168.1.x).

Desired outcome: What I want, is, to connect to the VPN server, and instead of getting a 10.8.0.x address, I get a 192.168.1.x on my home network.

I can't figure out how to talk to the OTHER machines on my home network WITHOUT being SSHd in to the VPN server. I'd like to just connect to my VPN server, then be a part of my home network.

Attempted solutions: I've read that I need to set up routes, and/or enable IP forwarding. I enabled IP forwarding using sudo sysctl -w net.ipv4.ip_forward=1 and that doesn't seem to have done anything. I've also uncommented a line in the OpenVPN's server.conf file:

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
push "route 192.168.1.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

But still no luck, I still get a 10.8.0.x address...

I've also read I may have to add routes to the router itself, but haven't tried that.

Any help appreciated, thanks!

share|improve this question

1 Answer 1

This is an option: http://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html .
Another option is to route Lan clients to your VPN clients and viceversa, VPN clients should route your Lan network through your VPN server; and your Lan clients should route your VPN network through your VPN server.
Add this to your Lan clients (replace 192.168.1.254 with your LAN server IP address)

route add -net 10.8.0.0 netmask 255.255.255.0 gw 192.168.1.254

Your VPN clients should get the route automatically with the line from your config

push "route 192.168.1.0 255.255.255.0"
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.