How to set a static ip address in centos

王林
Release: 2020-03-23 15:46:47
Original
9562 people have browsed it

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

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

Restart the network card

systemctl restart network
Copy after login

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template