Home > Operation and Maintenance > CentOS > How to set ip address in centos7

How to set ip address in centos7

王林
Release: 2020-05-23 15:04:45
Original
4246 people have browsed it

How to set ip address in centos7

First open the ifcfg-eth0 file

# vim /etc/sysconfig/network-scripts/ifcfg-eth0
Copy after login

Then modify the following content

BOOTPROTO="static" #dhcp改为static   
ONBOOT="yes" #开机启用本配置  
IPADDR=192.168.7.106 #静态IP  
GATEWAY=192.168.7.1 #默认网关  
NETMASK=255.255.255.0 #子网掩码  
DNS1=192.168.7.1 #DNS 配置
Copy after login

Finally restart the network service

# service network restart
Copy after login

Recommended tutorial: centos tutorial

The above is the detailed content of How to set 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