1. Use of the ifconfig command:
(1) View all NIC basic information:ifconfig
(2) View specific network card information:ifconfig (network card name, such as:eht0)
(3) Stop the network card device service:ifconfig (NIC name, such as:eht0) down
(You cannot see the NIC information by using the ifconfig command after stopping the network card service)
only temporarily stop the network card service through the Ifconfig command, you can restart the network card via local login, or you can
Reboot the operating system to restart the NIC.
(4) Start the network card service:ifconfig (network card name, such as:eht0) up
(5) Change the network card IP address:ifconfig (network card name, such as:eht0 ) New IP Address
Ifconfig (NIC name, such as:eht0) New IP address netmask Subnet Mask
Note: The configuration of the network through the ifconfig is temporary, and the configuration fails when the system restarts. If you want to permanently configure,
You can modify the configuration file /etc/sysconfig/network-scripts/ifcfg-eth0and then use the Command service network
Restart to restart the network service for the configuration to take effect.
Note: The IP address of the virtual machine system cannot coincide with the IP address of the local host .
2. Local Host name modification:
(1) View Local host name:hostname
(2) Modify the local host name:hostname new host name
(You need to re-login to see the effect)
Note: The host name modification is only temporary by the host command, and the modification fails when the system restarts. If you want to permanently repair
Change the configuration file /etc/sysconfig/network, and then restart the system by changing the host name.
3. DNS Information modification:
The DNS information is stored in the configuration file /etc/resolv.conf and can be modified by modifying the contents of the file.
Information.
Specify DNS server:nameserver 219.141.136.10(China Telecom)
NameServer 202.106.0.20(China Unicom)
Linux System network Basic configuration