Detailed steps for manually configuring the IP address in Linux

Detailed steps for manually configuring the IP address in Linux

1. Enter the network card configuration directory first

2. Edit the configuration file of ifcfg-ens33 network card

vim ifcfg-ens33 is as follows:

After modification, it is as follows:

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

Exit and save (wq)

The analysis is as follows:

BOOTPROTO=none #Set the network card to statically configure the IP address none static configuration (manually specify the IP address) dhcp means that the virtual machine dynamically obtains the IP address
NAME=ens33 #The device name of the network card is ens33
DEVICE=ens33 #The device name of the network card is ens33
ONBOOT=yes #Automatically enable the network card when booting up --》Automatically activate the 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 the preferred DNS server

3. Refresh network services

---》centos7:
service network restart (refresh network service)
---》centos8:
Using ifup ens33

How to check the version of centos:

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

4. Test whether ping Baidu can access the Internet

ctrl+c to force terminate ping

This is the end of this article about the detailed steps of manually configuring the IP address in Linux. For more relevant content about configuring the IP address in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Example method of viewing IP in Linux
  • Solution to the IP address not being displayed under Linux

<<:  Example of how to set div background transparent

>>:  Some useful meta setting methods (must read)

Recommend

ReactJs Basics Tutorial - Essential Edition

Table of contents 1. Introduction to ReactJS 2. U...

Vue button permission control introduction

Table of contents 1. Steps 1. Define buttom permi...

Detailed explanation of the correct way to install opencv on ubuntu

This article describes how to install opencv with...

How to solve the error "ERROR 1045 (28000)" when logging in to MySQL

Today, I logged into the server and prepared to m...

Complete step record of vue encapsulation TabBar component

Table of contents Implementation ideas: Step 1: C...

jQuery implements the function of adding and deleting employee information

This article shares the specific code of jQuery t...

Detailed tutorial on deploying SpringBoot + Vue project to Linux server

Preface Let me share with you how I deployed a Sp...

MySQL high availability solution MMM (MySQL multi-master replication manager)

1. Introduction to MMM: MMM stands for Multi-Mast...

Detailed explanation of the principle of creating tomcat in Eclipse

When creating a tomcat server on a local eclipse,...

Analysis of MySQL duplicate index and redundant index examples

This article uses examples to describe MySQL dupl...

8 powerful techniques for HTML web page creation

<br />Although there are many web page creat...

Steps to enable TLS in Docker for secure configuration

Preface I had previously enabled Docker's 237...