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

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

first step:

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


insert image description here

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
Class B default subnet mask: 255.255.0.0
Class C default subnet mask: 255.255.255.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


Alt

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!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Graphic tutorial on installing CentOS7 on VMware 15.5
  • VMware installation of Centos8 system tutorial diagram (Chinese graphical mode)
  • VMware virtual machine installation CentOS 8 (1905) system tutorial diagram
  • vmware workstation12 installation centos prompts VMware Player and Device/Credential Guard are incompatible, reasons and solutions
  • Graphical tutorial on installing CentOS 7.3 on VMWare
  • VMware installation of CentOS virtual machine and configuration network graphic tutorial

<<:  Vue implements carousel animation

>>:  How to view and modify the time zone in MySQL

Recommend

Solution to the same IP after cloning Ubuntu 18 virtual machine

Preface I recently used a virtual machine to inst...

Docker Nginx container production and deployment implementation method

Quick Start 1. Find the nginx image on Docker Hub...

On good design

<br />For every ten thousand people who answ...

JavaScript setinterval delay one second solution

When using setinterval, it is found that it will ...

Let you understand how HTML and resources are loaded

All content in this blog is licensed under Creati...

Steps to install MySQL 5.7 in binary mode and optimize the system under Linux

This article mainly introduces the installation/st...

Take you to understand MySQL character set settings in 5 minutes

Table of contents 1. Content Overview 2. Concepts...

Implementation of Docker private library

Installing and deploying a private Docker Registr...

MySQL 8.0.18 adds users to the database and grants permissions

1. It is preferred to use the root user to log in...

Detailed tutorial on how to create a user in mysql and grant user permissions

Table of contents User Management Create a new us...

MySQL restores data through binlog

Table of contents mysql log files binlog Binlog l...

VMware vCenter 6.7 installation process (graphic tutorial)

background I originally wanted to download a 6.7 ...

Detailed explanation of javascript knowledge points

Table of contents 1. Basic Introduction to JavaSc...