Published: July 22, 2026
Read: 8 min
In: Technology & Development

Written by

Reviewed by

Last updated: June 25, 2023

Expert verified

SVG Image

TL;DR

To change ip address in Linux, you can try these three methods:

  1. Using the ifconfig Command: Change IP address through the command line.
  2. Configuring IP Address via Network Manager: Change IP address using a graphical interface.
  3. Using the ip Command: Change IP address with extensive network configuration capabilities.

Changing IP addresses in Linux requires careful attention to ensure a smooth transition. Follow best practices such as obtaining proper authorization, planning and documenting changes, verifying compatibility, and conducting thorough testing. By adhering to these practices, you can minimize disruptions, maintain system security, and seamlessly transition to the new IP address configuration.

Explore the guide below to learn different methods and best practices to change ip address in Linux.

IP addresses are unique identifiers assigned to devices connected to a network, enabling data transfer and communication. You might need to change IP address in Linux for various reasons, such as safeguarding your privacy, accessing geo-restricted content, troubleshooting network issues, or even experimenting with different network configurations.

In this ultimate guide, I will explore three effective methods to change IP address in Linux and four best practices to remember when changing the ip address. 

How to Change IP Address in Linux

To change IP address in Linux, you have options that suit your preferences. For advanced users and scripting, the ifconfig command provides command-line control. Network Manager offers a user-friendly graphical interface, while the ip command provides extensive network configuration capabilities.

1. Using the ifconfig Command

This method allows you to change your IP address through the command line, making it useful for advanced users and scripting purposes. Follow these steps to change your IP address using ifconfig:

  1. Open a Terminal window.
opening terminal 10
  1. Identify the network interface you want to modify by running the command: 

<strong>ifconfig -a</strong>
  1. It will display a list of available network interfaces.
identify network interface you want to modify
  1. Disable the network interface using: 

<strong>sudo ifconfig interface down</strong>
  1. Replace the interface with the interface that you selected.
disabling network interface
  1. Change the IP address using the command: 

<strong>sudo ifconfig interface new_ip_address netmask subnet_mask up</strong>
  1. This command will change the IP address.
changing ip address
  1. Verify the changes by running ifconfig again.
verifying the changes

2. Configuring IP Address via Network Manager

Network Manager provides a user-friendly graphical interface for changing IP addresses, making it suitable for users who prefer a visual approach to network configuration. Here’s how you can change IP address in Linux using Network Manager’s graphical interface:

  1. Open the Network Manager applet from the system tray or access it through the system settings.
opening system settings
  1. Locate the network connection you want to modify and select it.
locating network to change ip address
  1. Click on the IPv4 or IPv6 tab, depending on the type of address you wish to change.
choosing ip address type to change it
  1. Choose the Manual option from the Method dropdown menu.
choosing manual method
  1. Enter the desired IP address, subnet mask, gateway, and DNS servers, then click on the apply button.
entering desired ip address
  1. The output will be:
changes are made

3. Using the ip Command

The ip command offers extensive network configuration capabilities, making it a powerful tool for advanced users who require fine-grained control over IP address changes. Follow these steps to change your IP address using the ip command:

  1. Open a Terminal window and identify the network interface you wish to modify using the command: 

<strong>ip addr show</strong>
  1. The command will show a list of network interfaces.
identifying network interface
  1. Disable the network interface: 

<strong>sudo ip link set interface down</strong>

Replace interface with interface name that you chose.

disable desired network interface
  1. Change the IP address by executing the command: 

<strong>sudo ip addr add new_ip_address/subnet_mask dev interface</strong>
  1. The command will change the ip address.
changing ip address of desired interface
  1. Enable the network interface: