Basic troubleshooting methods for linux network problems

Source: Internet
Author: User
The basic troubleshooting methods for linux network problems may often encounter download or upload failures when running linux network applications. How can we find the problem points when we encounter such problems? The following are some troubleshooting methods summarized during the learning process. The basic troubleshooting methods for the linux network problems are described in the linux network application, download or upload may often fail. How can we find the problem points when we encounter such problems? The following are some methods for analyzing problems summarized in the learning process, and record them for future reference. 1. if the network is disconnected, use ifconfig to check whether the system correctly identifies the network interface (that is, the NIC), sh-# ifconfigeth0 Link encap: Ethernet HWaddr 00: 00: 00: 11: 22: 33 up broadcast multicast mtu: 1500 Metric: 1 RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B) Interrupt: 40 Base address: 0x2000 you can see, the system has recognized eth0. 2. if the network card can be identified, check whether IP address, sh-# ifconfigeth0 Link encap: Ethernet HWaddr 00: 00: 00: 11: 22: 33 inet addr: 192.168.102.86 Bcast: 192.168.102.255 Mask: 255.255.255.0 up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 199 errors: 0 dropped: 6 overruns: 0 frame: 0 TX packets: 146 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 69472 (67.8 Kb) TX bytes: 177 06 (17.2 Kb) Interrupt: 40 Base address: 0x2000 if there is no ip address, check whether your host is connected to the network. if any ip address is assigned, run the ping command to check whether other hosts can be pinged. 3. ping www.google.com or ping 192.168.0.1 to test network connectivity. Ping command Sends ICMP ECHO_REQUEST packet to destination host to test the connectivity between two hosts. Because ping is a network layer protocol, ping can only prove that the network layer and its lower layers are normal, but cannot prove that its upper layer, such as transport layer (TCP/UDP) or application layer (FTP/HTTP, etc) whether the problem exists. In addition, ping does not mean you can connect to the internet, because the two hosts in a LAN can also ping each other. of course, if you can ping www.google.com, it indicates that your host can be connected to the internet. Sh-# ping 192.168.0.1PING 192.168.0.1 (192.168.0.1) 56 (84) bytes of data.64 bytes from 192.168.0.1: icmp_req = 1 ttl = 255 time = 3.86 ms64 bytes from 192.168.0.1: icmp_req = 2 ttl = 255 time = 17.0 ms64 bytes from 192.168.0.1: icmp_req = 3 ttl = 255 time = 1.90 ms64 bytes from 192.168.0.1: icmp_req = 4 ttl = 255 time = 1.32 ms ^ C --- 192.168.0.1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 302 7 msrtt min/avg/max/mdev = 1.320/6.029/17.031/6.421 mssh-# sh-# ping www. google. comPING www.google.com (74.125.239.147) 56 (84) bytes of data.64 bytes from nuq05s02-in-f19.1e100.net (bytes): icmp_req = 1 ttl = 53 time = 258 ms64 bytes from nuq05s02-in-f19.1e100.net (74.125.239.147 ): icmp_req = 2 ttl = 53 time = 244 ms64 bytes from nuq05s02-in-f19.1e100.net (74.125.239.147): icmp_req = 3 ttl = 53 time = 242 MS ^ C --- www.google.com ping statistics --- 3 packets transmitted, 3 encoded ed, 0% packet loss, time 2016 msrtt min/avg/max/mdev = 242.508/248.524/258.558/7.153 MS 3. therefore, if you successfully ping google, you may need a packet capture tool to help you analyze the problem. Tcpdump, one of the tools, is used to dump packets in the network :. /tcpdump-I eth0-w. /tcpdump. in pcap,-I is used to specify the specific interface, and-w is used to specify the storage path of data packets. Problem to be solved: how can we analyze data packets when we capture tcpdump. pcap? 4. sometimes you may need to test the network performance. you can use another tool, iperf, to measure the maximum TCP/UDP bandwidth performance in the network. (1) If you want to test the host's performance in receiving data, such as downloading data from a server, then your host is the receiving end. A. configure your PC as the data sending end, and specify the report interval as 1 s and the test time as 100 s :. /iperf.exe-c 192.168.0.111-i1-t100, where-c is specified as client mode, so the subsequent 192.168.0.111 is the server ip address;-I is used to specify the report time; -t specifies the test time. B. to receive data (in this example, set it to server):./iperf-s-i1, where-s is used to specify your host as server mode. (2) test the host's data sending performance :. /iperf-c 192.168.0.110-w 64 k-i1-u-B 15 M-t600, where-w specifies the TCP window size as 64 k, -u indicates that udp is used to send data;-t indicates that udp bandwidth is 15 Mbit/s.
Related Article

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.