Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic to Static IP – Ubuntu Server 24.04

A Bash script that simplifies converting a dynamic IP address to a static IP configuration on Ubuntu Server 24.04. It walks you through every step interactively and is designed to be accessible to users with limited networking experience.


Features

  • Welcome & overview – Greets the user and explains what the script will do before making any changes
  • User authentication – Displays the current user and requests explicit confirmation to proceed
  • Network interface detection – Automatically identifies the active network interface (ensure only one cable is plugged in)
  • Current settings display – Shows existing IP address, netmask, gateway, and DHCP4/DHCP6 status
  • Guided input prompts – Prompts for new static IP, netmask, gateway, DNS servers, and hostname
  • Netplan config management – Locates the existing Netplan file, creates a timestamped backup, and writes a new configuration
  • Safe apply with rollback – Asks for confirmation before applying; if declined, automatically reverts to the original configuration

Quick Start

Requirements

  • Ubuntu Server 24.04
  • Bash
  • Root / sudo access

Clone & run

git clone https://github.com/masterlog80/dynamic-to-static-ip.git
cd dynamic-to-static-ip
sudo chmod +x static-ip.sh
sudo ./static-ip.sh

Uninstall / rollback

The script creates a backup of your original Netplan configuration before making any changes. To restore it manually:

# The backup is saved alongside the original, e.g.:
sudo cp /etc/netplan/00-installer-config.yaml.bak /etc/netplan/00-installer-config.yaml
sudo netplan apply

Usage

  1. Run the script as root on your Ubuntu Server 24.04 machine.
  2. Confirm the active network interface detected by the script.
  3. Enter your desired static IP, subnet mask, gateway, DNS server(s), and hostname when prompted.
  4. Review the summary and confirm to apply, or decline to revert all changes automatically.

Screenshots

Dynamic to Static IP script terminal output

License

MIT

About

Designed to simplify the process of changing a dynamic IP address to a static IP address on Ubuntu Server 24.04. It provides a comprehensive step-by-step walkthrough, making it user-friendly for individuals with limited technical expertise but need their Ubuntu server up and running with a static IP configuration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages