Skip to content

Instantly share code, notes, and snippets.

@vinhjaxt
Created June 27, 2022 07:27
Show Gist options
  • Save vinhjaxt/8a82d2bcffa034831febd08504dbe80a to your computer and use it in GitHub Desktop.
Save vinhjaxt/8a82d2bcffa034831febd08504dbe80a to your computer and use it in GitHub Desktop.
Netplan static ip
sudo nano /etc/netplan/00-installer-config.yaml
# https://www.aelius.com/njh/subnet_sheet.html
# 255.255.255.224 = /27
# xxx.xxx.xxx.33/27
network:
ethernets:
ens160:
dhcp4: false
dhcp6: false
addresses:
- xxx.xxx.xxx.50/27
routes:
- to: default
via: xxx.xxx.xxx.33
nameservers:
addresses:
- 1.1.1.1
- 8.8.8.8
version: 2
sudo netplan apply
sudo hostnamectl set-hostname xxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment