How to set a static IP address in centos7

王林
Release: 2020-05-19 16:31:11
Original
6214 people have browsed it

How to set a static IP address in centos7

1. Open the network card configuration file

vim /etc/sysconfig/network-scripts/ifcfg-ens32
Copy after login

2. Modify the following configuration options

(1) bootproto=static

(2)onboot=yes

(3) Add a few lines at the end, IP address, subnet mask, gateway, dns server

IPADDR=192.168.1.160
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=119.29.29.29
DNS2=8.8.8.8
Copy after login

3. Restart the network service

[root@mini ~]# systemctl restart network
Copy after login

Recommended tutorial: centos tutorial

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