Home  >  Article  >  Operation and Maintenance  >  How to configure ip address in centos system

How to configure ip address in centos system

王林
王林Original
2020-03-21 17:26:2815864browse

How to configure ip address in centos system

The network configuration is saved in the network-scripts folder. We first go to the directory and use the following command:

cd /etc/sysconfig/network-scripts/

How to configure ip address in centos system

(recommended Tutorial: centos usage tutorial)

Then we look at the files in the directory and find an ifcfg-ensxxx network configuration file. If not, create one. Here is ifcfg-ens33

How to configure ip address in centos system

Use vim to open the ifcfg-ens33 file and modify the relevant configuration

How to configure ip address in centos system

After modifying the configuration file, the content is as follows:

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static    #这里改成static代表设置静态ip
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=99c45215-02e8-4e93-baee-8760f25ee478
DEVICE=ens33
ONBOOT=yes  #启动自动运行
ZONE=public
IPADDR=192.168.1.19
NETMASK=255.255.255.0
GETEWAY=192.168.1.1
DNS1=192.168.1.1
PREFIX=24
GATEWAY=192.168.0.1

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to configure ip address in centos system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn