Monday, October 5, 2015

What is ::ffff:127.0.0.1?

I was adding additional logs for my Node.js Web app. During testing, I noticed my IP address is logged as "::ffff:127.0.0.1" instead of "127.0.0.1". Turns out this is due to the transition from IPv4.

::ffff:0:0:0/96 — A prefix used for IPv4-translated addresses which are used by the Stateless IP/ICMP Translation (SIIT) protocol.

Stack Overflow user rockerBOO explained:
Windows 7 has IPv6 enabled by default. Even though my server listens on IPv4 only, Windows 7 sends the ::ffff: prefix to the IPv4 as part of the transition to IPv6.


Ref:
node.js - Express.js req.ip is returning ::ffff:127.0.0.1 - Stack Overflow
IPv6 address - Wikipedia, the free encyclopedia

No comments: