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 the IP address for linux

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

Share

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

How to configure the IP address for linux? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Rhel7/centos7 has added a new IP address configuration tool, but the previous version does not, so you can refer to two methods here.

Method 1: nmcli tool (new version of the system is available)

Step 1 check the name of the network card

[root@localhost Desktop] # nmcli connection

As shown in the figure, NAME corresponds to the name of the network card, and DEVICE corresponds to the hardware identification of the network card, and the name can be modified.

The beginning of vir is a virtual network card or virtual device, so here you need to configure the address of the network card that begins with eno.

Step 2 configure the IP address

[root@localhost Desktop] # nmcli connection modify "eno16777736" ipv4.addresses "172.20.10.3 go 24" address and mask [root@localhost Desktop] # nmcli connection modify "eno16777736" ipv4.gateway "172.20.10.1" Gateway [root@localhost Desktop] # nmcli connection modify "eno16777736" ipv4.dns "114.114.114" Domain name Server [root@localhost Desktop] # nmcli connection modify "eno16777736" ipv4.method manual manually instead of DHCP [root@localhost Desktop ] # nmcli connection modify "eno16777736" connection.autoconnect yes boot [root@localhost Desktop] # nmcli connection up "eno16777736" enable the interface

Step 3 check the IP address and test

Method 2: edit the network card configuration file through the vi editor (systems below RHEL7)

[root@localhost Desktop] # vi / etc/sysconfig/network-scripts/ifcfg-eno16777736

Just modify the corresponding information in the following figure

Press I to enter edit mode

Press esc and then enter: wq to save exit

Press esc and then enter: Q! Exit for not saving

After the modification, restart the network service through service network restart

This is the answer to the question about how to configure the IP address for linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about 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