简体   繁体   English

无法将客户端 VPN 终端节点连接到 VPC 中的 RDS

[英]Can't connect Client VPN Endpoint to RDS in a VPC

I had set up a Client VPN Endpoint (Client CIDR 10.0.132.0/22), with associations to two private subnets (10.0.2.0/24 and 10.0.3.0/24), using one security group.我使用一个安全组设置了一个客户端 VPN 端点(客户端 CIDR 10.0.132.0/22),关联到两个私有子网(10.0.2.0/24 和 10.0.3.0/24)。 I also have a RDS Database using the same two subnets and the same security group.我还有一个使用相同的两个子网和相同的安全组的 RDS 数据库。 The security group has an inbound rule that allows all traffic from the same security group.安全组具有允许来自同一安全组的所有流量的入站规则。

I'm able to connect to the VPN, but when I try to connect to mysql it doesn't resolve the host.我能够连接到 VPN,但是当我尝试连接到 mysql 时,它无法解析主机。

I thought it could be DNS but from EC2 I looked up for the private IP of the database (10.0.2.X), then I tried to connect using the IP and it didn't work either.我认为它可能是 DNS 但从 EC2 我查找了数据库的私有 IP(10.0.2.X),然后我尝试使用 IP 进行连接,但它也没有工作。

Then I thought it could be something in the security group and I added an inbound rule accepting all traffic from anywhere but still not being able to connect.然后我认为它可能是安全组中的某些东西,我添加了一个入站规则,接受来自任何地方的所有流量,但仍然无法连接。

I can access the RDS from an EC2 instance, that means RDS works fine and it doesn't sound like a security group problem.我可以从 EC2 实例访问 RDS,这意味着 RDS 工作正常,听起来不像是安全组问题。

I think the issue can come from the VPN.我认为问题可能来自VPN。 I can connect to the VPN correctly and I can see the connection in AWS console (Client IP 10.0.132.X).我可以正确连接到 VPN,并且可以在 AWS 控制台中看到连接(客户端 IP 10.0.132.X)。

Extra info:额外信息:

VPN:虚拟专用网:

在此处输入图像描述

Associations:协会:

在此处输入图像描述

Authorization:授权:

在此处输入图像描述

Route Table:路由表:

在此处输入图像描述

Any help?有什么帮助吗?

Thanks谢谢

I found out what was wrong.我发现出了什么问题。 I had two wrong things.我有两个错误的事情。 First I included split tunnel and removed the two route tables (0.0.0.0/0) so only VPN (10.0.0.0/16) traffic will go over the VPN.首先,我包括拆分隧道并删除了两个路由表 (0.0.0.0/0),因此只有 VPN (10.0.0.0/16) 流量将通过 VPN 传输 go。 Second I added a DNS suggested in many places that is the VPC CIDR +2 (example 10.0.0.2)其次,我在许多地方添加了一个 DNS,即 VPC CIDR +2(例如 10.0.0.2)

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

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