In Linux system, network configuration file

Make a note, the network settings on Linux are basically dealt with some configuration files, so memorizing the following configuration files is much better than remembering any commands:
1. /etc/sysconfig/network
Description: set the file name (Hostname) and whether to start the network, after modifying this file, the host name must be restarted to take effect
2. /etc/sysconfig/network-scripts/ifcfg-eth0
Description: The content of this file is to set the relevant parameters of the network card. You can set network (domain starting address), IP (currently used IP), netmask (subnet mask), broadcast (domain broadcast address), gateway (default gateway address), and how to obtain IP at startup (DHCP). , static, none), whether to start at boot time, DEVICE (this parameter must be related to the current file name).
The configuration of this file is basically the same as the network card (network adapter) setting in Windows
. It is related to the installation of the kernel, check it online by
yourself 4. /etc/resolv.conf
description: DNS server configuration is related, (that is, the meaning of domain name resolution resolv=resolve resolution)
5. /etc/hosts
description: This file is related to the C under Windows The :\Windows\System32\drivers\etc\hosts file has similar functions, mainly to map the hostname and ip in other LANs, that is, when we use the hostname to access other hosts, refer to this file
6, /etc/services
Description: This file records the planned protocol port (default port) on the TCP/IP on the system. If you want to customize the correspondence between the new protocol and the port, you must modify this file
7. /etc/protocols
This file defines Protocols related to the IP packet protocol, including the definition of the packet protocol in ICMP, TCP, UDP, etc.


Network startup related commands
1. /etc/init.d/network restart
Description: This service is very important and can restart all network-related Service and make parameters valid
2. ifup eth0 (ifdown eth0
description: start or shut down a network card (these two commands will be processed with reference to the relevant configuration files under /etc/sysconfig/network-scripts/)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326513622&siteId=291194637