大网数据广告活动
服务器运维问答

Cannot ping between EC2 instances in peered VPCs

· 52CE 我爱测

I am trying to setup a barebones VPC connection within the same AWS account. VPC-A and Subnet-A have CIDR: 10.200.1.0/24 VPC-B and Subnet-B have CIDR: 10.200.2.0/24 Each VPC contains one EC2 instance 10.200.1.17 (in VPC-A, Subnet…

问题原文

原帖链接 · James Wierzba · CC BY-SA 4.0

I am trying to setup a barebones VPC connection within the same AWS account.

  • VPC-A and Subnet-A have CIDR: 10.200.1.0/24
  • VPC-B and Subnet-B have CIDR: 10.200.2.0/24

Each VPC contains one EC2 instance

  • 10.200.1.17 (in VPC-A, Subnet-A), let's call it EC2-A
  • 10.200.2.67 (in VPC-B, Subnet-B), let's call it EC2-B

I have added the following route to the route table that is associated with both VPC-A and Subnet-A, which should route traffic from VPC-A to VPC-B based on the CIDR range of VPC-B

  • (Dest | Target): 10.200.2/24 | PCX-123

(where PCX-123 is the ID of the VPC Peering Connection)

The security group associated with EC2-A and EC2-B allow all inbound and outbound traffic.

NACL for both networks are allowing all traffic

When I SSH into EC2-A, and try to ping EC2-B, I get timeout.

ping 10.200.2.67
...
...
... timeout

What am I missing?

FYI

  1. I tried asking in stackoverflow, but it was deemed off topic
  2. Yes, it in conceptually the same question as cannot ping ec2 in another vpc through peer connection, but this question is dead, the asker never responded or followed up.

已采纳解答

原帖链接 · Michael - sqlbot · CC BY-SA 4.0

VPC peering requires symmetrical route table entries -- the tables on each side of the peering connection need a route pointing across the peering connection to the other side.

To send traffic from your instance to an instance in a peer VPC using private IPv4 addresses, you must add a route to the route table that's associated with the subnet in which the instance resides.

...

The owner of the other VPC in the peering connection must also add a route to their subnet's route table to direct traffic back to your VPC.

http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/vpc-peering-routing.html

(This still holds true when the same account is the owner of both VPCs.)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-04-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。