Linux View network link status command the netstat parameter is as follows:-a displays all sockets, including those that are listening. -C Displays it again every 1 seconds until the user interrupts it. -I displays information for all network interfaces in the same format as "ifconfig-e ". -n Displays the network connection situation by replacing the name with the network IP address. -R Displays the core routing table in the same format as "route-e ". -T shows the connection condition of the TCP protocol. -u shows the connection condition of the UDP protocol. -v shows the work in progress. 1. Netstat-an |grepLISTEN0.0.0. 0 is the service of each IP, stating which IP is the service that binds that IP. 2. Netstat-Tln used to view the port usage of Linux3. /etc/init.d/vsftp Start is used to start the FTP port~! 4. Netstat view the connected service ports (established)5. Netstat-A View all service ports (listen,established)6.sudoNetstat-AP View all service ports and display the corresponding service program name7. Nmap Scan type >< scan Parameters > example: Nmap localhostnmap-P1024x768-65535Localhostnmap-pt192.168.1.127-245when we use netstat-when APN views the network connection, it will find a lot like the following: Proto Recv-Q send-q Local address Foreign address State Pid/Program nametcp0 the 218.104.81.152:7710 211.100.39.250:29488Established6111/1shows that this server has 7710 ports open, so which program does this port belong to? We can use lsof-I.:7710commands to query: command PID USER FD TYPE DEVICE SIZE NODE namesshd1990Root3uIPv44836TCP *:7710(LISTEN) 54com.cn So, we know that the 7710 port belongs to the SSHD program. =================================================The following statement is a very good statement to view the status of a TCP connection: netstat-N |awk '/^tcp/{++s[$NF]} END {for (a in S) print A, S[a]} 'example of return result: Last_ack5Syn_recv -establ
Linux View network link condition command netstat