How do I interpret 'netstat -a' output

后端 未结 7 1987
失恋的感觉
失恋的感觉 2021-01-30 22:40

Some things look strange to me:

  • What is the distinction between 0.0.0.0, 127.0.0.1, and [::]?
  • How should each part of the foreign address be read (part1:p
7条回答
  •  余生分开走
    2021-01-30 23:21

    What is the distinction between 0.0.0.0, 127.0.0.1, and [::]?

    • 0.0.0.0 indicates something that is listening on all interfaces on the machine.
    • 127.0.0.1 indicates your own machine.
    • [::] is the IPv6 version of 0.0.0.0
    • My machine also shows *:\* for UDP which shows that UDP connections don't really have a foreign address - they receive packets from any where. That is the nature of UDP.

  • How should each part of the foreign address be read (part1:part2)?

  • part1 is the hostname or IP address
  • part2 is the port
提交回复
热议问题