One: Configuration file
/etc/hosts
Local Host IP address mapping
Content: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
/etc/services
The correspondence between port numbers and standard services
Individual fields: Service-name Port/protocol aliases Comment
/etc/sysconfig/network
Set host name Gateway domain name
/etc/rc.d/init.d/network
Service network restart is equivalent to/etc/rc.d/init.d/network restart
NIC configuration file:
/etc/sysconfig/network-scripts/ifcfg-eth*
Device=eth0 NIC corresponding name
Onboot=yes
bootproto=static (static IP status setting)
BOOTPROTO=DHCP (DHCP Fetch)
ipaddr=192.168.1.8 (static IP address)
netmask=255.255.255.0
gateway=192.168.1.1 (Gateway) (if you set the gateway here, the settings in/etc/sysconfig/network are not valid)
Macaddr=00:0c:29:96:38:f8 (Modify MAC address)
DNS-related configuration files
/etc/host.conf
/etc/nsswitch.conf
/etc/resolv.conf
Command
ifconfig eth0 IP address netmask subnet mask up
Common Test Commands
PING-C 4 IP Address
Route operates on the IP routing table of the kernel, setting static routes for the host or network of configured interfaces
Route add-net IP address netmask subnet mask eth0 Add a routing entry to the IP address of the network
Route del-net IP address netmask subnet mask
Route-c Viewing buffer tables
ROUTE-N Route Tracking
Linux Network Configuration ·