1

I have an account with an OpenVPN service, and I'd like to get that running on my EC2 instance running Ubuntu 12.04.

I have my config file in /etc/openvpn, and it connects fine when I run sudo openvpn --config matt.ovpn. However, I then lose connectivity to the EC2 machine, and I can't SSH back to it until I reboot.

Previously I have done things like sudo ip rule add from IP_ADDRESS table 10 and then sudo ip route add default via GATEWAY_IP table 10, but that's not working on EC2.

Any ideas? My private IP address right now is 10.209.29.XXX and my gateway is 10.209.29.1.

EEAA
  • 110,608

2 Answers2

1

Your OpenVPN configuration probably has the redirect-gateway directive, which will change the default route to point to the VPN once the VPN has started. Remove or comment out this line to prevent this from happening.

mgorven
  • 31,399
0

What you are trying to do ?

Most likely openvpn overwrites your routing table so you lose connectivity. There may be other script that run the time you start openvpn.

Post your openvpn configuration and log files. It is not possible to tell more without them.

EDIT Set up specific routes for the sites you want to access via openvpn.

ip ro add someip/32 via 10.8.0.5 dev tun0

If this works for you you can put this in a start script or even better in you vpn configuration file.

cstamas
  • 6,917