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 manually by linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how linux manually configures ip addresses, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

1. Enter the network card configuration directory first.

2. Edit the configuration file of ifcfg-ens33 NIC

vim ifcfg-ens33 reads as follows:

The amendments read as follows:

Exit save, use ip add to view your ip address, ip route to view the gateway, and then continue to edit the configuration file of ifcfg-ens33 network card

Exit and save (wq)

The analysis is as follows:

BOOTPROTO=none #Set the static configuration of the network card ip address none Static configuration (manually specify ip) dhcp indicates that the virtual machine dynamically obtains the ip address

NAME=ens33 #The device name of the NIC is ens33

DEVICE=ens33 #The device name of the NIC is ens33

ONBOOT=yes #Automatically activate network card when booting--》Automatically activate network card

IPADDR=192.168.0.178 #ip address

PREFIX=24 #subnet mask

#NETMASK=255.255.255.0 #subnet mask

GATEWAY=192.168.0.1 #Gateway

DNS1=114.114.114.114 #Specify preferred DNS server

3. Refresh network services

---》centos7:

service network restart

---》centos8:

Use ifens up 33

How to check Centos version:

Refresh the network service and check the ip address and gateway again

4. Test whether ping Baidu can surf the Internet

Ctrl+C Forcefully terminates ping

Thank you for reading this article carefully. I hope that the article "How to manually configure ip address in linux" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

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

Development

Wechat

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

12
Report