Fault Analysis and troubleshooting for small and medium-sized heterogeneous Linux networks

Source: Internet
Author: User
Article title: Fault Analysis and troubleshooting for small and medium-sized heterogeneous Linux networks. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Because there are still some differences between Linux desktop applications and Windows, in enterprise applications, Linux and Windows operating systems often coexist to form a heterogeneous network. Because small and medium-sized enterprises lack experienced Linux network administrators, analyzing and troubleshooting Linux network faults is often a headache and a lack of comprehensive consideration.
  
According to statistics, Linux network faults include 35% at the physical layer, 25% at the data link layer, 12% at the network layer, 10% at the transmission layer, 8% at the conversation layer, 7% at the presentation layer, and 3% at the application layer. It can be seen that network faults usually occur on the lower layer of the layer-7 network model, that is, the physical layer, link layer, and network layer. Corresponding to the actual network, that is, the used network cable, connection module, network adapter, switch, router, and other equipment faults. These faults may be caused by product quality or performance, wear and aging, human error, incorrect settings, management defects, hacker system intrusion, and other reasons.
  
Linux network services are very powerful, including Mail Server, Web Server, and DNS Server. However, I often hear people complain that Linux cannot connect to the network. Next, let's take a look at the network model of Linux TCP/IP (see figure ), understanding the layers of the OSI model, TCP/IP model, and related services is very important for Linux network fault analysis and troubleshooting.
   
Linux TCP/IP network models and related services
Solution
  
The order for solving the problem should start from the bottom layer of the Linux network, and then check up slowly. the problem can be solved as follows:
  
◆ Check whether the NIC works properly;
◆ Check whether the local network hardware can be pinged to the IP addresses of other computers in the same domain );
◆ Check whether DNS settings are correct;
◆ Check whether the host service is turned off and inetd. conf/etc/xinetd. d;
◆ Whether the permissions and ports of some services are enabled.
  
For example, in the local area network wiring method, network problems may generally be divided into the network hardware transmission part and the software configuration problems of the operating system, communication protocols or related services.
  
1. network hardware transmission problems
  
(1) network cable
  
It can be found that the network cable is used most frequently in network interface devices. Because the network cable is often connected to the corner and door seams, it may be broken down. Therefore, pay attention to whether the network cable is truncated, excessive network cable distortion deformation, self-made network connections (such as RJ-45 jumper head) poor quality caused by poor signal; poor contact between network connections and devices (such as hubs, routers, and switches.
  
  
(2) network devices such as NICs, hubs, routers, and switches
  
Poor network adapter stability, poor quality, or compatibility with the overall system; poor contact with network equipment, resulting in signal attenuation; poor use of network equipment, transmission problems may occur when the device's function is degraded.
  
  
(3) device configuration rules
  
The configuration of each device has rules. Too long network lines may cause signal attenuation, resulting in too long network connection time or even failure to connect.
  
(4) UPS power supply
  
UPS power supply is easy to ignore. Because vrouters, vswitches, and baseband "cats" and other network devices are sensitive to voltage and grounding, an on-line UPS with excellent performance should be used as the power supply, it is best to use a power above w so that all network devices can be connected to the same power source to avoid voltage differences between different devices. In addition, the IDC room and cabinet should have excellent grounding measures, and establish a ground line for all equipment to ensure that the grounding voltage is the same, so as to ensure the normal operation of network equipment.
  
2. software configuration problems
  
(1) the IP address of the NIC is set incorrectly.
  
For example, an IP address in the same CIDR block may cause an IP address conflict or a blocked network setting error.
  
(2) routing problems (Router)
  
In this case, the Gateway configuration is incorrect or the route settings are incorrect. as a result, data packets cannot be smoothly sent out.
  
(3) network load problem (Loading)
  
When a hacker launches a denial-of-service attack on the network and a large amount of information packets flood into the Server or Hub, the network may pause or even suspend.
  
(4) Others
  
For example, some ports are blocked by the firewall, causing failure to execute certain network resources, application bugs, and network settings errors of users in the application; and compatibility issues with different operating systems.
  
Solution
  
For example, you can start from the network card of your PC to the network cable, Hub, and other hardware. If the hardware is correct, consider the software settings.
   
Network topology
1. check the network adapter's working status
  
(1) use lsmod to check whether the Nic module has been loaded (see figure)
# Lsmod
   
Display Linux hardware
The second to the last line in shows that the Nic has been detected and loaded. If no hardware is detected, use the hardware detection program Kuduz to detect the NIC, which is similar to adding new hardware to Windows. If the core supports the hardware and the driver is available, it can be automatically loaded.
  
(2) use ifconfig to view the network adapter's working status
  
If the network card has been detected, the hardware of the network card is OK. Next, check the software settings of the network card. Run the following command to load ifconfig if no network hardware is driven:
  
# Ifconfig eth0 192.168.0.2 netmask 255.255.255.0 up
  
It is my network settings. the device name is eth0 and the IP address is 192.168.0.2.
  
Basic Nic information
If no Nic is detected, it is troublesome. you need to reinstall the NIC driver as follows:
  
◆ Compile and install the module;
◆ Modify the/etc/conf. module file;
◆ Modify the/etc/sysconfig/network file;
◆ Modify the/etc/sysconfig/network-scripts/ifcfg-eth0 file;
◆ Activate the NIC with ifup eth0 and view it again.
  
If there is still a problem, you can basically determine that the Nic needs to be replaced when a physical fault occurs.
  
2. local network hardware online confirmation
  
After confirming that the most important Nic settings are correct, confirm the network connection in the LAN. According to the network topology, the requirements for Lan are as follows:
  
(1) IP address settings
  
If the subnet is 192.168.1.0/24, the IP addresses of all computers in the Lan should be between 192.168.1.1 and ~ 192.168.1.254, and all computer sub-shielded networks are 255.255.255.0. IP addresses cannot be repeated on all computers.
  
(2) Gateway
  
If the Linux IP address is 192.168.1.2, the Gateway of all other personal computers in the Lan is 192.168.1.2.
  
(3) Windows communication protocol
  
The communication protocols of other Windows systems in the LAN only need TCP/IP and NetBUEI. if too many communication protocols are installed, the connection may be too slow.
  
(4) Windows working group and computer name
  
If resource sharing is required, file sharing must be established in Windows, and all computer working groups must be the same, but the computer names cannot be the same.
  
3. check whether DNS settings are correct
  
If domain name resolution cannot be performed in Linux, it is likely that a valid domain name server is not specified locally. this is usually the case. Generally, modify the files related to the domain name service, such as/etc/hosts or/etc/resolv. conf, and add the IP address of the valid domain name server to these files to solve the problem.
  
4. whether the host service has disabled the service permission
  
A common problem is that you cannot log on to the host to execute some functions. that is to say, you can ping a host on the network, but cannot execute some specific functions of the host, such as FTP and WWW. Therefore, you must first check whether the host provides FTP and WWW services. In Red Hat 7.X, FTP and Telnet are disabled by default. At this time, you must go to/etc/xinetd. d to modify several service settings. Telnet is used as an example:
  
# Vi/etc/xinetd. d/telnet
Service telnet
{
Disable = yes
Flags = REUSE
Socket_type = stream
Wait = no
User = root
Server =/usr/sbin/in. telnetd
Log_on_failure + = USERID
}
  
Change disable = yes to disable = no to enable the service. Then, use/etc/rc. d/init. d/xinetd restart to activate the Telnet service.
  
5. check whether the permissions and ports of some services are enabled.
  
If the Client PC needs to use the Server service, check the permissions of each file or program, for example,/etc/hosts. whether allow is enabled, whether the Mail Server has set relay and httpd. whether to enable PHP, MySQL, or other related CGI programs in the conf file, whether anonymous FTP logon is enabled, and whether various ports are enabled. Run the following command:
  
# Netstat-
  
Check whether the port is enabled.
  
Some common port numbers are: ftp: 21; telnet: 23; smtp: 25; http: 80; pop-3: 110; netbios-ssn: 139; squid: 3128; mysql: 3306.
  
Understanding the OSI model, TCP/IP model, and related service layers is very important for Linux network fault analysis and troubleshooting. When you have a thorough understanding of the OSI model, fault diagnosis becomes easier. If you can configure some network detection tools, it is also very useful for network fault analysis and troubleshooting.
  
  
  
  
  
  
  
  
  

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.