VPN on Amazon EC2

1

I am trying to make my Amazon EC2 instance have a different IP address by connecting to a VPN using openconnect.

The connection is successful, but then my ssh freezes and I get

"packet_write_wait: Connection to IP numbers: Broken pipe"

After that if I try to ssh into the instance I get "Operation timed out" message. Can someone advise on how can I achieve my objective -- make my EC2 instance appear to have an IP address that belongs to my VPN network? Thanks!

Update: trying to use Cisco AnyConnect does not resolve the problem. As I understand, the problem is either due to some blocking by AWS or because once the VPN connection is established, the EC2 instance must be accessed at its new address (but I don't know the exact IP address since VPN assigns a number from a large range).

econ

Posted 2016-07-17T00:20:22.093

Reputation:

Answers

2

As far as I know AWS blocks this type of operation (and other services, like route internet traffic through your network).

We just did the following with AWS VPC VPN connection: We created a VPC for our instances, with a specific IP address range like 10.10.0.0/16 in one region, and we launch several instances there. After that, we created a Virtual Private Gateway in that VPC, and we registered our VPN endpoint as a Customer Gateway.

This two service (Customer Gateway as our endpoint, and Virtual Private Gateway as AWS endpoint) is required by the VPN Connection service. As a final step, we just set up the VPN connection with static routing between the endpoints.

There is a great help here, which could help you to set up the VPN connection, and as described there, you can download a generic configuration from AWS, which helps you to set up your endpoint (we are using pfSense and ~Swan connections, both of them was easy to set up).

The whole VPN stuff costs you ~$40 in a month (data traffic is not included), and with this solution you get the most secure connection type (Site-to-Site VPN IPSec), you have a shared IP range between your local and remote network (don't forget to take care of the proper routing settings in each network!), but you will lose some speed because of the encryption.

Sári Csaba

Posted 2016-07-17T00:20:22.093

Reputation: 66