Ubuntu Server Static IP Setup: Net plan & YAML Explained using the terminal
Автор: The Linux Shed
Загружено: 2025-12-20
Просмотров: 10
Learn how to configure a static IP address on Ubuntu Server using Netplan. In this quick and easy terminal-based guide, we walk through editing the YAML configuration file to ensure your server maintains a consistent identity on your network.
What you’ll learn:
Where to find Netplan configuration files.
How to disable DHCP and set a manual IP.
The "Golden Rule" of YAML (Spaces vs. Tabs).
How to safely apply changes without getting locked out.
📋 Sample Netplan Configuration
Copy and paste the template below into your configuration file (usually found in /etc/netplan/).
⚠️ IMPORTANT: YAML files are indentation-sensitive. Do not use tabs. Use two spaces for each indentation level.
YAML
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses:
192.168.1.50/24
routes:
to: default
via: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
🛠️ Useful Commands:
ip link — Find your interface name (e.g., enp0s3 or eth0).
sudo netplan try — Test your config (highly recommended!).
sudo netplan apply — Permanently apply the changes.
If this video helped you get your server online, please give it a Like and Subscribe for more Linux and SysAdmin tutorials! 🚀
#UbuntuServer #Netplan #StaticIP #LinuxTutorial #Networking #SysAdmin
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: