Linux Network troubleshooting and viewing network information commands

Source: Internet
Author: User
Tags rfc network troubleshooting

The ping command uses the ICMP protocol (echorequest----echo Reply package) to implement

Options

-C number of times you specify ping to exit

-W time Specifies maximum wait time

Note: If a large number of ping requests to the host, it will affect the other network services.

Ping Output Detailed

RTT: Response time for Request messages

error message:timeout keyword: there are 2 kinds of reasons:1, no this host 2, the other host does not respond

Target Host Unreachable: This goes to the RfC document (a good way to learn the network protocol is to look at the RfC ), there is a Chinese version!

Script to determine if the host is online:

1)

For: In.; Do ping–c1–w1 x.x.x. $i &>/dev/null && echo "online:x.x.x. $i" | | echo "Offline x.x.x. $i";d One

2)

For: In.; Do if ping–c1–w1x.x.x. $i &>/dev/null, then echo "online:x.x.x. $i", Else echo "offline x.x.x. $i"; fi;done

3) Quick Ping method

For: In.; Do (Ping–c1–w1 x.x.x. $i &>/dev/null && echo "online:x.x.x. $i" | | echo "offlinex.x.x. $i") &;d one|sort–t.-n–k4

Traceroute Command: How many router to track to the target host

TCP Finite state machine: identifies the status of a connection that is based on a TCP protocol--- see the picture under the Mag Learning Note Directory with the same name

Netstat command options

-T view TCP established connections

- u View the UCP established connection

-A = =-tu

-P Display Pid/ program name

-rn show local routing table (no reverse domain name)

-L Show services in listening state

-N Displays the port number, hostname (IP) in numeric format,does not reverse IP, does not resolve the service name corresponding to the port number

* common option combination -TUNLP *udp is not connected so there is no LISTEN this state,

available options -tn | -TNL display only TCP connection information

    • The-C option displays the output and does not exit the command, you can dynamically display the connection status, available commands #netstat –TNC 5 Try it, this command specifies that the refresh time is refreshed every 5 seconds, and does not specify that the default is refreshed every second.

-E Displays extended information, such as user inode columns and many more,-tne options Try

The netstat command executes slowly while the native has a large number of connections, the SS command is provided by the Iproute2 package, the function type netstat, Performs faster than Netstat when the machine has a large number of connections

SS Command Options

-T view TCP established connections

-t-a View TCP established connections , and services in the listener

- u View the UCP established connection

-u-a View The UCP is connected and the service waiting to connect

Common Options –tua

-l display sockets in listening

-m displays memory information used by sockets

-e display extended information

-S Display statistics

-P Display Pid/ program name

The SS can also specify a filter condition to display the connection #man SS

Cases

Ss-ta State established ' (Dport =:ssh) '

Ss-tan State established ' (dport =:22 or sport =: 22) '


This article from the "Let me more Hungry" blog, please be sure to keep this source http://ufirst.blog.51cto.com/7628670/1432611

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.