Netstat TCP semantics and syntax example (1)

Source: Internet
Author: User

Have you noticed the use of Netstat TCP while learning about TCP? Netstat is a very useful function that displays a lot of important information. Now let's take a closer look at this content. First, let's take a look at the role of Netstat.

Netstat

Displays active TCP connections, computer listening ports, Ethernet statistics, IP Route tables, and IPv4 statistics for IP, ICMP, TCP, and UDP protocols) and IPv6 statistics for IPv6, ICMPv6, Netstat TCP through IPv6, and UDP protocol through IPv6 ). If no parameter is required during use, netstat displays the active TCP connection.

Syntax

netstat[-a] [-e] [-n] [-o] [-p Protocol] [-r] [-s] [Interval]

Parameters

-A displays all active TCP connections and TCP and UDP ports listened by the computer. -E displays Ethernet statistics, such as the number of bytes sent and received and the number of packets. This parameter can be used with-s. -N indicates the active TCP connection. However, the address and port number are displayed only in numbers, but the name is not determined. -O displays active TCP connections and includes the ID (PID) of each connection process ). You can find PID-based applications on the processes tab in Windows Task Manager. This parameter can be used with-a,-n, and-p. -P Protocol: displays the connection of the Protocol specified by Protocol. In this case, Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with-s to display statistics by Protocol, the Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6. -S displays statistics by protocol. By default, statistics on TCP, UDP, ICMP, and IP protocols are displayed. If the IPv6 protocol is installed, the statistics of TCP, UDP, ICMPv6, and IPv6 protocols on IPv6 are displayed. You can use the-p parameter to specify the Protocol set. -R displays the content of the IP route table. This parameter is equivalent to the route print command. Interval re-displays the selected information every second. Press Ctrl + C to stop displaying statistics again. If this parameter is omitted, netstat prints the selected information only once. /? Display help at a command prompt.

Netstat TCP notes:Parameters Used with this command must be prefixed with a hyphen (-) instead of a slash.

Netstat TCP provides the following statistics:

◆ Proto

Protocol name: TCP or UDP ).

◆ Local Address

The IP address and port number of the local computer. If the-n parameter is not specified, the local computer name corresponding to the IP address and port name is displayed. If the port has not been created, the port is displayed as a star number.
 
◆ Foreign Address


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.