Beginner Linux, encountered a problem, is to configure the network card IP address, the collection of relevant data configuration success, for the convenience of memory, is now recorded in this.
First use the CD command to jump to the appropriate configuration file, the configuration command is cd/etc/sysconfig/network-scripts/
[Email protected] ~]# cd/etc/sysconfig/network-scripts/
If you don't know the file, you can use the LS command to view
[[email protected] network-scripts]# ls ifcfg-eno16777736 ifdown-ib ifdown-ppp ifdown-tunnel ifup-ib ifup-plusb ifup-Team network-functionsifcfg-lo ifdown-ippp ifdown-routes ifup ifup-ippp ifup-post ifup-TeamPort network-functions-ipv6ifdown ifdown-ipv6 ifdown-sit ifup-aliases ifup-ipv6 ifup-ppp ifup-tunnelifdown-bnep ifdown-isdn ifdown-team ifup-bnep ifup-isdn ifup-routes ifup-wirelessifdown-eth Ifdown-post ifdown-teamport ifup-eth ifup-plip ifup-sit init.ipv6-global
The first ifcfg-enoxxxxxxxx (here X is the number), is the configuration file, you can use the VI editor to go in, press I into the edit mode, to modify the file.
[Email protected] network-scripts]# vi ifcfg-eno16777736 type= "Ethernet" bootproto= "static" defroute= "Yes" peerdns= " Yes "peerroutes=" yes "ipv4_failure_fatal=" no "ipv6init=" yes "ipv6_autoconf=" yes "ipv6_defroute=" yes "ipv6_peerdns=" Yes "ipv6_peerroutes=" yes "ipv6_failure_fatal=" no "name=" eno16777736 "uuid=" 718AFCBF-931E-4C0C-A23F-BFC3C13023C2 " Device= "eno16777736" onboot= "yes" ipaddr0= "xxx.xxx.xxx.xxx" netmask= "xxx.xxx.xxx.xxx" gateway= "xxx.xxx.xxx.xxx"
After editing is complete, enter: wq! save and exit, then enter
/etc/init.d/network restart
The static IP configuration is saved successfully and takes effect.
This article is from the "Nap Breeze" blog, please be sure to keep this source http://xiaoqiqingfeng.blog.51cto.com/3720264/1828145
CENTOS 7 How to modify the IP address for static!