AWS client VPN - SSH to EC2 instance with custom ssh port

0

We just set up a AWS client VPN, associated with private subnet and route traffic through NAT gateway to internet. This way to get a static public IP. We have debian EC2 instances with custom SSH port, for example port 56565 instead of port 22. When connected with AWS client VPN, we were not able to SSH to the EC2 instance with ssh port 56565. Have verified all the security groups, network ACL and routing, seems like the AWS client VPN is blocking the non-standard ports. Anyone has some insight on this? Is it possible to configure it?

질문됨 일 년 전1219회 조회
2개 답변
1

Do you have a rule set up in the security group that EC2 has to allow connections from the security group that AWS Client VPN has?
I don't think AWS Client VPN is doing anything to deny communication.
Also, make sure that all communications are allowed in the outbound rules of the AWS Client VPN security group.

profile picture
전문가
답변함 일 년 전
  • Hi, thanks for the suggestions! For EC2 instance security group, I have allowed the VPN external IP for All traffic and All ports(for testing purpose) AWS VPN security group also has All traffic allowed in the outbound rule. For the same EC2 instance, I'm able to ssh into it on Port 22 with VPN connected, but not able to connect when the ssh port is set to 56565. To me, looks like there is some default restrictions on the special ports.

0

AWS Client VPN does not block other ports.

Please check below guide, specifically step 5 "Provide access to the internet" and step 6 "Verify security group requirements".

https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-getting-started.html

profile pictureAWS
Matt_E
답변함 일 년 전
  • Hi, I'm able to access the internet and also able to ssh to the same EC2 instance when ssh port is set to 22.

    • Make sure port 56565 is being allowed on the EC2 security group, the target EC2.
    • Make sure port 56565 is being allowed on the EC2 ACL.
    • Make sure port 56565 is being allowed on the CVPN ENI subnet ACL. When you create your CVPN is going to be associated with one or more than one subnet, make sure port 56565 is being allowed on all the subnets ACL that are associated with CVPN ENI's, for instance, you may have 3 subnets for your CVPN (subnet A, subnet B, and subnet C) each of those subnets may have a different ACL, you would need to make sure those subnets allow port 56565.
    • If all above being checked and still unable to connect, I suggest checking your EC2 VPC flow logs to see if traffic is reaching the EC2.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠