CentOS 7.0VI command and fixed intranet IP

Source: Internet
Author: User

A direct example of the use of the VI command saves forgetting

To edit the network card configuration file

Vi/etc/sysconfig/network-scripts/ifcfg-enp2s0

I don't know that NIC IP addr command

Ps:centos 7.0 Minimized installation says that you don't have a network connection turned on, and you don't have a switch on the network connection. It's definitely not the one that's installed. Dynamically assign IP when configured to open

Press the I key to enter edit mode the Insert typeface appears at the bottom
Direct keyboard key Move Delete Modify
Change ESC to command mode.

Post the modified file here

[Email protected] ~]# vi/etc/sysconfig/network-scripts/ifcfg-enp2s0hwaddr= "6c:62:6d:73:e6:4a" type= "Ethernet" bootproto= "Static"//static ipdefroute= "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= "Enp2s0" Uuid= "Cf6c2da6-7944-4040-9f25-67c4eaf2acae" onboot= "yes"//auto-enable network connection ipaddr0=192.168.1.103//fixed IP add prefixo0=24// Subnet Mask gateway0=192.168.1.1//Gateway dns1=8.8.8.8dns2=8.8.4.4


: wq! Force Save Exit VI

Restart Network

Service Network restart

or reboot directly

Shutdown-r now

View after restarting login

IP addr

View Extranet IP

Curl Ifconfig.me

CentOS 7.0VI command and fixed intranet IP

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.