Network troubleshooting and viewing under Linux

Source: Internet
Author: User
Tags network troubleshooting nslookup

Basic Troubleshooting Errors

Troubleshooting must be simple after the complex, some people put the above-mentioned files repeatedly configured, is not on the net, has been thought to be a system failure, want to re-installed son. It turns out that the cable is not plugged in at all.

The wrong things to slowly step by step:

(1) First look at whether the network cable is plugged in, the light is OK.
(2) We want to see if their network card driver is normal, establish an IP and then ping it, to see if the ping pass, by stating that the network card is normal.
(3) Use the Ifconfig command to see if the IP is correct and the routing information is correct
(4) Ping Unified Network segment of the machine, not the Gateway Setup error
(5) Check the status of DNS (this is often seen, we can ping LAN, but the network is not linked, that is, DNS has a problem)
(6) Check whether the service can be opened, we usually close the NetworkManager service.


Operation Flow

(1) First turn off the NetworkManager:

Turn it off also:

(2) View routes:

(3) View DNS settings:

(4) View Ifcfg-eth0 and Ifcfg-br0:

(5) View Network device identification rules:

See what the rules specify is that eth0 is consistent with our settings.

Note: If the above problems are resolved or not online, to see if it is the cause of selinux.


To view Network command parsing:

Network Configuration view: Ifconfig

Purpose: Configure or display network interface parameters for TCP/IP networks

Example operation: ifconfig

Link EnCap: This field represents the name of the network device at the OSI physical layer.
HWADDR: The hardware address of the network card, which is the MAC address. Inet Addr: Displays the IP address of the network card bcast: The interface's network broadcast address mask: The interface's network subnet mask. MTU: The maximum transmission unit for this interface Metric: The default routing cost.
RX: Accepted packet statistics.
TX: Packet count in transmitted or transmitted collisions: number of packet collisions on the NIC interface Txqueuelen: The transmission queue length of the NIC set RX bytes: The amount of packet data received, in bytes. TX Bytes: The amount of packet data transmitted, in bytes interrupt: The IRQ interrupt value for this NIC interface.

Communication between the two hosts: Ping

The ping command is commonly used to detect network connections, also known as latency, the larger the value, the slower the speed of ping (packetinternetgrope), the Internet Packet Explorer, the program used to test the network connection volume.

Ping sends an ICMP echo request message to the destination and reports whether the desired ICMP echo response was received. It is a command to check whether the network is unobstructed or the speed of the network connection.

? Principle: The machine on the network has a unique IP address, we send a packet to the destination IP address, the other side will return a packet of the same size, according to the returned packet we can determine the target host, can initially determine the target host operating system and so on.

Example operation: ping-c 5 www.baidu.com (-C 5 This parameter indicates the ping command is performed 5 times)


Analysis of the nodes between the two hosts: Traceroute

By traceroute we can know what path the information from your computer to the other end of the Internet host is walking. Of course, each time a packet arrives at a similar destination (destination) by a similar starting point (source), the path may be different, but basically the route is the same. Linux systems, which we call traceroute, are tracert in MS Windows. Traceroute measures how long it takes to send a small packet to the destination device until it returns. Each device on a path is measured 3 times traceroute. The output includes the time of each test (MS) and the name of the device (if any) and its IP address.

Example operation: Traceroute www.baidu.com


We found that some of the returned * * *, on behalf of the node may have some protective measures to let us send the packet information is discarded.


View the network link and backdoor of this machine: netstat

The netstat is used to display statistics related to IP, TCP, UDP, and ICMP protocols, and is typically used to verify the network connectivity of each port on the machine.
If your computer sometimes receives datagrams that cause error data or failures, you don't have to be surprised that TCP/IP can tolerate these types of errors and be able to automatically re-send datagrams. But if the cumulative number of errors accounts for a significant percentage of the IP datagram received, or if its number is increasing rapidly, then you should use Netstat to find out why these situations occur.

Detailed parameters:

-A or-all shows a valid link in all the connections Socket-n has been established-o display Timer-p-programs show the program in use-T displays the connection status of the TCP Transport-U displays the connection of the UDP transmission-l display the socket example of the server in monitoring Action: Netstat-a


Detecting host name vs. IP: host,nslookup

Two commands are similar, can be traced to the IP address of the server, but the latter can also find the host name.

Example Operation: Host Www.baidu.com

Nslookup www.baidu.com



Network troubleshooting and viewing under Linux

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.