View port number netstat command windows

Source: Internet
Author: User

To view the ports in Windows 2000/xp/server 2003, you can use the netstat command:

Tap Start → run, type "cmd" and enter to open a command prompt window. Type "Netstat-a-n" at the command prompt and press ENTER to see the port number and status of the TCP and UDP connections that are displayed digitally.

Tip: Netstat command usage
Command format: netstat-a-e-n-o-s-an

-A indicates all active TCP connections and TCP and UDP ports on which the computer listens.

-E Indicates the number of bytes sent and received by Ethernet, the number of packets, and so on.

-n means that only the addresses and port numbers of all active TCP connections are displayed in digital form.

-O indicates that the active TCP connection is displayed and includes the process ID (PID) for each connection.

-S means the statistics of the various connections, including the port number, are displayed by protocol.

-an View all open ports
Close/Open ports
Before introducing the functions of various ports, let's introduce how to close/open ports in Windows, because by default, there are many insecure or unused ports that are open, such as the 23 port of the Telnet service, the 21 port of the FTP service, the 25 port of the SMTP service, RPC service, port 135, and so on. In order to ensure the security of the system, we can use the following method to close/open the port.

Close port
For example, to turn off port 25 of the SMTP service in Windows 2000/XP: First open Control Panel, double-click Administrative Tools, and then double-click Services. Next, locate and double-click the "Simple Mail Transfer Protocol (SMTP)" Service in the Open Services window, stop the service by clicking the Stop button, then select "Disabled" in startup type, and then click the OK button. In this way, shutting down the SMTP service is equivalent to shutting down the corresponding port.

Open port
If you want to turn on the port, simply select Automatic in Startup type, click the OK button, then open the service, click the Start button in service status to enable the port, and finally click the OK button.
Tip: There is no "service" option in Windows 98, you can use the firewall's rule setting feature to turn off/on the port.
Port classification

View port number netstat command windows

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.