Skip to content

Does AWS VPC Flow Logs only display private IP addresses for srcaddr and dstaddr, or can it also include public IP addresses?

0

What I'm trying to do is to use vpc flow log's srcaddr and dstaddr (or pkt-src-addr and pkt-dst-addr?), and traffic-path to analyze incoming and outgoing traffic based on a specific elastic ip address.

The private/public ip address of the elastic ip address will be obtained through the AWS SDK, and I planned to compare the srcaddr and dstaddr of the vpc flow log with the IP obtained through the AWS SDK to check whether the traffic is EIP traffic.

But I wasn't sure whether srcaddr and dstaddr displayed in vpc flow log only show private address.

Does AWS VPC Flow Logs capture and display public IP addresses in addition to private IP addresses for srcaddr and dstaddr fields?

asked 3 years ago1.8K views
3 Answers
1
Accepted Answer

Yes, VPC flow logs will show public IPs being either accepted or rejected based on the flow log settings:

Enter image description here

answered 3 years ago
AWS
EXPERT
reviewed 3 years ago
1

Also take a look at this blog: https://aws.amazon.com/blogs/aws/learn-from-your-vpc-flow-logs-with-additional-meta-data/

As you can see from the examples in it, public IPs are shown in the flow logs as well.

AWS
EXPERT
answered 3 years ago
0

Hmm, lets define some terms:
-public IP, as in routable in the Internet, i.e., publicly accessible
-private IP, as in not public. Note this is not the same as RFC1918, which are forced private
-VPC, a private domain. Addresses in a private domain are private
-NAT, a linking scheme to connect a private domain to Internet (and lots of other things)
-inside, the private side of NAT
-outside, the public side
-IP, the L3 protocol we are talking, all packets have 1 source and 1 destination

Now, VPC flowlogs log packets in the VPC, which inside addresses. For traffic crossing NAT (IGW) the outside peer address (public) is kept as is so you see that public address in the log. For the inside peer, you see the private address.
This is the high level view. If you want more details, then you should understand that the infrastructure where this happens multiplex the links for many clients, so packets travel encapsulated in extra protocols (underlay). So even if one IP packet has only one source and one destination, VPC flowlogs have a srcaddr field and a pkt-srcaddr field (and dst counterparts).
I think this is used only when a NAT gateway is used to track origin and gateway, but have not found a real doc that explains this.

answered a year ago

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.