4

I have a network of machines inside an OpenVPN network. With no problem, I can connect into that network from my local machine:

openvpn --config ./myconfig.ovpn --auth-user-pass ./mycredentials

The problem is that I am trying to connect another remote machine (a cloud based VPS) as a client. Using the same config file and credentials on the VPS will not work.

See here for similar issue.

Basically what happens is the machine freezes up. My current shell session stops responding. My only way out of it is to reboot the machine. To make it worse, if I run it as a service (service openvpn start with a config file in /etc/openvpn) I cannot even get back into the machine at all. Even after a reboot.

Maybe the connection is being established and it is cutting off my SSH? I'm really not sure. What I really need to figure out though is how to setup a VPS as a client to my VPN and still be able to control the machine.

1 Answer 1

2

So, after MUCH more work into this ... I discovered that I indeed could get into the machine (albeit not thru SSH). When I turned off the openvpn, I was able to SSH back in as normal. Suspicion confirmed.

Then, the question became: how do I SSH into an OpenVPN client?

I found the answer.

For anyone else having the issue, I am also putting the solution here:

ip rule add from x.x.x.x table 128

ip route add table 128 to y.y.y.y/y dev ethX

ip route add table 128 default via z.z.z.z

Where x.x.x.x is your public IP, y.y.y.y/y should be the subnet of your public IP address, ethX should be your public Ethernet interface, and z.z.z.z should be the default gateway.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .