April 23, 2025

🐧 Configuring Ethernet and Hidden Wi-Fi with Netplan on Ubuntu Server

While setting up Ubuntu Server, I discovered that it only had Netplan installed for network configuration β€” no NetworkManager or other tools.

πŸ” Finding the Configuration File

Netplan configuration was located at:

/etc/netplan/50-cloud-init.yaml

✏️ Editing the Netplan Config

To set up both a DHCP Ethernet connection and a hidden Wi-Fi network, I edited the YAML file:

sudo nano /etc/netplan/50-cloud-init.yaml

Here’s what the configuration looked like:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s31f6:
      dhcp4: true

  wifis:
    wlp0s20f3:
      dhcp4: true
      access-points:
        "My Hidden SSID":
          auth:
            key-management: "psk"
            password: "YourPassword"
            hidden: true

πŸ” Note: To connect to a hidden WPA/WPA2 Wi-Fi network, both password and hidden: true must be placed inside the auth block. Placing them outside will cause Netplan to error or silently ignore the Wi-Fi configuration.

πŸ’Ύ Save and Apply the Configuration

After saving and exiting the file:

sudo netplan apply

Netplan brought up both my Ethernet (enp0s31f6) and Wi-Fi (wlp0s20f3) connections successfully, including the hidden SSID.


Leave a Reply

Your email address will not be published. Required fields are marked *