Skip to content

TwistedDiesel/npconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

npconfig

npconfig is a utility for configuring netplan through an ifconfig-compatible CLI and an interactive curses menu. It is designed to be more user-friendly than fighting YAML on a lone server with no network.

No sysadmin should have to bring a netplan manual just to bring networking up.

Features

  • ifconfig-style commands for quick provisioning
  • Wi-Fi setup (scan, connect, hidden SSID, DHCP/static)
  • Interactive menu (npconfig menu) using dialog or whiptail
  • Auto-detects NetworkManager vs systemd-networkd renderer
  • Applies config via netplan apply (no hard dependency on NetworkManager)

Requirements

  • Linux with netplan and iproute2 (ip)
  • root / sudo
  • For Wi-Fi scan/menu on Ubuntu Server: wpasupplicant (stock) — nmcli or iw optional fallbacks
  • For interactive menu: whiptail or dialog
# Ubuntu Server (systemd-networkd)
sudo apt-get install -y netplan.io iproute2 wpasupplicant whiptail

# Ubuntu Desktop (NetworkManager)
sudo apt-get install -y netplan.io iproute2 network-manager whiptail

ifconfig is not required.

Install

curl -fsSL https://raw.githubusercontent.com/TwistedDiesel/npconfig/main/npconfig -o npconfig
chmod +x npconfig
sudo install -m 755 npconfig /usr/local/bin/npconfig

Or clone and install:

git clone https://github.com/TwistedDiesel/npconfig.git
cd npconfig
sudo install -m 755 npconfig /usr/local/bin/npconfig

Interactive menu (recommended for new hosts)

sudo npconfig menu

Menu options:

  • Configure Ethernet (DHCP / static / up / down / status)
  • Configure Wi-Fi (scan & connect, hidden SSID, DHCP/static)
  • Show interface status
  • Apply netplan

Aliases: npconfig --menu, npconfig -m

CLI usage (ifconfig-compatible)

# Show interfaces
npconfig
npconfig -a
npconfig eth0

# Link state
npconfig eth0 up
npconfig eth0 down

# DHCP (persisted via netplan)
npconfig eth0 inet dhcp

# Static IPv4
npconfig eth0 192.168.1.50 netmask 255.255.255.0 up

Wi-Fi CLI

# Scan
npconfig wlan0 wifi scan

# Open network + DHCP
npconfig wlan0 wifi GuestNetwork open inet dhcp up

# WPA network + DHCP
npconfig wlan0 wifi MySSID passphrase mypassword inet dhcp up

# Static IP on Wi-Fi
npconfig wlan0 wifi MySSID psk mypassword 192.168.1.50 netmask 255.255.255.0 up

# Hidden SSID
npconfig wlan0 wifi --hidden SecretSSID passphrase mypassword inet dhcp up

How it works

npconfig writes per-interface files:

/etc/netplan/99-npconfig-<iface>.yaml

Then runs:

netplan generate
netplan apply

These files are intentionally prefixed with 99- so they override simpler defaults while remaining easy to find and remove.

Security notes

  • Runs as root — only install and run from a trusted source (this repo or your own build).
  • Wi-Fi passwords are stored in /etc/netplan/99-npconfig-*.yaml (mode 600), which is standard for netplan.
  • Session logs live in /var/log/npconfig/ (mode 700; log files 600). Passwords are redacted in logs.
  • Verbose shell tracing is off by default. For deep debugging only: sudo NP_LOG_TRACE=1 npconfig menu
  • Remove npconfig overlays anytime: sudo rm /etc/netplan/99-npconfig-*.yaml && sudo netplan apply

Example netplan output (Wi-Fi DHCP)

network:
  version: 2
  renderer: NetworkManager
  wifis:
    wlan0:
      dhcp4: true
      access-points:
        "MySSID":
          password: "mypassword"

License

GPL-3.0 — see LICENSE.

About

npconfig is a utility for configuring netplan through an interactive interface, designed to be even more user friendly than ifconfig. No sysadmin should have to bring a netplan manual and fight yaml syntax just to bring networking up on a lone server!

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages