Home > Article > Operation and Maintenance > How to configure files in linux
Linux network configuration file
1. System network device configuration file/etc/sysconfig/network -scripts
]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 //Indicates the name of the network card physical device
BOOTPROTO =dhcp //Indicates whether to configure a static or dynamic IP address for the network card (none: indicates no need to start the protocol; bootp: indicates the use of the BOOTP protocol;
dhcp: uses the dhcp protocol to dynamically obtain the IP address; static: indicates manual setting of the static IP address IP address)
ONBOOT=yes //Indicates whether to activate the network card when starting the system, yes means activation, no does not activate
TYPE=Ethernet //Network type
USERCTL= yes
PEERDNS=yes
IPV6INIT=no
PERSISTENT_DHCLIENT=1
HWADDR= //Indicates the MAC address of the network card
GATEWAY = //Indicates the gateway address
NETMASK //Indicates the subnet mask
IPADDR= //Indicates the IP address
]# systemctl restart network (restart service)
2. /etc/resolv.conf domain name resolution configuration file
nameserver: indicates that the host specified by the IP address used to resolve the domain name is the domain name server;
search: Represents DNS search path
3, /etc/hosts host name matches IP address
4, /etc/networks network name and network address Mapping relationship between
]# vim /etc/networks
default 0.0.0.0
loopback 127.0.0.0
link-local 169.254 .0.0
5. /etc/protocols defines the protocols used by the host, as well as related information such as the protocol number of each protocol
]# vim /etc/protocols
6./etc/services defines the names, protocol types, service port numbers and other information of all services in the system. This file is a database file corresponding to the service name and service port number
]# vim /etc/services
PHP Chinese website has a large number of free Linux introductory tutorials, everyone is welcome to learn!
The above is the detailed content of How to configure files in linux. For more information, please follow other related articles on the PHP Chinese website!