Openvpn to ssh private instance in another aws region

402 Views Asked by At

I launched openvpn access server from aws market place in oregon region after launch it asked me weather you want to access private instance i said yes. I can ssh private instance after connecting to openvpn client. Now i want to extend vpn in another region so i created vpn in ireland region and created customer gateway by giving eip of openvpn access server in oregon region. Created vpg and vpn. I added routing properly by giving route to vpg to all vpc cidr of oregon region and in oregon region route added for vpc cidr of ireland region and pointed to openvpn access server eni. But i am not able to ssh to private instance of ireland region instances. I tried changing client permission on openvpn UI. Added both vpc cidr block to allow access to that user still i am not able to connect. Ssh getting timeout. In vpn section both tunnel showing up.

Can someone help what i am missing. Definatly some routing i am missing but i am not able to find it.

1

There are 1 best solutions below

0
On

If I understand your question correctly, you want to be able to connect to your VPN server in the Oregon region, and then ssh from your local machine to an instance in the Ireland region using the private IP address of the instance in the Ireland region... right?

For this, VPC peering is your best option. Here's the AWS documentation on it: https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/vpc-peering-basics.html

And here's a simplified checklist of what you need to do to enable traffic between the two VPCs:

  • Create (request) a new peering connection in the VPC dashboard
  • Select the new peering connection, and click Actions > Accept request
  • Add routes to route tables on both sides. Note: make the destination of the route the newly created peering connection (it should come up automatically as a selection when you click the text field)
  • Add "allow all traffic from " rule to VPC security groups
  • Add "allow all traffic from " rule to instance security groups (if different from VPC SG)

After doing all of the above, you should be able to ping servers in the Ireland region (private IP) when connected to your Oregon VPN.