Ubuntu 18.04 changes the IP address

Ubuntu 18.04 changes the IP address

My memory is getting worse and worse, just recording it. I have done it before, but forgot it after a while. In addition, I use CentOS most often, but many friends prefer Ubuntu or Debian. Today I encountered a cloud host with Ubuntu 18.04 system that changed its IP. The normal change of /etc/network/interfaces did not work. I record it here to avoid the trouble of going to Bing every time.

Ubuntu 18.04 uses Netplan to configure IP addresses, so you need to modify the /etc/netplan/* file.

The above picture shows the modification of /etc/network/interfaces. After the completion of the restart, the new IP is not accessible. Use the ifconfig command to check that it is still the old IP. Next, modify the yaml file under /etc/netplan/. The file name may be different.

Correct the addresses and gateway in the file, save it after completion, and then use sudo netplan apply to apply the configuration.

<<:  RackNerd "Memorial Day" Sale: Los Angeles VPS from $14.99 per year

>>:  SmartHost: AMD Ryzen series 35% off, starting at $2.57/month, Los Angeles/New Jersey/Las Vegas data centers

Recommend

JuHost: Hong Kong VPS 40% off from $2.99/month, 1GB/20GB SSD/1TB@100Mbps

JuHost was registered in Hong Kong in early 2023,...

Programmers learn network hubs and switches

From the perspective of network implementation, n...

A brief comparison of two SR-TE implementation methods

1. Brief description of background technology Reg...

Don't know how to learn the protocol? Click it!

Once you enter the communications industry, you w...

CAICT answers hot issues on “number portability” service

On November 27, 2019, China Telecom, China Mobile...

These 8 IT infrastructure terms IT practitioners should know

IT infrastructure is changing rapidly. Specifical...

China Unicom makes first HD call on 5G SA network

2019 is the first year of 5G commercial deploymen...

Where is the domestic Wi-Fi 6 chip heading?

What was the past life like, what is the present ...