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

Detailed explanation of CentOS 8 VMware virtual machine setting static ip network card to surf the Internet

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Step one:

In VMware, click "Edit"-"Virtual Network Editor". As shown in the following figure, I chose NAT mode: the following VMnet2 is the configuration

The subnet ip is written casually, and the subnet mask is calculated by yourself. If you are not familiar with it, you can configure it just like me.

Default subnet mask for class A: 255.0.0.0

Default subnet mask for class B: 255.255.0.0

Default subnet mask for class C: 255.255.255.0

In order to use static IP: use the local DHCP service to assign the IP address to the virtual machine (default is selected)

Click NAT Settings

Remember the gateway ip as shown below, and finally configure the virtual machine ip file to use.

Application

Step 2: enter the virtual machine

Log in to centos8 with root permissions and edit the file vi / etc/sysconfig/network-scripts/ifcfg-ens33. The results are as follows:

TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=static # Note: set to static static DEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=aa18fb34-fea8-4fff-83a4-1ebed631beffDEVICE=ens33ONBOOT=yes # here change it to yes if it is no Indicates that the network card device automatically starts GATEWAY=192.168.0.2 # the gateway address here is the gateway address IPADDR=192.168.0.150 # obtained in the previous step, and then write the NETMASK=255.255.255.0 # subnet mask DNS1=8.8.8.8 # DNS1 in the range of the gateway. Google is used here, and DNS2=223.6.6.6 # DNS2 is used by Ali.

Then: wq save exit

Step 3: refresh the network card configuration

CentOS 8 uses: nmcli c reload

CentOS7 use / etc/init.d/network restart

Summary

The above is the CentOS 8 VMware virtual machine introduced by the editor to set up a static ip network card to surf the Internet. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!

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