CENTOS 7 How to modify the IP address for static!

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.