How do I interpret 'netstat -a' output

后端 未结 7 1988
失恋的感觉
失恋的感觉 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条回答
  •  梦毁少年i
    2021-01-30 23:20

    I understand the answer has been accepted but here is some additional information:

    • If it says 0.0.0.0 on the Local Address column, it means that port is listening on all 'network interfaces' (i.e. your computer, your modem(s) and your network card(s)).
    • If it says 127.0.0.1 on the Local Address column, it means that port is ONLY listening for connections from your PC itself, not from the Internet or network. No danger there.
    • If it displays your online IP on the Local Address column, it means that port is ONLY listening for connections from the Internet.
    • If it displays your local network IP on the Local Address column, it means that port is ONLY listening for connections from the local network.
    • Foreign Address - The IP address and port number of the remote computer to which the socket is connected. The names that corresponds to the IP address and the port are shown unless the -n parameter is specified. If the port is not yet established, the port number is shown as an asterisk (*). (from wikipedia)

提交回复
热议问题