Environment: centos 5.5
Configuration files related to centos network settings:
- File/etc/sysconfig/Network: You can set the network enabling status, default Interface, default gateway, host name, domain name, etc.
- Directory/etc/sysconfig/network-scripts: Control script of each network interface, such as ifcfg-eth0, can set the interface type, IP, gateway, Mac, boot status, etc.
- File/etc/resolv. conf: sets the DNS information of the local DNS resolution URL. You can set the DNS name server address (up to 3), local domain name, search list, and so on.
- File/etc/hosts: Set the ing between the host name and IP address, for example, localhost and Host Name of the local machine, to the domain name or host name of another machine. Generally, the DNS is resolved first.
- File/etc/nsswitch. conf: You can set the name resolution sequence (hosts Section) to specify whether to search for the DNS defined by/etc/hosts or/etc/resolv. conf first
Commands related to centos network settings:
- Service Network restart/Stop/start/status: Network Service Management command
- After the network parameters change, you need to restart the entire network or the corresponding network interface.
- Equivalent to/etc/init. d/network restart, it is to run various parameters of the Service script program/etc/init. d/network.
- Ifconfig: Network Interface Management, which allows you to view and control the status of network interfaces and modify interface parameters.
- Ifconfig ethx: view the status of a network interface ethx. If no interface is specified, all
- Ifconfig ethx down/Up: Manage a network interface ethx (enable/disable)
- Ifconfig ethx Inet 192.168.1.11 netmask 255.255.255.0: modifies the network settings of an interface.
- Netstat: view the network usage status (Statistics)
- Hostname: displays or modifies the Host Name (invalid after restart)
- Ping-C 4: sends an ICMP packet to the target address to determine whether the target host is working or connected to the network.
- Traceroute: trace the route path
Refer to: Correct centos network settings network commands and laruence's Linux private house dish-server setup.