Score:0

AWS: Ping between multiple namespaces in seperated EC2 Instance

is flag

I am encountering an issue where I am unable to receive a response when attempting to ping from a namespace located within a public EC2 instance to a private one. To better illustrate my situation, I have included a diagram below.

Structure

Update:

Private Subnet: Private Subnet

Public Subnet: Public Subnet

Private Route: Private Route

Public Route: Public Route

NAT: NAT Inbound NAT Outbound

Tim avatar
gp flag
Tim
Thanks for including so much information! Are you talking about Linux namespaces? If so you might like to use basic Amazon Linux 2 instances in the same subnets / SGs that your current instances are in, for debugging. The issue is likely 1) security groups 2) NACLs 3) routing. Can you please edit your question to include screenshots of the incoming and outgoing security groups for each instance, routing for each subnet that has an instance, and NACLs.
Tanvir Rahman avatar
is flag
I have added additional info you requested @Tim
Tim avatar
gp flag
Tim
Do the instances share the same security group? If so I would add an explicit self-referential security group rule incoming and outgoing. i.e. when you edit the SG under incoming / outgoing start typing the security group name, and ensure it allows all traffic. During testing use "ping -4" or similar to force IPv4 pings. Routing is my next thought, it would be easier to see the console. As a test, route direct to the IGW rather than via the NAT gateway, I can't see a valid route since NAT GW won't allow incoming pings. Also consider using VPC Flow Logs to trace the packets.
Tanvir Rahman avatar
is flag
The main issue was, i was doing ping in 172.16.1.10 which is a private ip (Attached screenshot). Now when i am doing ping in ec2 host ip from namespace1, the ping is reaching until bridge2. Trying to figure out how to forward the ping to namespace2. @Tim
Tim avatar
gp flag
Tim
You've lost me with the namespace stuff, you'll need to tag for Linux rather than AWS. I can help with AWS no problem, which is why I suggested Amazon Linux 2 tests, once that works you can try to get namespaces working. Interesting to note, each network interface associated with an instance has a private IP, the public IP is a form of NAT at the internet gateway, so internal traffic should always use IPs.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.