Focus on cloud service provider activities
Notes on website operation and maintenance

Record the method of setting static IP address in ubuntu

Sometimes we need to replace the server with a new IP address. When the server purchases a new IP address, it is not directly applied to the server. Manual configuration is required. Or we can configure multiple static IP addresses on the selected server, but not all of them are directly configured in the server, which also needs to be manually configured.

Here, Lao Zuo records that the static IP address is set in ubuntu.

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

Profile:

 # This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no addresses: [192.168.1.2/24] gateway4: 192.168.1.1 nameservers: addresses: [114.114.114.114]

Insert content as prompted.

 sudo netplan apply

Start after saving.

 networkctl status

View network status.

We can finally ping the intranet and extranet.

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Record the method of setting static IP address in ubuntu


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge