How to configure ip address in centos system

王林
Release: 2020-03-21 17:26:28
Original
15785 people have browsed it

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/
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!