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

Linkerd 2.10 (Step by Step)—Ingress Traffic

[[406692]] The Linkerd 2.10 Chinese manual is bei...

10 common mistakes in integrated wiring, see how many you have made

Integrated wiring is a modular and highly flexibl...

CDN price war ends, with Wangsu, Alibaba and Tencent taking over the market

[[239400]] Image source: Visual China The CDN pri...

Transition to 5G drives demand for fiber

A new report released by IndexBox: "World – ...

The role of 5G in the digital economy and its impact on the industry

5G networks are being hailed as the next-generati...

WOT Huang Shuquan: Edge computing helps industrial intelligent manufacturing

[51CTO.com original article] On May 18-19, 2018, ...