Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure static IP under Centos7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Modify the Nic configuration file (back up the file before operation), / etc/sysconfig/network-scripts/ifcfg-enp0s3, as follows:

TYPE=EthernetBOOTPROTO=staticIPADDR=192.168.1.101NETMASK=255.255.255.0NETWORK=192.168.1.0NAME=enp0s3DEVICE=enp0s3ONBOOT=yesDNS1=114.114.114.114

By default, there are other configurations in this file that can be deleted or commented.

Modify the gateway configuration file, / etc/sysconfig/network, as follows:

# Created by anacondaNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=localhost.localdomainGATEWAY=192.168.1.1

Restart the service

Systemctl restart network

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report