0

I know this question has been asked several times, but I don’t get it.

I’d like to display the IPv6 Address of a remote socket Connection in C / C++ on Unix. I’ve also explored getpeername() to get the local ip address, but I’d like to get the public IPv6 Address

Many thanks

Tthrow
  • 55
  • 4
  • I think you'll find your answer here: [Stackoverflow](https://stackoverflow.com/a/2064790/6796428) – sshmaxime Aug 15 '20 at 16:36
  • Does this answer your question? [Getting the source address of an incoming socket connection](https://stackoverflow.com/questions/2064636/getting-the-source-address-of-an-incoming-socket-connection) – Ron Maupin Aug 15 '20 at 19:05
  • For a remote host across the public Internet, you will get the Global IPv6 address. For a remote host on a different network within your control, you may get a Global or ULA IPv6 address, depending on how your network is configured and which address the remote host uses to connect to you. For a local (same network) host, you may get the Global, Link-Local or ULA address, depending on how your network is configured and which address the host uses to connect to you. You may not have ULA configured on your network, but Link-Local and ULA address will not cross the public Internet, only Global. – Ron Maupin Aug 15 '20 at 19:14

0 Answers0