Viewing of Linux network connections and monitoring of ports

Source: Internet
Author: User

The network software is composed of the client and the service side, and the server listens to the specified port to process the received data, and the client sends the data to the server-side listening port, and the data is processed by the server side, then the processing result is returned to the client.

so how do we see on Linux what ports we are listening to, and which clients are connecting to my server?

first of all we need to know what protocol we use to transfer, the use of the protocol can be used in different ways to view. The transport protocol is divided into tcp and UDP Two, we first look at the server side how to see what TCP protocol and UDP Protocol port, use the command NETSTAT-NTLP to view the TCP port

we can see that this machine monitors the TCP 587 ,143,111 , etc. Port

We can also use the command Netstat-nulp to view the UDP ports in the listener

In the figure we can see the Local address This column, some in the listening 0.0.0.0: Port , Some in the listening 127.0.0.1: Port, Others are listening to the standalone IP: port, so what do they represent? What difference does it have?

0.0.0.0 represents a port that listens to all IP on this server , and can access all the IP listening ports on the local computer.

127.0.0.1 represents a port that allows only native access to listen

192.168.1.100 represents a port that only allows access to 192.168.1.100 this IP listener

Next, let's see how to check which network connections are in use on my machine.

Use the command SS to view

we can see that only one network connection is currently in use on the machine. SSH Service

This is our remote network connection, using the SS fame and fortune can be effectively viewed to the machine all in use connection, thus we can filter on these connections to check the machine for the presence of dangerous network connections

With these commands we can see what ports our machines are opening, what network services are available, and if they are not for me, then I can turn off redundant Web services.

Viewing of Linux network connections and monitoring of ports

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.