TCP/IP network configuration file
/Etc/sysconfig/network-scripts/ifcfg-eth0 Nic Interface Configuration File
Content instance
Device = eth0 Nic ID
Onboot = Yes activated upon startup
Bootproto = static or works as a DHCP pilot
Ipaddr = 192.168.1.10 IP Address
Netmask = 255.255.255.0 Subnet Mask
Geteway = 192.168.1.1 Gateway
Network = 192.168.1.0 network segment
Broadcast = 192.168.1.255 broadcast code
/Etc/sysconfig/basic network configuration file
Content instance:
Networking = yes whether IPv4 works
Hostname = linux.jnrp.cn machine name
Gatway = 192.168.1.1 Gateway
/Etc/hosts this file is equivalent to the host file in Windows
Do you still remember the location of the host file in windows? C: \ windows \ system32 \ drivers \ etc \ hosts
/Etc/host. conf this file is used to set how to parse the Host Name
Order sets the available methods and sequence for host name resolution. The available methods include hosts (using the/etc/hosts file for resolution) and bind (using the DNS server for resolution ), NIS (using Network Information Service NIS resolution)
Multi sets whether to return multiple IP addresses of the host from the/etc/hosts file. The value is on/off.
/Etc/resolv. conf this file is the client configuration file of DNS domain name service
The/etc/Services Service port and its transmission protocol configuration file.
Ifconfig eth0 192.168.1.3 netmask 255.255.255.0.0 up this command uses the ifconfig command to directly modify the network configuration and take effect immediately.
Ifconfig eth0: 0192.168.1.4 netmask 255.255.255.0.0 up this command uses the ifconfig command to bind the NIC to the second IP address.
Ifconfig eth0: 1Down this command deletes the third virtual IP Address
Service Network restart this command restarts the NIC. After the configuration file is modified, the setting does not take effect immediately. You can restart the NIC to make the setting take effect.
/Etc/rc. d/rc. Local this file is equivalent to Windows startup.
The output fields in the ifconfig command are described as follows:
IFUP starts the network
Disable network in ifdown Mode
Hostname: displays the current host name
Route command
Diagnostic Tools
Ping Command to test network connection through ICMP protocol
The traceroute command can trace the path to a specific destination.
For example, traceroute www.google.com
Curl command to view site details
Run the netstat command to check which ports are enabled.
Generally, netstat-a-n is used, where a indicates that all are displayed, and N indicates that IP addresses and ports are displayed in numbers rather than names.