first step: In VMware, click "Edit" - "Virtual Network Editor". As shown in the figure below, I chose NAT mode: The following VMnet2 is configured You can write any subnet IP and calculate the subnet mask yourself. If you are not familiar with it, just configure it the same as mine. Class A default subnet mask: 255.0.0.0 To use a static IP, uncheck Use local DHCP service to assign IP addresses to virtual machines (this is selected by default). Click NAT Settings Remember the gateway IP as shown below, and finally configure the virtual machine IP file application Step 2: Enter the virtual machine Log in to centos8 with root privileges and edit the file vi /etc/sysconfig/network-scripts/ifcfg-ens33. The effect is as follows: TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static #Note that it is set to static static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=aa18fb34-fea8-4fff-83a4-1ebed631beff DEVICE=ens33 ONBOOT=yes #If it is no, change it to yes, indicating that the network card device automatically starts GATEWAY=192.168.0.2 #The gateway address here is the gateway address obtained in the previous step IPADDR=192.168.0.150 #Write anything within the gateway range NETMASK=255.255.255.0 #Subnet mask DNS1=8.8.8.8 #DNS1 here uses Google, DNS2=223.6.6.6 #DNS2 uses Alibaba Then: wq save and exit Step 3: Refresh the network card configuration CentOS 8 use: nmcli c reload CentOS7 uses /etc/init.d/network restart Summarize The above is what I introduced to you about setting up a static IP network card for the CentOS 8 VMware virtual machine to access the Internet. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Vue implements carousel animation
>>: How to view and modify the time zone in MySQL
Preface I recently used a virtual machine to inst...
Quick Start 1. Find the nginx image on Docker Hub...
<br />For every ten thousand people who answ...
When using setinterval, it is found that it will ...
<p><b>This is bold font</b></...
All content in this blog is licensed under Creati...
Recently I need to change the version of MySQL da...
This article mainly introduces the installation/st...
Table of contents 1. Content Overview 2. Concepts...
Installing and deploying a private Docker Registr...
1. It is preferred to use the root user to log in...
Table of contents User Management Create a new us...
Table of contents mysql log files binlog Binlog l...
background I originally wanted to download a 6.7 ...
Table of contents 1. Basic Introduction to JavaSc...