netstat — why are IPv4 daemons listening to ports listed only in -A inet6?
By default if you don't specify address to Apache Listen
parameter, it handles ipv6 address using IPv4-mapped IPv6
addresses. You can take a look in Apache ipv6
The output of netstat
doesn't mean Apache is not listening on IPv4 address. It's a IPv4-mapped IPv6
address.
The reason for this is because all IPv4 addresses are also IPv6 addresses. A small range of IPv6 addresses was set aside to be used for one-to-one mapping of IPv4 addresses. For example, the IPv4 address 192.0.2.128
is accessible via the IPv6 address ::ffff:192.0.2.128
. This was done so that any applications which support IPv6 only, could still listen on IPv4 addresses.
Note that this can't be used for an IPv6 address (non-mapped) to talk to an IPv4 address without other things involved, as the IPv4 won't know how to handle the IPv6 address (you can use NAT, or other solutions though).
Since all IPv4 addresses are represented in IPv6, when asking netstat
to list apps using IPv6, you're also going to get IPv4.
It could represent 10.0.176.93
as ::ffff:10.0.176.93
, or even ::ffff:a00:b05d
, but the application developers chose to show it as a regular dotted-notation IPv4 address.