Example of how to modify ip address in Ubuntu20.04

**Description: **

Today, when I continued the last office collaboration platform experiment, I found that the virtual machine obtained the IP address through DHCP before, and this time the address obtained by DHCP changed after the virtual machine was turned on, because the website has been configured with a fixed IP address for access , The webpage cannot be accessed, so you need to modify the ip address to the ip address obtained last time. After checking how to modify the ip address in ubuntu, I found that "ubuntu has given up on fixing the IP in /etc/network/interfaces since 17.10 The configuration will not take effect even if the configuration is configured. Instead, it will be changed to netplan. The configuration is written in /etc/netplan/01-netcfg.yaml or a yaml file with a similar name."
Not much to say, just talk about how netplan changes the ip address

0 x00

Use the ifconfig command to view the network card

ifconfig

0 x01 modify yaml configuration file

sudo vi /etc/netplan/00-installer-config.yaml

network:
 ethernets:
 ens33:   #The name of the configured network card
 addresses:[192.168.31.215/24]  #Configured static IP address and mask
 dhcp4: no  #Turn off DHCP, write yes if you need to turn on DHCP
 optional:true
 gateway4:192.168.31.1  #Gateway address
 nameservers:
  addresses:[192.168.31.1,114.114.114.114]  #DNS server address, multiple DNS server addresses need to be separated by English commas
 version:2
 renderer: networkd  #Specify systemd for backend-networkd or Network Manager, if you don’t fill in, systemd will be used by default-workd

Save the file after configuring it according to your needs

0 x02 makes the configured ip address effective

sudo netplan apply

Okay, use the ifconfig command to check whether the configured new ip address has taken effect.

**0 x03 Note: **

1、 The ip address and DNS server address need to be enclosed in [], but the gateway address is not required
2、 Note that a space must be added after each colon
3、 Pay attention to the indentation at the front of each level, at least two spaces more than the previous level

So far, this article on the example of how to modify the ip address of Ubuntu 20.04 is introduced. For more related Ubuntu 20.04 modification of the ip address, please search for the previous articles of ZaLou.Cn or continue to browse the related articles below. Hope you all Support ZaLou.Cn a lot!

Recommended Posts

Example of how to modify ip address in Ubuntu20.04
How to modify time zone and time in ubuntu
Complete steps to configure IP address in Ubuntu 18.04 LTS
How to modify time zone and time in ubuntu system
Example of how to automatically download pictures in python
How to install Helm in Ubuntu
How to use hanlp in ubuntu
How to install mysql in Ubuntu 14.04
How to install mysql in Ubuntu 14.04
How to add swap partition in Ubuntu
How to add users to Sudoers in Ubuntu
How to delete redundant kernels in Ubuntu
How to delete redundant kernels in Ubuntu
How to install ROS Noetic in Ubuntu20.04
How to open root account in Ubuntu20.04
How to modify the hostname on Ubuntu 20.04
How to hide applications in Ubuntu Dash?
How to configure TensorFlow use environment in Ubuntu
ubuntu16.0.4 method to set a fixed IP address
How to set static IP on Ubuntu 18.04 Server
Explain how to set static IP on ubuntu14.04
How to install python in ubuntu server environment
How to use dpkg command in Ubuntu system
How to configure /var/log/messages in Ubuntu system log
Introduction to the use of Hanlp in ubuntu
How to upgrade to Ubuntu 20.04
How to upgrade to Ubuntu 20.04
How to install Hadoop in standalone mode on Ubuntu 18.04
How to turn the language of Ubuntu into Chinese? ?
How to view detailed network routing table in Ubuntu
How to understand the introduction of packages in Python
How to use Putty to log in to ubuntu installed in VirtualBox
How to understand a list of numbers in python
How to install two versions of OpenCV under ubuntu?
How to create a Python virtual environment in Ubuntu 14.04
How to set a fixed IP based on Ubuntu 16.04
Use of Anaconda in Ubuntu
How to upgrade to Ubuntu 16.04 LTS
How to control the ubuntu system in win10 through ssh
How to find the area of a circle in python
How to set or modify the time zone on Ubuntu 20.04
How to install memcache and start it in ubuntu environment
How to set or modify the time zone on Ubuntu 20.04
How to compile and install PHP and Nginx in Ubuntu environment
How to set or modify the time zone in CentOS 8
How to map shared disk to window in linux under Ubuntu
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
Happy installation of Jenkins in ubuntu
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
How to wrap in python code
How to install PHP7.4 in CentOS