Troubleshooting method of Linux Network
Background: as an operation and maintenance engineer, troubleshooting is a necessary skill; every time you make a mistake, the order is forgotten; sort out the methodology.
Common troubleshooting tools for Linux networks:
Tool use traceroute Port availability probe mtr Network Test tool
Case 1:
The company adopts the network architecture built by the public cloud plus IDC computer room. Network fluctuations between the cloud and the computer room can also cause problems; when the network is unstable at both ends, it is necessary to be proficient in some commands to investigate the specific reasons. 1. Do mtr 2 on the public CVM. Do mtr mtr-c 50 xx.xx.11.251-- report parameter explanation in the IDC server:-- report: display the output in report mode, without this parameter, the page exits after execution;-c 50 sends the first column of packets per second (Host): node IP address and domain name. Press n key to toggle the display. The second column (Loss%): node packet loss rate. Third column (Snt): the number of packets sent per second. The default value is 10, which can be specified by the "- c" parameter. Column 4 (Last): the latest probe delay. The fifth, sixth and seventh columns (Avg, Best, Wrst) are the average, minimum and maximum values of the detection delay, respectively. Column 8 (StDev): standard deviation. The larger the node is, the more unstable the node is.
Case 2:
Detect whether port 22 of IP 223.5.5.5 is available. From the screenshot, you can see that 13 hops can't get through. Query the location of 13 hop IP and give feedback to the supplier.
Traceroute-n-T-p 22 223.5.5.5-T TCP probe-n: use the IP address instead of the host name directly (DNS reverse checking is disabled). -d: use Socket-level troubleshooting capabilities. -f: sets the size of the survival value TTL for the first inspection packet. -F: set not to segment identification. -g: set source routing gateways. A maximum of 8 can be set. -I: when the host has more than one network card, the specified network card is used to send the packet. -I: use ICMP packets instead of UDP packets for detection. -m: sets the size of the maximum survival value TTL for detection packets. -p: sets the communication port of the transport protocol. -r: ignore the normal Routing Table and send the packet directly to the target host. -s: sets the IP address of the packet sent by the local host. -t: sets the TOS value of the detection packet. -v: shows the execution of the instruction in detail. -w: sets the time to wait for the return packet of the remote host. -x: turns the correctness check of the packet on or off.