• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Linux
    • Bash Scripting
      • Bash Scripting Lessons
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Tools
No Result
View All Result
  • Home
  • Linux
    • Bash Scripting
      • Bash Scripting Lessons
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Tools
No Result
View All Result
DefenceDev
No Result
View All Result
Home Linux Commands&Tips

Linux Networking: netplan Network Configuration on Ubuntu

by neo
September 3, 2026
in Commands&Tips
0
Linux Networking: netplan Network Configuration on Ubuntu

Linux Networking: netplan Network Configuration on Ubuntu

0
SHARES
141
VIEWS
Share on FacebookShare on LinkedIn
Table of Contents
  • Linux Networking: netplan Network Configuration on Ubuntu
  • Ubuntu Netplan Configuration
    • Static IP Configuration on Ubuntu
    • DHCP Configuration on Ubuntu
    • VLAN Configuration on Ubuntu
  • Test Ubuntu netplan Configuration
  • Apply Ubuntu netplan Configuration

Linux Networking: netplan Network Configuration on Ubuntu

In this post, Linux Networking: netplan Network Configuration on Ubuntu, we’ll cover the essentials of configuring network settings using netplan, Ubuntu’s default network management tool. Whether you need to configure a static IP, set up DHCP for automatic IP assignment, or configure VLANs for network segmentation, netplan offers a simple yet powerful framework that can handle all these tasks efficiently. You’ll learn how to apply these configurations to suit your specific network needs, ensuring a streamlined and efficient setup. Let’s dive into the key concepts of network configuration on Ubuntu using netplan and explore how to implement these settings effectively.

Ubuntu Netplan Configuration

Managing network configurations is a fundamental task for Linux administrators. I choose Netplan, introduced in Ubuntu 17.10. With Netplan network configuration has become more streamlined and intuitive. Netplan leverages YAML files to define and manage network settings, offering a unified approach to configure both NetworkManager and systemd-networkd backends.

Whether you’re setting up a home network or managing complex enterprise configurations, Netplan simplifies tasks like assigning IP addresses, configuring DNS servers, and setting up VLANs. In this guide, we’ll explore how to harness the power of Netplan to manage your network configurations efficiently.

Static IP Configuration on Ubuntu

Netplan configuration file is located under the folder: /etc/netplan

In my case, configuration is stored in the file /etc/netplan/50-cloud-init.yaml. To open and edit it will use nano editor:

sudo nano/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens160:
            dhcp4: false
            addresses: [192.168.10.40/24]
            gateway4: 192.168.10.253
            nameservers:
                addresses: [192.168.10.201, 192.168.10.253]

    version: 2

Example of Netplan Static IP Configuration:

Netplan Example of Static IP Configuration
Netplan Example of Static IP Configuration

DHCP Configuration on Ubuntu

Click on this link to see the details about DHCP configuration.

VLAN Configuration on Ubuntu

Click on this link to see the details about VLAN configuration.

Test Ubuntu netplan Configuration

The netplan try -timeout 120 command lets you test network settings temporarily. It applies changes for 120 seconds, allowing you to verify if the new configuration works. If something goes wrong, the configuration automatically reverts after the timeout, preventing network disruptions.

# Try the configuration before applying
netplan try -timeout 120 

Apply Ubuntu netplan Configuration

After verifying the changes, use netplan apply to make the configuration permanent. This command saves the modifications, applying the updated settings to your system’s network permanently.

# Apply network configuration
netplan apply

More examples of netplan configuration on Ubuntu:

  • Linux Networking: Add VLAN on Ubuntu with netplan
  • Linux Networking: netplan DHCP Configuration on Ubuntu
Tags: linuxnetworkingubuntu
Previous Post

How to Fix Common Nextcloud PHP Issues on Ubuntu 22.04

Next Post

Nextcloud OCC Command Guide: Maintenance and Practical Use Cases

neo

Related Posts

10+ Useful Linux find Command Examples You Should Know
Commands&Tips

10+ Useful Linux find Command Examples You Should Know

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)
Commands&Tips

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)

Timeshift on Linux: How to Create and Restore System Snapshots
Commands&Tips

Timeshift on Linux: How to Create and Restore System Snapshots

Remote Desktop Access to Ubuntu 24.04 from Windows
Commands&Tips

Remote Desktop Access to Ubuntu 24.04 from Windows

Fix "blk_update_request: critical target error" on Ubuntu Server (dev sdb, DISCARD Operation)
Commands&Tips

Fix “blk_update_request: critical target error” on Ubuntu Server with SSD (dev sdb, DISCARD Operation)

Passwordless SSH Login on Ubuntu: Secure Server Access
Commands&Tips

Passwordless SSH Login on Ubuntu: Secure Server Access

Next Post
Nextcloud: Maintenance with OCC Command with Practical Examples

Nextcloud OCC Command Guide: Maintenance and Practical Use Cases

Recommended

Fortinet FortiGate: Change Default Administration HTTPS and HTTP Port

FortiGate: Port Forwarding for HTTPS NAT Configuration

MikroTik: Bridge Interface with Multiple Ports

MikroTik: Bridge Interface with Multiple Ports

Briefly unavailable for scheduled maintenance. Check back in a minute.

WordPress Stuck in Maintenance Mode After Plugin Update

Promox Telegram Alert Example

Configure Telegram Notifications in Proxmox VE Using Webhooks

Fix Proxmox VM Snapshot “Out of Space” Errors

Fix Proxmox VM Snapshot “Out of Space” Errors

Categories

  • Linux
    • Bash Scripting
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Web Tools

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

Briefly unavailable for scheduled maintenance. Check back in a minute.

WordPress Stuck in Maintenance Mode After Plugin Update

Promox Telegram Alert Example

Configure Telegram Notifications in Proxmox VE Using Webhooks

  • Site Map
  • Privacy Policy
  • Facebook Page
  • GitHub
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Linux
    • Bash Scripting
      • Bash Scripting Lessons
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Tools

© 2025 defencedev.com - All rights reserved.