Home >Operation and Maintenance >CentOS >How to set a static ip address in centos

How to set a static ip address in centos

王林
王林Original
2020-03-23 15:46:479612browse

How to set a static ip address in centos

Environment:

Centos7.4_x64

The setting method is as follows:

Enter the network card configuration directory

cd /etc/sysconfig/network-scripts/

ifconfig View the network card information and obtain the name of the network card ens32

How to set a static ip address in centos

(Recommended tutorial: centos usage tutorial)

Find the configuration The file ifcfg-ens32

How to set a static ip address in centos

is modified as follows:

vim ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.1.149
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
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=ens32
UUID=d16fe359-9256-4414-a557-19d751b4fc72
DEVICE=ens32
ONBOOT=yes

Restart the network card

systemctl restart network

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to set a static ip address in centos. 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