• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Linux Tutorials Networking

Linux Networking: netplan Network Configuration on Ubuntu

neo by neo
May 27, 2025
in Networking
0
Linux Networking: netplan Network Configuration on Ubuntu

Linux Networking: netplan Network Configuration on Ubuntu

0
SHARES
45
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Linux Networking: Different 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.

Introduction

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.

Netplan – Static IP Configuration on Ubuntu

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

ADVERTISEMENT

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.

ADVERTISEMENT

Test 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.

ADVERTISEMENT
# Try the configuration before applying
netplan try -timeout 120 

Apply 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

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Nextcloud: Solving Common PHP Issues on Ubuntu 22.04

Next Post

Nextcloud: Maintenance with OCC Command with Practical Examples

neo

neo

Next Post
Nextcloud: Maintenance with OCC Command with Practical Examples

Nextcloud: Maintenance with OCC Command with Practical Examples

Follow Us

  • Trending
  • Comments
  • Latest
MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

ADVERTISEMENT

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

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

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

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.