Configuring OpenVPN for internet passthough [Solved/Closed]

Report
Posts
2
Registration date
Tuesday August 16, 2011
Status
Member
Last seen
August 17, 2011
-
bionik
Posts
4521
Registration date
Thursday August 19, 2010
Status
Moderator
Last seen
August 3, 2016
-
Hello,

I am having trouble configuring OpenVPN to route internet requests from VPN connections to the internet. I am not very familiar with OpenVPN (or any other type of VPN), so I used the script here (https://www.vpsnoc.com/blog/2010/01/how-to-install-openvpn-on-a-debianubuntu-vps-instantly/ to set it up. I have successfully connected my client to my Debian Lenny server and have my client attempting to access the internet though the VPN, but I don't get any internet access (I can only access local files on my server). I suspect it is just a simple configuration error, and I would appreciate suggestion about how to fix this.

Thanks in advance for your answer!
Ian

2 replies

Posts
4521
Registration date
Thursday August 19, 2010
Status
Moderator
Last seen
August 3, 2016
940
Greetings,

Is OpenVPN configured for client can only access the server, or at the whole LAN server side?

If it provides access to the LAN server side, so at the time of connection, the server sends the client a route to the subnet 192.168.1.x This road passes all client access to 192.168.1.x from the VPN tunnel.
Therefore, the client can not access the 192.168.1.x IP's own local network, the livebox. More Internet, then.

However, the OpenVPN connection is not impacted as it had been established before the client receives the new route to 192.168.1.x So you must always be able to ping the VPN server from the client.
To connect two subnets through a VPN tunnel, it is better that these subnets are different.

If you just need to establish a connection between the server and the client, without involving the other two machines LAN, you must edit the configuration files to the server no longer sends a route to the client (the comment line push "route 192.168.1.0 255.255.255.0" in the config file server).

Thus, if you need to interconnect the LAN, it would be best to change the addressing scheme of the two sites.

Post the config files and should be fixed. Do not forget to hide the public IP or domain name.

PS: I use an arbitrary ip adress.
Posts
2
Registration date
Tuesday August 16, 2011
Status
Member
Last seen
August 17, 2011

Hello,

Thanks for your response. I already tried adding push "route 192.168.1.0 255.255.255.0" to the OpenVPN config file, but it didn't fix the problem.

Setting up IP Tables did fix the problem. I found out how to do it here: http://serverflux.com/networking/how-to-install-openvpn-on-debian-with-iptables/

I hope this helps someone in the future.

Ian
bionik
Posts
4521
Registration date
Thursday August 19, 2010
Status
Moderator
Last seen
August 3, 2016
940
Hi Loosescrews,

Am happy to know that your issue is fixed. Thank you also for the link.

Have a nice day.

Regards!