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 add an extra IP address to CentOS

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how to add an extra IP address to CentOS". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to add an extra IP address to CentOS".

Here are the steps to add IP:

Step 1: go to the directory where the network settings file is located

Cd / etc/sysconfig/network-scripts/

In this directory, find ifcfg-??? A file in format. In my system, this file is ifcfg-eth0.

Step 2: open the network settings file.

Nano ifcfg-eth0

When you open it, you will see the following:

DEVICE=ens33 BOOTPROTO=static ONBOOT=yes IPADDR=123.123.123.123 NETMASK=255.255.255.0 GATEWAY=123.123.123.1 DNS1=8.8.8.8 DNS2=8.8.4.4

I'm going to add an extra IP,123.123.123.124 now. The modified ifcfg-eth0 is as follows:

DEVICE=ens33 BOOTPROTO=static ONBOOT=yes IPADDR=123.123.123.123 IPADDR1=123.123.123.124 NETMASK=255.255.255.0 GATEWAY=123.123.123.1 DNS1=8.8.8.8 DNS2=8.8.4.4

Notice, it's just a different line above me. Add more line IPADDR1=123.123.123.124, if you want to add another IP 123.123.123.125, add IPADDR2=123.123.123.125, and so on.

Save the file. You can restart the machine or run systemctl restart network to reset the network.

Done.

Thank you for your reading, the above is the content of "how to add an additional IP address for CentOS". After the study of this article, I believe you have a deeper understanding of how to add an additional IP address to CentOS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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