0 12 min 2 weeks

  The Linux system itself is designed to have powerful network and communication functions, supporting TCP/IP, ATM, IPX/SPX, X.2.5, Frame-relay, AppleTalk, and many other network communication protocols. It adds the implementation of the protocols into the Linux kernel, providing efficient network communication processing capabilities. Checking and testing network configuration is the first step in managing Linux network services.

  The network interface card (network card) of the host is usually called the network interface. In the Linux operating system, the ifconfig command can be used to view the address configuration information (Interface Configuration) of the network interface.

  1.1.1 View active network interface device
Online casinoJust need you
  If the system is installed with mini version CentOS 7, the ifconfig command is not available by default. You need to install the net-tools software package first through yum to have the ifconfig command.

  When executing the ifconfig command without any options or parameters, it will display the information of the network interfaces that are enabled (active) on the current host.

  ens33: The name of the first Ethernet card. “en” in “ens33” is the abbreviation of “EtherNet”, indicating that the network card type is Ethernet, “s” indicates the device on the hot-plug slot (hot-plug Slot), and the number “33” indicates the slot number. lo: The “loopback” network interface, “lo” is the abbreviation of “loopback”, which does not represent a real network interface but is a virtual network interface. Its IP address is default “127.0.0.1”. The loopback address is usually used only for network testing on the local machine.

  1.1.2 View information of specified network interface

  When you only need to view the information of a specific network interface, you can use the name of the network interface as a parameter for the ifconfig command, regardless of whether the network interface is active or not.

  inet: Represents the IP address of the network interface, such as “192.168.4.11”. netmask: Represents the subnet mask of the network interface, such as “255.255.255.0”. broadcast: Represents the broadcast address of the network interface’s network, such as “192.168.4.255”. ether: Represents the physical address (MAC address) of the network interface, such as “00:0c:29:3a:81:cc”. The physical address of the network interface is usually not changeable and is determined as a globally unique hardware address when the network card is produced.

  In the Linux operating system, a considerable number of network services identify hosts by hostname. If the hostname is misconfigured, it may cause program functions to fail. The hostname command can be used to view the hostname of the current host without adding any options or parameters.

  The routing table in the Linux operating system determines the destination of data sent from this host to other hosts and other networks, which is a key piece of information for troubleshooting network issues. Directly executing the “route” command can view the routing table information in the current host. In the output results, the Destination column corresponds to the address of the target network segment, the Gateway column corresponds to the address of the next-hop router, and the Iface column corresponds to the network interface for sending data

  When the target network segment is “default”, it indicates that this line is the default gateway record; when the next hop is “gateway”, it indicates that the target network segment is directly connected to the host. However, directly executing the “route” command cannot directly show the default gateway address. If the “-n” option is used in combination, the addresses in the routing records can be displayed in numeric form, which can skip the process of resolving hostnames, and can speed up execution when there are many routing table entries

  The netstat command can view the network connection status, routing table, interface statistics, and other information of the current operating system, which is an effective tool for understanding network status and troubleshooting network service issues. Common options of the netstat command include

  Option explanation: -a displays all active network connection information on the host (including listening and non-listening service ports); -n displays the relevant host addresses and ports in numeric form; -r displays routing table information; -l displays network connections and port information in the listening (Listening) state; -t views information related to TCP (Transmission Control Protocol, Transmission Control Protocol); -u displays information related to UDP (User Datagram Protocol, User Datagram Protocol); -p displays the process number and process name information associated with network connections (this option requires root privileges)
sports betting secretsJust need you
  The combination of options “-anpt” is usually used to display all TCP connection information in the current system in numeric form, while also displaying corresponding process information. When combined with the pipe command, the “grep” command can also be used to filter out the specific records needed in the results

  In addition to netstat, the ss command can also view network connection information. ‘ss’ is an abbreviation for Socket Statistics and is mainly used to obtain socket statistics. It can display output content similar to the netstat command. The advantage of ss is that it can display more detailed information about TCP and connection states, and it is faster and more efficient than netstat. To use the ss command, first ensure that the iproute package has been installed, which can be installed through the yum method. Common options include

  Option explanation: -h –help Obtain more usage help; -V –version Display the software version number; -t –tcp Display TCP protocol sockets; -u –udp Display UDP protocol sockets; -n –numeric Do not resolve the service name, such as the port ’22’ will not be displayed as ‘ssh’; -l –listening Only display ports in listening state; -p –processes Display the processes listening on the ports; -a –all For TCP protocols, it includes both listening ports and established connections; -r –resolve Interpret IP as a domain name and port number as a protocol name

  The output of the ss command can provide TCP and UDP socket information, as well as various persistent connections established by various services. Familiarity with this command helps to better discover and solve system performance issues

  The premise for users to access network services is that the network connection is in a normal state. If the network connection is unstable, or even unable to connect, users will not be able to access network services normally. Therefore, when the network connection has problems, it is necessary to determine the fault point through testing network connection commands

  Test network nodes between the current host and the target host. For nodes that cannot respond, the connection status will be displayed as *. The traceroute command is more accurate in locating network connection faults (breakpoints) than the ping command, and it is therefore slower in execution speed. In network testing, use ping first, and if a network connection fault is found, use the traceroute command to trace and view the fault nodes. The basic format of the command is

  2.3.1 Experimental Topology Diagram

  Use GNS3 software to experimentally verify a CentOS 7 and a Win 10 system

  Topology diagram

  2.3.2 Assign Network Cards

  Set network

  2.3.3 Configure R1

  2.3.4 R2 Configuration

  2.3.5 CentOS 7 Settings

  2.3.6 Win10 IP Address Settings: Directly change the network card address

  Change network

  2.3.7 Win 10 IP Address Settings

  2.3.8 Try to ping win10 in CentOS 7

  nslookup command

  Test DNS domain name resolution, resolve domain names to IP addresses

  3.1.1 Temporary Configuration: Adjust network parameters using commands

  Temporary modifications are generally used for maintenance purposes. They are simple, quick, and can directly modify running network parameters, which are usually only suitable for debugging network processes. After the system restarts, the modifications will be invalidated directly

  3.1.2 Fixed Settings: Modify network parameters through configuration files

  Modify the configuration files of various network parameters. It is suitable for setting fixed parameters on the serverwebsite online casino online website and Latest. It needs to reload the network service or restart the server for it to take effectonline casino plan and The latest method

  Set the IP address and subnet mask of the network interface

  Disable or reactivate the network card

  Bind a virtual interface to the network card

  During the debugging process of the server network, sometimes it is necessary to use a new IP address temporarily on the same network card, but cannot cover the original IP address to prevent the service program from being unavailable. In this case, a virtual network interface can be bound to the network card, and then a new IP address can be configured for the virtual interface (equivalent to a network card configured with multiple IP addresses)

  The route command can not only be used to view routing table information, but also to add, delete static routing table entries, including setting the default gateway address (the default gateway record is a special static routing entry). The IP address of the default gateway should be in the same subnet as one of the host’s interface IP addresses. Add routing records to the specified subnet

  Delete the routing record to the specified subnet

  Add a default gateway record to the routing table

  Delete the default gateway record from the routing table

  Only one default gateway record should be in the routing table of the same host, otherwise it will cause network failure on the host

  The /etc/sysconfig/network-scripts/ directory

  The file name format is ‘ifcfg-xxx’, ifcfg-ens33: configuration file for the first Ethernet card…The configuration file for the loopback interface lo is ‘ifcfg-lo’

  Restart the network network service

  Or

  /etc/sysconfig/network file, in CentOS 6 system

  Save global network settings, mainly including host name information /etc/hostname file, in CentOS 7 systemonline website sports and The most fun game

  /etc/resolv.conf file

  Save the IP address of the DNS server that the host needs to use. Modifications made to this file take effect immediately. In Linux systems, up to 3 different DNS server addresses can be specified (the third and subsequent ones will be ignored), and the first DNS server is used preferentially

  /etc/hosts file

  The mapping records of host names and IP addresses are generally used to save information about frequently visited hosts. Comparison of hosts file and DNS server

  By default, the system first searches the hosts file for resolution records when accessing an unknown domain. First, it looks for corresponding mapping records in the file. If not found, it will query the DNS server. The hosts file is only effective for the current host because the hosts file is only stored locally. The hosts file can reduce the DNS query process, thereby speeding up access speed. Add correct mapping records (frequently visited websites) to /etc/hosts to reduce DNS queries and improve Internet access speed