Skip to content

Do VPC flow logs record traffics where an EC2 instance communicates with itself (using its private IP)?

0

Hi there,

I run different services on the same EC2. Let's call them service A and service B. When a service talks to another service, private IP is used (ports might be different). So in the VPC flow logs for this example, both source address and destination address will be just the instance's private IP.

For example,

src addrdst addrsrcportdstport
172.10.1.1172.10.1.112345678

My question is will these types of traffics be recorded in the VPC flow logs? Thank you.

asked 2 years ago519 views

1 Answer
1
Accepted Answer

No, the traffic won't be recorded by VPC flow logs. Traffic between IP addresses belonging to the same operating system environment (like your Linux or Windows server) never leaves the internal networking software stack of the operating system. No external network component or packet capturing tool in the cloud or on premises can see it.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Hi Leo, thanks a lot for your answer. Is there any problem or is it possible for services running on the same instance to communicate using just the same private IP of that instance?

  • @AKMin You can connect freely between any IP addresses configured on the same operating system instance. If you have immense numbers of connections opened and closed within a very short timeframe, it's possible that the maximum number of TCP port numbers would be exceeded, in which case you might need either multiple IP addresses or to configure the O/S to use a larger ephemeral port range for TCP. Unless you're expecting huge numbers of connections, one IP will suffice just fine.

  • Thanks for your answers. They are very helpful.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.