AWS keep site to site VPN connection alive

2.7k Views Asked by At

We have a site to site VPN connection from our AWS cloud to the customer's on site network. Our web application login requires the authentication from the customer's active directory and hence the need for VPN connection.

When our application is not being used for a while the VPN tunnel goes down, due to which when a user tries to log into the application he is unable to due to downed tunnel. It takes some time for the tunnel to get up after which everything works properly.

I had a call with the customer's IT people and it seems they have set up a keep alive bit (DPD settings) on their end but still the tunnel keeps going down. AWS support isn't much of a help either.

I google around and discovered that one way we can keep the tunnel alive is by "sending a ping to the target from the device sourced from the outside interface. A possible destination for the ping is an instance within the VPC"

AWS documentation also suggests "to create a host that sends ICMP requests to an instance in your VPC every 5 seconds."

I already have an private subnet EC2 instance (with only private IP) in my VPC.

My question is, do I need to create another ec2 instance in my VPC private subnet and ping the first one from the other every 5 seconds?

Would I need to write a shell script for this?

I am basically confused about from where to ping, whom to ping and how to ping.

1

There are 1 best solutions below

2
On

Ping any remote AWS instance from your on-premise site, thereby causing traffic over the vpn. Just schedule it in windows task scheduler, and use the basic command line ping.