Ubuntu

How do I Temporarily Change my IP Address Linux/Ubuntu?

How do I Temporarily Change my IP Address Linux Ubuntu

IP Address or Internet Protocol Address is used to recognize the Inter-Connected Devices in a Network. With IP Addresses, the inter-connected devices interact and communicate with each other. Every device in the network has its own unique IP Address and changing the IP Address routinely leads to improved security and privacy of the device.

This article explains the steps to Temporarily Change IP Address.

How do I Temporarily Change my IP Address in Linux/Ubuntu?

The Router assigns IP Addresses automatically which is known to be the DHCP method. IP Address can be changed from DHCP (Automatic) to Static (Manual) but it stays the same unless you change it manually again. Execute the steps below to temporarily change your IP Address.

Step 1: Open Terminal

To open the terminal in Ubuntu, use any of the GUI or CLI. To start the terminal using the GUI, navigate to the “Show Applications” icon and click on it or press the Windows Button on your Keyboard to open the “Show Applications” menu directly.

In the applications screen, you can see the “Search” box. Click on it and type the application you want to filter. In our case, we will type “terminal”:

Open it either by pressing “Enter” or clicking on it:

Alternatively, you can open the Terminal directly using the Shortcut Key “ctrl+alt+T”:

Pressing these keys wherever will open the terminal:

Step 2: Check the Current IP Address

Before temporarily changing the IP address, check the current IP address of your Ubuntu system using the command:

ip a

This will display the Network Details. Look for the IP Address with the “inet” statement:

Apart from the “ip a” command, you can also execute the “ip addr show” command:

ip addr show

This will also display the network details:

Step 3: Temporary Change IP Address Using “ifconfig” Command

The “ifconfig” command in Ubuntu displays the Network Configuration details, managing the Network Configuration, and setting up network interfaces. To use the “ifconfig”, check your network interface name. In the Network Details, look for the interface name which might be “enp0s3” or “ens33”. In our case it is “ens33”:

Once you know your network interface name, you can modify the IP Address using the “ifconfig” command having the syntax:

sudo ifconfig <interface-name> <new-IP-address/subnet>

Or you can also add the Netmask:

sudo ifconfig <interface-name> <new-IP-address> netmask <netmask-address>

Changing the Syntax according to our network configuration, using the subnet address:

sudo ifconfig ens33 192.168.184.120/24

This will change our IP Address to a temporary IP Address of “192.168.184.120”:

Now changing the configuration using the netmask syntax:

sudo ifconfig ens33 192.168.184.120 netmask 255.255.255.0

This will also change the IP Address to “192.168.184.120”:

Both the subnet and netmask commands change the IP address.

Step 4: Verify New IP Address

Verify your new Temporary IP Address after you’ve changed it using the “ip addr show” command:

ip addr show

As you can see our IP Address has been changed.

If you’ve used the netmask command to change the IP Address, verifying will result in the same changed IP Address:

Step 5: Reboot System

To check if the IP Address is changed temporarily, reboot your Ubuntu system either using the “reboot” command or using the GUI to restart. To reboot using Terminal, execute the “reboot” command:

reboot

You can also restart your system by navigating and clicking the “power” icon on the top right side of your Home Screen:

A drop-down menu appears having multiple options, click on the “Power” Icon:

This will show additional Power Options. Click on the “Restart…” option to reboot your Ubuntu System:

A popup window will ask for confirmation, click on “Restart”:

This will reboot your Ubuntu System.

Step 6: Check the Current IP Address Again

Check the IP Address again once your system Reboots using the command:

ip addr show

As you can see, the original IP Address “192.168.184.131” reverted back after rebooting the system. This means the IP Address only changed temporarily using the “ifconfig” command.

Conclusion

Temporarily Changing the IP Address can improve the browsing privacy and overall security of the system. IP Address can be temporarily changed by providing the network interface name, temporary IP Address, and the “ifconfig” command in the terminal. This article explained in detail the procedure to follow for changing IP Address Temporarily.

Similar Posts