Complete steps to configure a static IP address for a Linux virtual machine

Complete steps to configure a static IP address for a Linux virtual machine

Preface

In many cases, we will use virtual machines. For example, some tests are not detected. Practice can be done on virtual machines without worrying about breaking anything. This article mainly introduces the configuration of static IP addresses for Linux virtual machines. Let's take a look at the detailed introduction.

Here are the steps:

1. Command line call

vi /etc/sysconfig/network-scripts/ifcfg-eth0

command line.png

2. The red content above needs to be modified. You need to enter i to enter the edit mode

ipconfig corresponds to the ip address you need to generate
DNS1 and GATEWAY correspond to their own gateway addresses
GATEWAY corresponding subnet mask

Where to get the address.png

Then esc to exit the edit mode and enter: wq to save

3. Verify whether the connection to the external network is successful


Verify external network.png

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM.

You may also be interested in:
  • Tutorial on how to modify the IP address of a Linux virtual machine, check the gateway, and configure the network environment
  • How to configure static IP in Linux
  • Detailed steps for manually configuring the IP address in Linux

<<:  MySQL 5.7.18 release installation guide (including bin file version)

>>:  Implementation of JavaScript downloading linked images and uploading them

Recommend

iframe src assignment problem (server side)

I encountered this problem today. I reassigned the...

Application nesting of HTML ul unordered tables

Application nesting of unordered lists Copy code T...

Example of converting JS one-dimensional array into three-dimensional array

Today I saw a friend asking a question in the Q&a...

Tutorial on building a zookeeper server on Windows

Installation & Configuration The official web...

A small collection of html Meta tags

<Head>……</head> indicates the file he...

VMWare15 installs Mac OS system (graphic tutorial)

Installation Environment WIN10 VMware Workstation...

18 sets of exquisite Apple-style free icon materials to share

Apple Mug Icons and Extras HD StorageBox – add on...

Simple example of adding and removing HTML nodes

<br />Simple example of adding and removing ...

MySQL efficient query left join and group by (plus index)

mysql efficient query MySQL sacrifices group by t...

MySQL table type storage engine selection

Table of contents 1. View the storage engine of t...

Detailed Analysis of Explain Execution Plan in MySQL

Preface How to write efficient SQL statements is ...

How to add indexes to MySQL

Here is a brief introduction to indexes: The purp...

A brief discussion on JS regular RegExp object

Table of contents 1. RegExp object 2. Grammar 2.1...

How to set static IP in CentOS7 on VirtualBox6 and what to note

Install CentOS 7 after installing VirtualBox. I w...