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

20 excellent foreign web page color matching cases sharing

This article collects 20 excellent web page color ...

jQuery realizes the full function of shopping cart

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

Summary of common problems and solutions in Vue (recommended)

There are some issues that are not limited to Vue...

The whole process record of vue3 recursive component encapsulation

Table of contents Preface 1. Recursive components...

How to create a database in navicat 8 for mysql

When developing a website, you often need to use ...

Five ways to traverse objects in javascript Example code

Table of contents Prepare Five weapons for…in Obj...

MySQL learning record: bloody incident caused by KEY partition

Demand background Part of the data in the busines...

Detailed explanation of Docker usage under CentOS8

1. Installation of Docker under CentOS8 curl http...

Skin change solution based on Vue combined with ElementUI

Table of contents Written in front Solution 1: Us...

How to write the Nofollow tag and how to use it

The "nofollow" tag was proposed by Goog...

How to design the homepage of Tudou.com

<br />I have been working in front-end for s...

How to remotely log in to the MySql database?

Introduction: Sometimes, in order to develop a pr...

Solution to the problem that the image name is none after Docker load

Recently, I found that after using the docker loa...

Docker file storage path, modify port mapping operation mode

How to get the container startup command The cont...