Temporary Network Configuration Guideline (Linux)
Step-by-Step Guide to Linux Temporary Network Setup

Search for a command to run...
Step-by-Step Guide to Linux Temporary Network Setup

No comments yet. Be the first to comment.
A fast, cross-platform command-line tool for Google Drive — built with .NET 9, shipped as a single binary.

Email remains a fundamental tool for communication, and understanding how your email client retrieves messages from the server can help you make the best choice for your needs. The two most common pro

A Step-by-Step Guide to Moving Linux VMs from VMware ESXi 8 to SolusVM2 (KVM)

Learn How to Easily Configure a Static IP and Custom Routes on Ubuntu

This guideline describes how to set up a temporary network configuration on a Linux server using ip commands. These changes will only persist until the next reboot.
Check available network interfaces and note the one you want to configure (e.g., ens3).
ip link show
Remove all current IP addresses from your interface to avoid conflicts.
sudo ip addr flush dev ens3
Replace
ens3with your actual interface name.
Set the desired IP address and subnet mask.
sudo ip addr add 51.1.1.51/24 dev ens3
51.1.1.51 is the new IP.
/24 is the subnet mask (255.255.255.0).
Activate the interface if it is down.
sudo ip link set ens3 up
If you need to reach a specific host directly:
sudo ip route add 15.2.2.15 dev ens3
Direct all traffic through the gateway:
sudo ip route add default via 15.2.2.15
Set a DNS server to resolve domain names.
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
This replaces your
/etc/resolv.confwith Google’s DNS.
Note: Changes to/etc/resolv.confare also temporary and may be overwritten by network managers.
You can use the following shell script to automate this temporary network setup.
This script will prompt you for the required details and apply the configuration.
#!/bin/bash
# Temporary Linux Network Configuration (Interactive Script)
echo "=== Temporary Network Configuration ==="
# Prompt for network interface
read -p "Enter the network interface name (e.g., ens3): " IFACE
# Prompt for new IP address (with CIDR)
read -p "Enter the new IP address with CIDR (e.g., 192.168.1.100/24): " IPADDR
# Prompt for Gateway
read -p "Enter the gateway IP address (e.g., 192.168.1.1): " GATEWAY
# Prompt for DNS
read -p "Enter the DNS server IP (e.g., 8.8.8.8): " DNS
echo ""
echo "Applying network changes..."
# Flush existing IP addresses
sudo ip addr flush dev "$IFACE"
# Assign new IP address
sudo ip addr add "\(IPADDR" dev "\)IFACE"
# Bring the interface up
sudo ip link set "$IFACE" up
# Add default gateway
sudo ip route add default via "$GATEWAY"
# Set DNS server
echo "nameserver $DNS" | sudo tee /etc/resolv.conf
echo ""
echo "Network configuration applied (temporarily, until reboot)."
echo "Current network status:"
ip addr show "$IFACE"
ip route
echo ""
echo "Test connectivity (ping DNS server):"
ping -c 4 "$DNS"
echo ""
echo "Done."
Usage:
Save as network_setup_prompt.sh.
Make executable: chmod +x network_setup_prompt.sh
Run: ./network_setup_prompt.sh
Follow prompts to input interface, IP address, gateway, and DNS.
Note:
This configuration is temporary and will be lost after a reboot. For permanent changes, edit your network configuration files.
ip a
ip route
Ping gateway or external IP:
ping -c 4 8.8.8.8
Test DNS:
ping -c 4 google.com
If you need Open vSwitch for virtual networking:
sudo apt update
sudo apt install openvswitch-switch
Temporary: These changes will be lost after a reboot. For permanent changes, edit your network configuration files (e.g., /etc/network/interfaces, Netplan, or NetworkManager settings).
Permissions: All commands require root privileges (sudo).
Interface Name: Replace ens3 with your actual interface name.
If network is not working, check:
IP address assignment: ip a
Routing table: ip route
DNS settings: cat /etc/resolv.conf
Interface status: ip link show ens3
Re-run commands if you made a mistake or want to reset.
I’m Kumar Bishojit Paul, the Founder and CEO of BIKIRAN. If you need further assistance, please leave a comment. I’m interested in helping you.
Bikiran is a software development and cloud infrastructure company founded in 2012, headquartered in Khulna, Bangladesh. With 15,000+ clients and over a decade of experience, Bikiran builds and operates a suite of products spanning domain services, cloud hosting, app deployment, workflow automation, and developer tools.
| SL | Topic | Product | Description |
|---|---|---|---|
| 1 | Website | Bikiran | Main platform — Domain, hosting & cloud services |
| 2 | Website | Edusoft | Education management software for institutions |
| 3 | Website | n8n Clouds | Managed n8n workflow automation hosting |
| 4 | Website | Timestamp Zone | Unix timestamp converter & timezone tool |
| 5 | Website | PDFpi | Online PDF processing & manipulation tool |
| 6 | Website | Blog | Technical articles, guides & tutorials |
| 7 | Website | Support | 24/7 customer support portal |
| 8 | Website | Probackup | Automated database backup for SQL, PostgreSQL & MongoDB |
| 9 | Service | Domain | Domain registration, transfer & DNS management |
| 10 | Service | Hosting | Web, app & email hosting on NVMe SSD |
| 11 | Service | Email & SMS | Bulk email & SMS notification service |
| 12 | npm | Chronopick | Date & time picker React component |
| 13 | npm | Rich Editor | WYSIWYG rich text editor for React |
| 14 | npm | Button | Reusable React button component library |
| 15 | npm | Electron Boilerplate | CLI to scaffold Electron.js project templates |
| 16 | NuGet | Bkash | bKash payment gateway integration for .NET |
| 17 | NuGet | Bikiran Engine | Core .NET engine library for Bikiran services |
| 18 | Open Source | PDFpi | PDF processing tool — open source |
| 19 | Open Source | Bikiran Engine | Core .NET engine — open source |
| 20 | Open Source | Drive CLI | CLI tool to manage Google Drive from terminal |
| 21 | Docker | Pgsql | Docker setup for PostgreSQL |
| 22 | Docker | n8n | Docker setup for n8n automation |
| 23 | Docker | Pgadmin | Docker setup for pgAdmin |
| 24 | Social Media | Bikiran on LinkedIn | |
| 25 | Social Media | Bikiran on Facebook | |
| 26 | Social Media | YouTube | Bikiran on YouTube |
| 27 | Social Media | FB n8nClouds | n8n Clouds on Facebook |