繁体   English   中英

AWS Client VPN 可以连接但无法访问 VPC 资源

[英]AWS Client VPN can connect but cannot access VPC resources

我已经配置了 AWS Client VPN,以便我可以使用相互身份验证(证书)成功连接并且可以访问 Internet。 尽管如此,尽管遵循了手册,但我无法访问同一 VPC 中其他子网中的资源。 对于可能遗漏的任何提示,我将不胜感激。

Client VPN configuration:

Association:
Subnet: subnet-0a51a9e6891ccee4f
Security Group:  sg-08649152e7b46e74a

Authorization:
CIDR (1): 0.0.0.0/0
CIDR (2): 172.30.0.0/16 (VPC private IP)

Route Table:
CIDR: 172.30.0.0/16, Target Subnet: subnet-0a51a9e6891ccee4f
CIDR: 0.0.0.0/0, Target Subnet: subnet-0a51a9e6891ccee4f

VPN Subnet configuration (subnet-0a51a9e6891ccee4f):

Route Table:
Destination: 172.30.0.0/16, Target: local
Destination: 0.0.0.0/0, Target: igw-55d21930

Network ACL:
Inbound:
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
1000 ALL Traffic ALL ALL 172.30.0.0/16 ALLOW

Outbound:
100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
1000 ALL Traffic ALL ALL 172.30.0.0/16 ALLOW

VPN Security Group: (sg-08649152e7b46e74a)
Inbound:
All traffic All All 0.0.0.0/0 
All traffic All All 172.30.0.0/16
All traffic All All sg-08649152e7b46e74a

Outbound:
All traffic All All 172.30.0.0/16
All traffic All All 0.0.0.0/0
All traffic All All sg-08649152e7b46e74a

客户端能够连接并获得分配的 IP,例如 172.30.8.98。

即使我允许来自上述 VPN 安全组 (sg-08649152e7b46e74a) 的流量,我仍然无法访问受安全组保护的 EC2 实例(在这种情况下,这是端口 27017 上的 mongodb)。

也许其中之一会有所帮助:

  1. SG associated with subnet is useful only for internet access - 添加 0.0.0.0/0 并忘记它(除非有人想启发我)。 现在您要连接到 mongo EC2,向其 SG 添加规则以允许来自 sg-08649152e7b46e74a 的 27017

  2. 您正在尝试连接到 EC2 公共 IP 而不是私有 IP

在遇到完全相同的问题时,我不得不使用以下路由修改 OpenVPN 配置文件。

VPC CIDR : 192.168.0.0/16
Routes for OpenVPN Configuration File :
route-nopull
route 192.16.0.0 255.255.0.0
dhcp-option DNS 192.168.0.2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM