How to modify the IP address in Centos7 system
Jun 03, 2020 pm 03:37 PMHow to modify the IP address of Centos7 system?
1. Enter the network configuration file directory
First, make sure to operate under the root user. Enter the network configuration file network-scripts directory.
2. Find the configuration file we need to modify
Use the ls command to list the files in the directory. The file "ifcfg-ens33" (red box) is the network configuration file we need to modify.
3. Modify the configuration file
Use the vim command (vi command is also available) to configure the file, we need to modify it BOOTPROTO="static" means changing dhcp to static, modifying ONBOOT="yes" means setting the network card to be enabled at boot, and add
IPADDR=192.168.0.230 #静态IP GATEWAY=192.168.0.1 #默认网关 NETMASK=255.255.255.0 #子网掩码 DNS1=192.168.0.1 #DNS 配置 DNS2=8.8.8.8 #谷歌地址 红框为修改内容,紫框为需要添加的内容。 ESC+WQ,保存退出!
below the text. ##4. Restart the network service
Use the service network restart command to restart the network service. (The red box is the command to restart the network service, and the blue box is the status of restarting the network service)5. Check the effect of our changes
Since it is Centos7 now, we use the new command. We enter ip addr to view. (The red box is the view command, the blue box is the network card status)The above is the detailed content of How to modify the IP address in Centos7 system. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CentOS7 various version image download addresses and version descriptions (including Everything version)

Steps to enter CentOS 7 emergency repair mode

How to install Mysql in CentOS7 and set it to start automatically at boot

How to install mbstring extension under CENTOS7?

How to access and clean junk files in /tmp directory in CentOS 7?

How to set password rules in centos7? How to set password rules in centos7

How to modify and set the default shortcut keys of CentOS7?

Disable IPv6 for CentOS 7, use only IPv4
