• 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: Add VLAN on Ubuntu with netplan

neo by neo
May 27, 2025
in Networking
0
Linux Networking: Add VLAN on Ubuntu with netplan

Linux Networking: Add VLAN on Ubuntu with netplan

0
SHARES
140
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

VLANs (Virtual Local Area Networks) on Ubuntu

Linux Networking: Add VLAN on Ubuntu with netplan is an essential part of any Linux system, and managing VLANs (Virtual Local Area Networks) helps improve network segmentation, security, and traffic management. In this post, we will guide you through the process of adding a VLAN on Ubuntu using netplan, the default network configuration tool. By the end of this tutorial, you will know how to configure VLAN interfaces, assign IP addresses, and implement these changes to ensure efficient network management on your Ubuntu server. Let’s dive into setting up VLANs with netplan for enhanced networking functionality.

General VLAN Usage

A VLAN (Virtual Local Area Network) is a logical subdivision of a physical network that allows devices on different physical LANs to communicate as if they were on the same physical LAN. This segmentation helps to manage traffic efficiently, enhance security, and improve network performance by reducing broadcast domains.

Network Configuration with netplan on Ubuntu

Configuration file is located under the folder: /etc/netplan

# List files in the folder
ls /etc/netplan

# Edit the file
sudo nano 00-installer-config.yaml

Content of the file:

ADVERTISEMENT
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  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:
        eth0:
            dhcp4: true
            optional: true

# Add VLAN 30 with IP Adress
    vlans:
        eth0.30:
            id: 30
            link: eth0
            addresses: [10.3.3.10/24]

    version: 2

netplan Configuration Explanation

In this configuration we added VLAN 30 on the eth0 interfaces.

  • eth0.30: Represents a VLAN with ID 30 created on the eth0 interface.
  • id: 30: The VLAN ID, a unique identifier for this VLAN.
  • link: eth0: Indicates that this VLAN is tied to the eth0 physical interface.
  • addresses: [10.3.3.10/24]: Assigns a static IP address (10.3.3.10) with a subnet mask (/24) to the VLAN.

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.

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

ADVERTISEMENT
ADVERTISEMENT
# Apply network configuration
netplan apply

defencedev.com

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Immich: Generate Let’s Encrypt Certificate on Ubuntu 22.04 Server

Next Post

Linux Networking: ifconfig, Managing Network Interfaces on Ubuntu

neo

neo

Next Post
Linux Networking: ifconfig, Managing Network Interfaces on Ubuntu

Linux Networking: ifconfig, Managing Network Interfaces on Ubuntu

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

Install SoftEther VPN Server on Ubuntu 24.04

Install SoftEther VPN Server on Ubuntu 24.04

Recent News

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

Install SoftEther VPN Server on Ubuntu 24.04

Install SoftEther VPN Server on Ubuntu 24.04

Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

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

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