Created
June 27, 2022 07:27
-
-
Save vinhjaxt/8a82d2bcffa034831febd08504dbe80a to your computer and use it in GitHub Desktop.
Netplan static ip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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