How to set ip address in centos7

巴扎黑
Release: 2017-06-23 14:19:08
Original
2692 people have browsed it

vi /etc/sysconfig/network-scripts/ifcfg-enpos3
In the file, change
BOOTPROTO to static,
At the same time add
IPADDR=192.168.1.150
NETMASK= 255.255.255.0
GATEWAY=192.168.1.1
If ONBOOT=no, change it to yes.
When modifying, make sure the IP address and gateway are in the same network segment.
Restart the service, service network restart

Set the DNS server,
vi /etc/resolv.conf
Add nameserver 8.8.8.8

ip addr to view the IP address Whether the setting is successful

Then execute the command and ping www.baidu.com

If the ping succeeds, the setting is successful.

END

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!