(1) Enter the NIC configuration directory
[Email protected] ~ #]cd/etc/sysconfig/network-scripts/
Comments:
CD indicates which level of directory to enter
CD behind and directory to add a space, otherwise will be reported no such file or directory (files and directories cannot be found)
(2) View the configuration file under the NIC directory
[[email protected] network-scripts]# ls
Comments:
LS means to view the file under the directory;
Find a file called Ifcfg-eth0, where you can configure IP, subnet mask, gateway;
(3) Edit the network card configuration file
[Email protected] network-scripts]# VI ifcfg-eth0
Comments:
VI means to edit this file
Edit Ifcfg-eth0, modify the following places
Type=etherent (type of NIC is Ethernet card)
Onboot=yes (whether to start the network card)
Bootproto=static (How to obtain an IP address)
ipaddr=192.168.0.103 (set IP address)
netmask=255.255.255.0 (set subnet mask)
gatway=192.168.0.1 (set Gateway)
Comments:
The static IP address is set here, and if a DHCP server assigns the address of the Linux host, you can
Bootproto=dhcp,ip address, subnet mask, gateways do not need to be manually configured, automatically get it.
(4) Restart the network card to make the configuration file effective
Service Network restart
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/9E/5E/wKioL1mRKJbikyHuAAArtRI9WzY591.jpg-wh_500x0-wm_ 3-wmp_4-s_1669277228.jpg "title=" qq20170814123533.jpg "alt=" Wkiol1mrkjbikyhuaaartri9wzy591.jpg-wh_50 "/>
Comments:
All four states must be OK, otherwise the settings are problematic and need to be reset
(5) View configuration results
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/9E/5F/wKioL1mRKcbyjXQ6AAB1oOThWvM785.jpg-wh_500x0-wm_ 3-wmp_4-s_909091879.jpg "title=" qq20170814124043.jpg "alt=" Wkiol1mrkcbyjxq6aab1oothwvm785.jpg-wh_50 "/>
Comments:
View configuration results with IP Addr List
Configuration of Linux networks, DNS settings, management of Linux hosts through Remote Tools