Got it

Setting network of the CentOS 7

Latest reply: Mar 27, 2022 01:50:01 109 2 0 0 0

In this post, I will introduce how to change the IP address of CentOS 7 to static IP. Please refer to the following operations.

1. Enter the path /etc/sysconfig/network-scripts/, and confirm the name of the network configuration file, in this example, the name of the network configuration file is ifcfg-ens33.

1

2. Edit the file with the vi command. The BOOTPROTO parameter is dhcp, indicating that the current device obtains an IP address through DHCP. If you want to change the name, you can modify the DEVICE parameter, but we generally keep the default.

2

3. Modify BOOTPROTO to static, which means to set the device IP address to static configuration. And add the following parameters after:

IPADDR=192.168.3.10

GATEWAY=192.168.3.1

NETMASK=255.255.255.0

Indicates that the static IP address of the device is set to 192.168.3.10, the mask is 255.255.255.0, and the gateway is 192.168.3.1.

3

4. Save the file and restart the network service process. It should be noted that in CentOS 7, we can use the command systemctl restart network.

4

6. Check the IP address of the device, you can see that the IP address, gateway and mask of ens33 have been set.

5


The post is synchronized to: Author group

Arther
Moderator Author Created Mar 27, 2022 01:50:01

I will share more Linux setups in the future
View more
  • x
  • convention:

stephen.xu
stephen.xu Created Mar 28, 2022 01:25:19 (0) (0)
That is very good.  

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.