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

Using nginx + fastcgi to implement image recognition server

background A specific device is used to perform i...

JavaScript ES new feature block scope

Table of contents 1. What is block scope? 2. Why ...

How to remove the dividing line of a web page table

<br />How to remove the dividing lines of a ...

Example code for setting hot links and coordinate values ​​for web images

Sometimes you need to set several areas on a pict...

Summary of basic knowledge points of MySql database

Table of contents Basic database operations 2) Vi...

Super detailed MySQL usage specification sharing

Recently, there have been many database-related o...

Five solutions to cross-browser problems (summary)

Brief review: Browser compatibility issues are of...

js implements custom drop-down box

This article example shares the specific code of ...

Summary of methods for finding and deleting duplicate data in MySQL tables

Sometimes we save a lot of duplicate data in the ...

MySQL installation and configuration method graphic tutorial (CentOS7)

1. System environment [root@localhost home]# cat ...

Docker link realizes container interconnection

Table of contents 1.1. Network access between con...

5 super useful open source Docker tools highly recommended

Introduction The Docker community has created man...

Detailed explanation of the construction and use of docker private warehouse

1. Download the repository image docker pull regi...