4 ms·
`ip a` will tell you your IP addresses. As far as I can tell, for IPv6 it actually does know it's public address since that is globally unique with no need for
by SilverRed 5y ago
`ip a` will tell you your IP addresses. As far as I can tell, for IPv6 it actually does know it's public address since that is globally unique with no need for a public/private split.
- andrewmcwatters 5y agoThe issue is that ifconfig and ip do not recognize the Private-Use Networks under any flag and thusly query DHCP for the public address, nor does DHCP have such a query. (To my knowledge.)
- Symbiote 5y agoWhen the host has a private-use address, there's not necessarily a single public IP (through NAT etc). Packets from my computer will currently appear from two possible public addresses, depending if they've been routed through the work VPN. When the host has a non-private-use address, there might still be NAT, or there might be no Internet access. I have servers in 128...* without Internet access. The "public" address might differ depending on the destination or anything else. "ip ad" shows the address(es) the network interfaces has, nothing more.