Configuring Network on Ubuntu Server with Netplan
1. Open a Terminal:
- Use your preferred terminal emulator.
2. Create a Netplan Configuration File:
- Choose a name like
01-netcfg.yaml
sudo nano /etc/netplan/01-netcfg.yaml
3. Write Netplan Configuration:
Use YAML syntax to define network settings.
Example for DHCP on
eth0
:
network:
version: 2
renderer: networkd # or "NetworkManager" for desktops
ethernets:
eth0:
dhcp4: true
4. Save and Exit:
5. Apply Configuration:
sudo netplan apply
7. Choosing the Right Backend:
For Ubuntu Server:
Use
networkd
:Lightweight and minimalistic.
Suitable for server environments.
Basic network configuration.
Use
NetworkManager
:Feature-rich and user-friendly.
Suitable for desktop environments on servers.
More advanced network management features.