How to allow SSH on an active OpenVPN client?

How to allow SSH on an active OpenVPN client?

How can I configure the VPS to allow incoming SSH (port 22) connections to be open on the VPS’s actual IP (104.167.102.77), but still route outgoing traffic (like from a web browser on the VPS) through the VPN? The OpenVPN service I use is PrivateInternetAccess, and an example config.ovpn file is:

Can you run OpenVPN client on a VPN?

I would like to run an OpenVPN client on the VPS so that internet traffic is routed through the VPN, but still allow me to connect to the server via SSH. When I start up OpenVPN, my SSH session gets disconnected and I can no longer connect to my VPS.

Why does OpenVPN Break my SSH connection?

The problem is that the default gateway gets changed by OpenVPN, and that breaks your current SSH connection unless you set up appropriate routes before you start OpenVPN. What follows works for me.

How can I use SSH on my server?

One possibility is to pick up the traffic generated from your box with your local source address and route it through your local gateway. This allows services such as SSH to work properly. We’ll do that here.

Which is better, a VPN or SSH tunnel?

Using SSH is also a secure way to access a remote network without extra hardware, less time consuming, and less effort than configuring a VPN server. In this blog, we’ll see how to configure SSH Tunneling to access your databases in a secure way.

Are there any problems with the OpenVPN tunnel?

We are specifically not talking here about problems with establish the OpenVPN tunnel itself. That is handled on a separate page: troubleshooting client VPN tunnel connectivity problems. Connectivity issues along the path between the VPN client and the target system are a pain to deal with, especially if they are impacting your business.

Which is OpenVPN service do you use?

The OpenVPN service I use is PrivateInternetAccess, and an example config.ovpn file is: I’m having a similar issue to this and have been attempting the fix described in this forum post. The idea is that currently when you connect to your public IP address, the return packets are being routed over the VPN.

Which is the default gateway interface for OpenVPN?

Below, it is assumed that the default gateway interface before OpenVPN is started is “eth0”. The idea is to ensure that when a connection to eth0 is made, even if eth0 is not the default gateway interface anymore, response packets for the connection go back on eth0 again.