How-To Geek

How to use the ip command on linux.

It is time to break up with ifconfig.

Quick Links

How the ip command works, using ip with addresses, display only ipv4 or ipv6 addresses, display information for a single interface, adding an ip address, deleting an ip address, using ip with network interfaces, starting and stopping links, using ip with routes, display information for a single route, adding a route, taken route, not taken root, key takeaways.

  • The ip command has replaced the older ifconfig command in modern versions of Linux.
  • The ip command allows you to configure IP addresses, network interfaces, and routing rules on the fly without rebooting.
  • Run "ip addr" in the Terminal to get your PC's local IP address.

You can configure IP addresses, network interfaces, and routing rules on the fly with the Linux ip command. We'll show you how you can use this modern replacement of the classic (and now deprecated) ifconfig .

With the ip command, you can adjust the way a Linux computer handles IP addresses, network interfaces controllers (NICs), and routing rules . The changes also take immediate effect — you don't have to reboot. The ip command can do a lot more than this, but we'll focus on the most common uses in this article.

The ip command has many subcommands, each of which works on a type of object, such as IP addresses and routes. There are, in turn, many options for each of these objects. It's this richness of functionality that gives the ip command the granularity you need to perform what can be delicate tasks. This isn't ax work — it calls for a set of scalpels.

We'll look at the following objects:

  • Address : IP addresses and ranges.
  • Link : Network interfaces, such as wired connections and Wi-Fi adapters.
  • Route : The rules that manage the routing of traffic sent to addresses via interfaces ( links ).

Obviously, you first have to know the settings you're dealing with. To discover which IP addresses your computer has, you use the ip command with the object address . The default action is show , which lists the IP addresses. You can also omit show and abbreviate address as "addr" or even "a."

The following commands are all equivalent:

ip address show

ip addr show

ip address show in a terminal window

We see two IP addresses, along with a lot of other information. IP addresses are associated with network interface controllers (NICs). The ip command tries to be helpful and provides a bunch of information about the interface, too.

The first IP address is the (internal) loopback address used to communicate within the computer. The second is the actual (external) IP address the computer has on the local area network (LAN).

Let's break down all the information we received:

  • lo : The network interface name as a string.
  • <LOOPBACK,UP,LOWER_UP>: This is a loopback interface. It's UP , meaning it's operational. The physical networking layer (layer one) is also up.
  • mtu 65536: The maximum transfer unit. This is the size of the largest chunk of data this interface can transmit.
  • qdisc noqueue: A qdisc is a queuing mechanism. It schedules the transmission of packets. There are different queuing techniques called disciplines. The noqueue discipline means "send instantly, don't queue." This is the default qdisc discipline for virtual devices, such as the loopback address.
  • state UNKNOWN: This can be DOWN (the network interface is not operational), UNKNOWN (the network interface is operational but nothing is connected), or UP (the network is operational and there is a connection).
  • group default: Interfaces can be grouped logically. The default is to place them all in a group called "default."
  • qlen 1000: The maximum length of the transmission queue.
  • link/loopback: The media access control (MAC) address of the interface.
  • inet 127.0.0.1/8: The IP version 4 address. The part of the address after the forward-slash ( / ) is Classless Inter-Domain Routing notation (CIDR) representing the subnet mask. It indicates how many leading contiguous bits are set to one in the subnet mask. The value of eight means eight bits. Eight bits set to one represents 255 in binary, so the subnet mask is 255.0.0.0.
  • scope host: The IP address scope. This IP address is only valid inside the computer (the "host").
  • lo: The interface with which this IP address is associated.
  • valid_lft: Valid lifetime. For an IP version 4 IP address allocated by Dynamic Host Configuration Protocol (DHCP), this is the length of time the IP address is considered valid and able to make and accept connection requests.
  • preferred_lft: Preferred lifetime. For an IP version 4 IP address allocated by DHCP, this is the amount of time the IP address can be used with no restrictions. This should never be larger than the valid_lft value.
  • inet6 : The IP version 6 address, scope , valid_lft , and preferred_lft .

The physical interface is more interesting, as we'll show below:

  • enp0s3: The network interface name as a string. The "en" stands for ethernet, "p0" is the bus number of the ethernet card, and "s3" is the slot number.
  • <BROADCAST,MULTICAST,UP,LOWER_UP>: This interface supports broad- and multicasting , and the interface is UP (operational and connected). The hardware layer of the network (layer one) is also UP .
  • mtu 1500: The maximum transfer unit this interface supports.
  • qdisc fq_codel: The scheduler is using a discipline called "Fair Queuing, Controlled Delay." It's designed to provide a fair share of the bandwidth to all the traffic flows that use the queue.
  • state UP: The interface is operational and connected.
  • group default: This interface is in the "default" interface group.
  • link/ether: The MAC address of the interface.
  • inet 192.168.4.26/24: The IP version 4 address. The "/24" tells us there are 24 contiguous leading bits set to one in the subnet mask. That's three groups of eight bits. An eight-bit binary number equates to 255; therefore, the subnet mask is 255.255.255.0.
  • brd 192.168.4.255: The broadcast address for this subnet.
  • scope global: The IP address is valid everywhere on this network.
  • dynamic: The IP address is lost when the interface goes down.
  • noprefixroute: Do not create a route in the route table when this IP address is added. Someone has to add a route manually if he wants to use one with this IP address. Likewise, if this IP address is deleted, don't look for a route to delete.
  • enp0s3: The interface with which this IP address is associated.
  • valid_lft: Valid lifetime. The time the IP address will be considered valid; 86,240 seconds is 23 hours and 57 minutes.
  • preferred_lft: Preferred lifetime. The time the IP address will operate without any restrictions.
  • inet6: The IP version 6 address, scope , valid_lft , and preferred_lft .

If you want to limit the output to the IP version 4 addresses, you can use the -4 option, as follows:

ip -4 addr in a terminal window

If you want to limit the output to the IP version 6 addresses, you can use the -6 option, as follows:

ip -6 addr in a terminal window

If you want to see the IP address information for a single interface, you can use the show and dev options, and name the interface, as shown below:

ip addr show dev lo

ip addr show dev enp0s3

ip addr show dev lo in a terminal window

You can also use the -4 or -6 flag to further refine the output so you only see that in which you're interested.

If you want to see the IP version 4 information related to the addresses on interface enp0s3 , type the following command:

ip -4 addr show dev enp0s3

ip -4 addr show dev enp0s3 in a terminal window

You can use the add and dev options to add an IP address to an interface. You just have to tell the ip command which IP address to add, and to which interface to add it.

We're going to add the IP address 192.168.4.44 to the enp0s3 interface. We also have to provide the CIDR notation for the subnet mask.

We type the following:

sudo ip addr add 192.168.4.44/24 dev enp0s3

sudo ip addr add 192.168.4.44/24 dev enp0s3 in a terminal window

We type the following to take another look at the IP version 4 IP addresses on this interface:

ip -4 addr show dev enp0s3 in a terminal window

The new IP address is present on this network interface. We jump on another computer and use the following command to see if we can ping the new IP address :

ping 192.168.4.44

ping 192.168.4.44  in a terminal window

The IP address responds and sends back acknowledgments to the pings. Our new IP address is up and running after one simple ip command.

To delete an IP address, the command is almost the same as the one to add one, except you replace add with del , as shown below:

sudo ip addr del 192.168.4.44/24 dev enp0s3

sudo ip addr del 192.168.4.44/24 dev enp0s3 in a terminal window

If we type the following to check, we see the new IP address has been deleted:

ip -4 addr show dev enp0s3 in a terminal window

You use the link object to inspect and work with network interfaces. Type the following command to see the interfaces installed on your computer:

ip link show

ip link show: in a terminal window

To see a single network interface, just add its name to the command, as shown below:

ip link show enp0s3

ip link show enp0s3 in a terminal window

You can use the set option with either up or down to stop or start a network interface option. You also have to use sudo , as shown below:

sudo ip link set enp0s3 down

sudo ip link set enp0s3 down in a terminal window

We type the following to take a look at the network interface:

ip link show enp0s3 in a terminal window

The state of the network interface is DOWN . We can use the up option to restart a network interface, as shown below:

sudo ip link set enp0s3 up

sudo ip link set enp0s3 up in a terminal window

We type the following to do another quick check on the state of the network interface:

ip link show enp0s3 in a terminal window

The network interface was restarted, and the state is shown as UP .

With the route object, you can inspect and manipulate routes. Routes define to where network traffic to different IP addresses is forwarded, and through which network interface.

If the destination computer or device shares a network with the sending computer, the sending computer can forward the packet directly to it.

However, if the destination device is not directly connected, the sending computer forwards the packet to the default router. The router then decides where to send the packet.

To see the routes defined on your computer, type the following command:

ip route in a terminal window

Let's take a look at the info we received:

  • default: The default rule. This route is used if none of the other rules match what's being sent.
  • via 192.168.4.1: Routes the packets via the device at 192.168.4.1. This is the IP address of the default router on this network.
  • dev enp0s3: Use this network interface to send the packets to the router.
  • proto dhcp: The routing protocol identifier. DHCP means the routes will be determined dynamically.
  • metric 100: An indication of the preference of the route compared to others. Routes with lower metrics are preferentially used over those with higher metrics. You can use this to give preference to a wired network interface over a Wi-Fi one.

The second route governs traffic to the IP range of 169.254.0.0/16. This is a zero-configuration network , which means it tries to self-configure for intranet communication. However, you can't use it to send packets outside the immediate network.

The principle behind zero-configuration networks is they don't rely on DHCP and other services being present and active. They only need to see TCP/IP in order to self-identify to each of the other devices on the network.

Let's take a look:

  • 169.254.0.0/16: The range of IP addresses this routing rule governs. If the computer communicates on this IP range, this rule cuts in.
  • dev enp0s3: The network interface the traffic governed by this route will use.
  • scope link : The scope is link , which means the scope is limited to the network to which this computer is directly connected.
  • metric 1000 : This is a high metric and isn't a preferred route.

The third route governs traffic to the IP address range of 192.168.4.0/24. This is the IP address range of the local network to which this computer is connected. It's for communication across, but within, that network.

Let's break it down:

  • 192.168.4.1/24: The range of IP addresses this routing rule governs. If the computer communicates within this IP range, this rule triggers and controls the packet routing.
  • dev enp0s3: The interface through which this route will send packets.
  • proto kernel: The route created by the kernel during auto-configuration.
  • scope link: The scope is link , which means the scope is limited to the immediate network to which this computer is connected.
  • src 192.168.4.26: The IP address from which packets sent by this route originate.
  • metric 100: This low metric indicates a preferred route.

If you want to focus on the details of a particular route, you can add the list option and IP address range of the route to the command as follows:

ip route list 192.168.4.0/24

ip route list 192.168.4.0/24 in a terminal window

We just added a new network interface card to this computer. We type the following and see it's showing up as enp0s8 :

ip link show in a terminal window

We'll add a new route to the computer to use this new interface. First, we type the following to associate an IP address with the interface:

sudo ip addr add 192.168.121.1/24 dev enp0s8

sudo ip addr add 192.168.121.1/24 dev enp0s8 in a terminal window

A default route using the existing IP address is added to the new interface. We use the delete option, as shown below, to delete the route and provide its details:

sudo ip route delete default via 192.168.4.1 dev enp0s8

sudo ip route delete default via 192.168.4.1 dev enp0s8 in a terminal window

We'll now use the add option to add our new route. The new interface will handle network traffic in the 192.168.121.0/24 IP address range. We'll give it a metric of 100; because it will be the only route handling this traffic, the metric is pretty much academic.

sudo ip route add 192.168.121.0/24 dev enp0s8 metric 100

sudo ip route add 192.168.121.0/24 dev enp0s8 metric 100 in a terminal window

Now, we type the following to see what it gives us:

ip route in a terminal window

Our new route is now in place. However, we still have the 192.168.4.0/24 route that points to interface enp0s8 — we type the following to remove it:

sudo ip route delete 192.168.4.0/24 dev enp0s8

sudo ip route delete 192.168.4.0/24 dev enp0s8 in a terminal window

We should now have a new route that points all traffic destined for IP range 192.168.121.0/24 through interface enp0s8 . It should also be the only route that uses our new interface.

We type the following to confirm:

ip route in a terminal window

The great thing about these commands is they're not permanent. If you want to clear them, just reboot your system. This means you can experiment with them until they work the way you want. And it's a very good thing if you make a terrible mess of your system — a simple reboot will restore order.

On the other hand, if you want the changes to be permanent, you have to do some more work. Exactly what varies depending on the distribution family, but they all involve changing config files.

This way, though, you can test-drive commands before you make anything permanent.

How To Remove APT Repository In Ubuntu [4 Best Methods]

How to Remove APT Repository in Ubuntu [4 Best Methods] featured image

3 Proven Methods to Lock and Unlock Users in Linux

proven methods to lock and unlock users in linux featured image

How to Use Paste Command in Linux [4 Best Uses]

how to use paste command in linux featured image

How to Exit a Docker Container Like a Pro [5 Best Methods]

how to exit a docker container like a pro featured image

How to Change IP Address in Linux [3 Effective Methods]

' src=

Reviewed by

Last updated: June 25, 2023

Expert verified

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

  • Using the ifconfig Command: Change IP address through the command line.
  • Configuring IP Address via Network Manager: Change IP address using a graphical interface.
  • 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:

  • Open a Terminal window.

opening terminal 10

  • Identify the network interface you want to modify by running the command: 
  • It will display a list of available network interfaces.

identify network interface you want to modify

  • Disable the network interface using: 
  • Replace the interface with the interface that you selected.

disabling network interface

  • Change the IP address using the command: 
  • This command will change the IP address.

changing ip address

  • 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:

  • Open the Network Manager applet from the system tray or access it through the system settings.

opening system settings

  • Locate the network connection you want to modify and select it.

locating network to change ip address

  • Click on the IPv4 or IPv6 tab, depending on the type of address you wish to change.

choosing ip address type to change it

  • Choose the Manual option from the Method dropdown menu.

choosing manual method

  • Enter the desired IP address, subnet mask, gateway, and DNS servers, then click on the apply button.

entering desired ip address

  • 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:

  • Open a Terminal window and identify the network interface you wish to modify using the command: 
  • The command will show a list of network interfaces.

identifying network interface

  • Disable the network interface: 

Replace interface with interface name that you chose.

disable desired network interface

  • Change the IP address by executing the command: 
  • The command will change the ip address.

changing ip address of desired interface

  • Enable the network interface: 
  • The changes will look like this:

enabling network interface

Best Practices for Changing IP Address

Changing IP addresses in Linux requires careful attention to ensure a smooth transition and avoid potential issues. Following these best practices when changing IP addresses in Linux helps maintain system security, minimize downtime, and ensure a smooth transition to the new IP configuration. Here are four best practices to follow:

  • 🔒 Ensure Proper Authorization and Permission: Before changing your IP address, it is crucial to ensure that you have the necessary authorization and permission to do so. Modifying network settings often requires administrative privileges. Changing IP addresses without proper authorization can lead to network connectivity issues or violations of organizational policies. Always consult your network administrator or obtain the necessary permissions before proceeding to avoid potential complications or security breaches.
  • ⏰ Plan and Document Your Changes: Changing IP addresses should not be taken lightly. It is important to plan and document your changes to avoid confusion and ensure a smooth transition. Before making any modifications, create a clear plan outlining the steps and desired outcomes. Documenting the changes helps maintain an organized process record, making troubleshooting easier if any issues arise. Documentation is also a valuable reference for future network management or IP address reconfiguration.
  • 💡 Verify Compatibility and Impact: Verify the compatibility and potential impact of changing your IP address, especially if your network is integrated with other systems or services. Determine whether the IP address change will affect other components such as DNS, routing, or network services. Assess potential compatibility issues with existing devices, software, or network configurations. Identifying and addressing compatibility concerns beforehand can minimize disruptions and ensure a seamless transition to the new IP address without compromising other essential network functionalities.
  • 🔧 Test and Validate the New Configuration: Before implementing the new IP address configuration in a production environment, it is crucial to test and validate the changes thoroughly. Set up a test environment or use a sandbox network to simulate the configuration of the new IP address. Test network connectivity, services, and applications to ensure they function correctly with the new IP address. By conducting thorough testing, you can identify and address any issues or conflicts before deploying the changes to the live network. This proactive approach helps mitigate potential downtime or disruptions and ensures a smooth transition to the new IP address.

In a Nutshell

I have provided you with various methods to change IP address in Linux, including using the ifconfig command, modifying network configuration files, and utilizing the ip command. Alongside these methods, I have shared best practices to ensure a smooth and secure IP address change.

To deepen your knowledge, consider exploring related topics such as advanced network configuration , network security practices , or setting up a Virtual Private Network (VPN) for enhanced privacy and anonymity. Stay updated with the latest developments in Linux networking to ensure you stay ahead in managing IP addresses and optimizing your network connectivity.

Frequently Asked Questions

How do i revert to my original ip address after making changes.

If you wish to revert to your original IP address after making changes, simply follow the steps outlined in the respective method you used initially, but instead of entering a new IP address, use your initial IP configuration. For example, if you modified the IP address using the ifconfig command, open the Terminal and use sudo ifconfig interface original_ip_address netmask subnet_mask up . This will restore your original IP address and network settings.

Will changing the IP address affect other network settings?

Yes, changing the IP address can impact other network settings. DNS configuration is one of the critical network settings that can be affected. DNS (Domain Name System) translates domain names into IP addresses, allowing you to access websites using their domain names. When you change your IP address, it is important to ensure that the DNS settings are updated to reflect the new IP address, or else you may experience issues with domain name resolution.

Can changing the IP address help bypass geo-restrictions?

Yes, changing your IP address can be an effective method to bypass certain geo-restrictions. Changing your IP address, especially one associated with a different geographic location, can make it appear like you are accessing the internet from that particular region. This can help you bypass restrictions imposed by certain websites or online services that limit access based on geographical boundaries. By changing your IP address to one that allowed access, you can overcome these restrictions and gain access to content or services previously unavailable in your original location.

How can I automate the IP address change process in Linux?

To automate the IP address change process in Linux, you can utilize scripting and scheduling tools. You can automate the entire process by creating a script with the necessary commands to change the IP address. Save the script and grant it executable permissions. Then, you can use tools like cron , a time-based job scheduler, to schedule the execution of the script at specific intervals or during system startup. By configuring cron to run the script automatically, you eliminate the need for manual intervention, making the IP address change process in Linux seamless and automated.

' src=

Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.

' src=

Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, he’s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

Share this article

How to find ip address in linux command line [5 easy methods], 3 effective methods to select all text in vim/vi, leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

5 Effective Ways to Check CPU Info in Linux

5 effective ways to check cpu info in linux featured image

3 Effective Methods to Update Fedora Linux to Get the Latest Software

update fedora linux to get the latest software featured image

How to List Services Using Systemctl Command in Linux [3 Easy Methods]

How to List Services Using Systemctl Command in Linux [3 Easy Methods] featured image

3 Effective Methods to Reboot a Linux Server from the Command Line

3 effective methods to reboot a linux server from the command line featured image

How To Change IP Address Linux

Copy to Clipboard

  • How-To Guides
  • Tech Setup & Troubleshooting

how-to-change-ip-address-linux

Introduction

Changing the IP address in a Linux system is a valuable skill that can come in handy for a variety of reasons. Whether you want to access geographically restricted content, troubleshoot network issues, or boost security, being able to modify your IP address gives you more control over your network connection.

Linux, known for its flexibility and customization options, provides several methods to change the IP address. In this article, we will explore different approaches to altering the IP address in Linux and discuss their advantages and use cases.

From command-line interfaces (CLI) to graphical user interfaces (GUI), Linux offers diverse options to suit different user preferences and skill levels. We will cover methods using the CLI, network manager GUI, configuring static IP addresses, and obtaining dynamic IP addresses through DHCP.

Whether you are a beginner or an experienced Linux user, understanding how to change the IP address will prove invaluable in managing and troubleshooting your network connections. So let’s dive in and discover the various methods to change the IP address in Linux!

Why Change IP Address in Linux?

There are several compelling reasons why you might want to change your IP address in a Linux system. Let’s explore some of the most common scenarios:

  • Access Geographically Restricted Content: Many online platforms and streaming services restrict access to certain regions. By changing your IP address, you can bypass these restrictions and gain access to content that might otherwise be unavailable in your location.
  • Enhance Online Privacy and Security: Your IP address is a unique identifier that can be used to track your online activities. Changing your IP address can help protect your privacy and make it more difficult for others to trace your online presence and data.
  • Troubleshoot Network Issues: Changing the IP address can sometimes resolve network problems, such as connectivity issues or conflicts with other devices on the network. By assigning a new IP address, you can refresh your network connection and potentially resolve any underlying issues.
  • Prevent IP Address Blocking: In some cases, you may find yourself blocked from accessing certain websites or services due to your IP address being flagged or banned. Changing your IP address can help circumvent these restrictions and regain access to the blocked content.
  • Secure Remote Access: If you need to access your Linux system remotely, changing the IP address can add an extra layer of security. By regularly changing your IP address, you can make it more difficult for unauthorized individuals to gain access to your system.
  • Network Testing and Configuration: Changing IP addresses can also be beneficial for network testing and configuration purposes. It allows you to simulate different network setups, test connectivity under various conditions, and ensure that your network infrastructure is functioning as intended.

These are just a few examples of why you might want to change your IP address in Linux. By understanding the reasons behind IP address modifications, you can make informed decisions and leverage this capability to enhance your online experience and network management.

Different Methods to Change IP Address in Linux

Linux offers various methods to change the IP address, providing flexibility and options based on the user’s preference and technical expertise. Let’s explore the different approaches:

The CLI is a powerful tool for Linux users to change their IP address. By utilizing commands such as ifconfig and ip, users can easily modify their network settings directly from the terminal. This method is ideal for those who prefer a command-line interface and have knowledge of Linux networking commands.

Linux distributions that include a graphical user interface often provide a Network Manager tool for managing network settings. Through the Network Manager GUI, users can easily change their IP addresses by selecting the desired network connection, accessing its properties, and modifying the IP address settings. This method is suitable for users who prefer a visual interface and are comfortable navigating through system settings.

Another method to change the IP address in Linux is by configuring a static IP address. This involves manually assigning a specific IP address to the network interface. By configuring a static IP address, users can have a consistent and predictable IP address for their system. This is especially useful for servers or devices that require a fixed IP address for networking and remote access purposes.

DHCP (Dynamic Host Configuration Protocol) allows Linux systems to automatically obtain IP addresses from a DHCP server. By enabling DHCP, the Linux system will request and receive an IP address dynamically from the DHCP server whenever it connects to the network. This method is convenient for users who prefer automatic IP address assignment and don’t require a specific IP address for their system.

These are the different methods available for changing the IP address in Linux. Each method has its own advantages and use cases, so choose the one that best suits your needs and preferences. Whether you prefer the CLI, the Network Manager GUI, static IP configuration , or dynamic IP assignment through DHCP, Linux provides the flexibility to adapt to different networking requirements.

Method 1: Changing IP Address Using Command Line Interface (CLI)

The Command Line Interface (CLI) is a powerful tool for changing the IP address in Linux using various networking commands. Here’s how you can change the IP address using the CLI:

  • Open the terminal on your Linux system. You can usually find the terminal application in the Applications or System Tools menu.
  • Type the following command to check the current IP address configuration:
  • Identify the network interface you want to modify. Common interfaces include eth0 (Ethernet) or wlan0 (Wi-Fi).
  • Use the following command to change the IP address for the desired network interface:

Replace [interface-name] with the name of the network interface you identified in step 3. Replace [new-IP-address] with the new IP address you want to assign to the interface. Replace [netmask] with the appropriate netmask for your network.

For example, to change the IP address of the eth0 interface to 192.168.1.100 with a netmask of 255.255.255.0, you would use the following command:

ifconfig eth0 192.168.1.100 netmask 255.255.255.0

  • Verify the changes by running the ifconfig command again. You should see the updated IP address configuration for the specified network interface.

Changing the IP address using the CLI provides a quick and efficient way to modify network settings in Linux. This method is particularly suitable for users who are comfortable working with the command line and prefer a more direct approach for network configuration.

Remember, the changes made using the CLI are temporary and will be reset after the system is restarted. To make the changes persistent, additional steps such as modifying configuration files may be required.

Now that you know how to change the IP address using the CLI, let’s move on to exploring other methods using the Network Manager GUI, static IP configuration, and DHCP in Linux.

Method 2: Changing IP Address Through Network Manager GUI

Linux distributions often come equipped with a graphical user interface (GUI) that includes a Network Manager tool, providing a user-friendly way to change the IP address. Follow these steps to modify your IP address using the Network Manager GUI:

  • Click on the Network Manager icon located on the system tray or taskbar. It is usually represented by an icon with two arrows forming a circle or a computer monitor symbol.
  • Select the network connection you want to modify. This could be a wired or wireless connection, depending on your system configuration.
  • Right-click on the selected connection and choose “Connection Information” or a similar option from the context menu.
  • A Network Manager window will open, displaying detailed information about the selected network connection.
  • Click on the “IPv4” or “IPv6” tab, depending on the IP version you want to modify.
  • From the drop-down menu, select the desired method for obtaining the IP address: Automatic (DHCP), Manual, or Shared with other computers.
  • If you choose the Manual option, you can enter the new IP address, subnet mask, gateway, and DNS servers manually.
  • Click “Apply” or “OK” to save the changes.
  • Once the changes are saved, the network connection will be updated with the new IP address.

The Network Manager GUI provides an intuitive interface for changing the IP address in Linux. It is especially useful for users who prefer a visual approach or find the command-line interface intimidating. By following these steps, you can easily modify your IP address and related network settings.

Keep in mind that the interface and options may vary slightly depending on the Linux distribution and desktop environment you are using. Nevertheless, the overall process for changing the IP address through the Network Manager GUI remains similar across different Linux systems.

Now that you are familiar with changing the IP address using the Network Manager GUI, let’s explore other methods, including configuring a static IP address and using DHCP to obtain a dynamic IP address in Linux.

Method 3: Configuring a Static IP Address in Linux

Configuring a static IP address in Linux involves manually assigning a specific IP address to your network interface. This can be useful in situations where you need a consistent and predictable IP address for your system, such as for servers or devices that require remote access. Follow these steps to configure a static IP address:

  • Open the terminal application on your Linux system.
  • Run the following command to open the network configuration file in a text editor:

sudo nano /etc/network/interfaces

Note: The above command assumes you are using a Debian-based distribution. For other distributions, the network configuration file may be located elsewhere or have a different name.

  • Locate the line that corresponds to the network interface you want to configure and modify. The line might look like “iface eth0 inet dhcp” or “iface ens33 inet dhcp” depending on your system configuration.
  • Change the line to the following format to configure a static IP address:

Replace [interface-name] with the name of the network interface you want to configure. Replace [desired-IP-address], [netmask], and [gateway-IP-address] with your desired IP address, netmask, and gateway IP address respectively.

For example, if you want to configure a static IP address for the eth0 interface with an IP address of 192.168.0.100, a netmask of 255.255.255.0, and a gateway of 192.168.0.1, the modified lines would look like this:

iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1

  • Save the changes and exit the text editor.
  • Restart the networking service to apply the new static IP configuration. You can do this by running the following command:

sudo systemctl restart networking

  • Verify the changes by running the ifconfig command or using the Network Manager GUI. The network interface should now be assigned the static IP address you configured.

By following these steps, you can easily configure a static IP address in Linux. This method ensures that your system always uses the same IP address, which is particularly useful for devices that require a stable and predictable network configuration.

Remember to adjust the network configuration file and interface name according to your Linux distribution and network setup.

Now that you understand how to configure a static IP address, let’s explore the final method: using DHCP to obtain a dynamic IP address in Linux.

Method 4: Using DHCP to Obtain a Dynamic IP Address

DHCP (Dynamic Host Configuration Protocol) allows Linux systems to automatically obtain IP addresses from a DHCP server. This method is suitable for users who prefer automatic IP address assignment and don’t require a specific IP address for their system. Follow these steps to use DHCP to obtain a dynamic IP address:

  • Open the network configuration file in a text editor. The location and filename may vary depending on your Linux distribution, but it is commonly found at “/etc/network/interfaces”.
  • Locate the line that corresponds to the network interface you want to configure.
  • Change the line to the following format to use DHCP:

iface [interface-name] inet dhcp

Replace [interface-name] with the name of the network interface you want to configure. For example, if you want to use DHCP for the eth0 interface, the modified line would look like this:

iface eth0 inet dhcp

  • Restart the networking service to apply the new configuration. You can do this by running the following command:
  • Your Linux system will now use DHCP to obtain a dynamic IP address. The DHCP server on the network will assign an IP address to your system automatically.
  • Verify the changes by running the ifconfig command or using the Network Manager GUI. The network interface should now be assigned a dynamic IP address.

Using DHCP to obtain a dynamic IP address is a straightforward method that allows for automatic IP address assignment. This approach is ideal for users who prefer ease of configuration and don’t require a specific IP address for their system.

With this method explored, you now have a comprehensive understanding of different ways to change the IP address in Linux. Whether you prefer using the command-line interface, the Network Manager GUI, configuring a static IP address, or relying on DHCP for dynamic IP assignment, Linux provides the flexibility to adapt to your networking requirements.

Frequently Asked Questions (FAQs)

Here are some frequently asked questions about changing IP addresses in Linux:

  • Can I change my IP address without restarting the system?

Yes, you can change your IP address without restarting the system. In most cases, modifying the network settings or restarting the networking service will apply the changes immediately without requiring a system reboot.

  • Will changing my IP address affect my internet connection?

Changing your IP address may temporarily interrupt your internet connection while the changes take effect. However, once the new IP address is assigned and the network is reconfigured, your internet connection should resume normally.

  • Can I assign multiple IP addresses to a single network interface?

Yes, you can assign multiple IP addresses to a single network interface in Linux. This is known as IP aliasing or multiple IP address configuration. It allows a single network interface to have multiple IP addresses, each serving different purposes or applications.

  • Can I revert back to my original IP address after changing it?

Yes, you can revert back to your original IP address by modifying the network configuration settings or restarting the system. Alternatively, if your network uses DHCP to assign IP addresses dynamically, you can simply disconnect and reconnect to the network to obtain your original IP address.

  • Are there any security considerations when changing the IP address?

Changing your IP address can provide some level of security by making it more challenging for potential attackers to target your system. However, it is important to remember that changing the IP address alone is not a comprehensive security measure. It is recommended to implement additional security measures, such as using firewalls and keeping your system up-to-date with patches and security fixes.

These are some common questions that arise when it comes to changing IP addresses in Linux. If you have further inquiries or encounter specific issues, it is advisable to consult relevant documentation or seek guidance from the Linux community.

Changing the IP address in Linux is a valuable skill that allows for better control over network connections and can address various needs such as accessing restricted content, troubleshooting network issues, and enhancing security. In this article, we explored different methods to change the IP address in Linux.

We started by discussing the benefits of changing the IP address, including accessing geographically restricted content, enhancing privacy and security, troubleshooting network issues, and more. Understanding these reasons can help users make informed decisions regarding their IP address modifications.

We then explored four different methods to change the IP address in Linux:

  • Method 1: Changing IP Address Using Command Line Interface (CLI): This method involves using networking commands in the terminal to modify the IP address directly. It is suitable for users who prefer the command line and have knowledge of Linux networking commands.
  • Method 2: Changing IP Address Through Network Manager GUI: This method utilizes the graphical user interface of the Network Manager tool to modify the IP address. It is user-friendly and ideal for those who prefer a visual approach.
  • Method 3: Configuring a Static IP Address in Linux: This method involves manually assigning a specific IP address to the network interface. It ensures a consistent and predictable IP address, making it useful for servers and devices that require remote access.
  • Method 4: Using DHCP to Obtain a Dynamic IP Address: This method allows the system to automatically obtain an IP address from a DHCP server, making it convenient for users who prefer automatic IP address assignment.

Each method has its own advantages and use cases, providing flexibility for different user preferences and networking requirements.

By mastering these methods, Linux users can effectively manage their network connections and make necessary IP address modifications when needed. Whether you are a beginner or an experienced Linux user, having the ability to change the IP address in Linux is a valuable skill that can enhance your overall network management experience.

Now, armed with this knowledge, you can confidently navigate the Linux environment and make necessary changes to your IP address as required. So go ahead, explore the different methods, and unlock the full potential of your Linux system!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

  • Crowdfunding
  • Cryptocurrency
  • Digital Banking
  • Digital Payments
  • Investments
  • Console Gaming
  • Mobile Gaming
  • VR/AR Gaming
  • Gadget Usage
  • Gaming Tips
  • Online Safety
  • Software Tutorials
  • Tech Setup & Troubleshooting
  • Buyer’s Guides
  • Comparative Analysis
  • Gadget Reviews
  • Service Reviews
  • Software Reviews
  • Mobile Devices
  • PCs & Laptops
  • Smart Home Gadgets
  • Content Creation Tools
  • Digital Photography
  • Video & Music Streaming
  • Online Security
  • Online Services
  • Web Hosting
  • WiFi & Ethernet
  • Browsers & Extensions
  • Communication Platforms
  • Operating Systems
  • Productivity Tools
  • AI & Machine Learning
  • Cybersecurity
  • Emerging Tech
  • IoT & Smart Devices
  • Virtual & Augmented Reality
  • Latest News
  • AI Developments
  • Fintech Updates
  • Gaming News
  • New Product Launches

Close Icon

How To Add Friends On Minecraft PC

How much is minecraft on nintendo switch, related post, how much is a realm in minecraft, how to join servers on minecraft ps4, how to open a door in minecraft, how to go third person in minecraft, how to make automatic door minecraft, related posts.

How To Configure Ip Address For Ethernet

How To Configure Ip Address For Ethernet

How To Setup A Linux Server For Remote Accessing IoT Devices

How To Setup A Linux Server For Remote Accessing IoT Devices

How To Find A Device IP Address

How To Find A Device IP Address

How To Find My Ip Address For Wifi

How To Find My Ip Address For Wifi

How To Change The IP Address On My Computer

How To Change The IP Address On My Computer

How To Find Default Gateway IP Address

How To Find Default Gateway IP Address

How To Find The IP Address Of A Website

How To Find The IP Address Of A Website

How To Assign IP Address

How To Assign IP Address

Recent stories.

How To Add Friends On Minecraft PC

AI Fail To Provide Accurate Voting And Election Information

Bumble Announces Layoffs And App Overhaul Amid Financial Struggles

Bumble Announces Layoffs And App Overhaul Amid Financial Struggles

How To Go Third Person In Minecraft

  • Privacy Overview
  • Strictly Necessary Cookies

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Linux System Computers

How to Change IP Address in Linux: Step-by-Step Guide

Changing the IP address in Linux can be a useful skill to have, whether you need to troubleshoot network connectivity issues or simply want to configure your system to work on a different network. In this step-by-step guide, we will walk you through the process of changing your IP address in Linux. By following these instructions, you will be able to easily modify your IP address and ensure that your system is connected to the desired network.

1. Open a terminal window

The first step in changing your IP address in Linux is to open a terminal window. This can be done by clicking on the terminal icon in your desktop environment or by using the keyboard shortcut Ctrl+Alt+T. The terminal window will provide you with a command-line interface where you can enter the necessary commands to change your IP address.

2. Check the current IP address

Before making any changes, it is important to check your current IP address. This will allow you to compare it with the new IP address after the change and ensure that the modification was successful. To check your current IP address, you can use the command “ifconfig” or “ip addr show” in the terminal. This will display a list of network interfaces along with their corresponding IP addresses.

3. Identify the network interface

Once you have checked your current IP address, you need to identify the network interface that you want to change the IP address for. This could be your Ethernet interface (e.g., eth0) or your wireless interface (e.g., wlan0). To identify the network interface, you can refer to the list displayed by the previous command. Take note of the name of the interface that you want to modify.

4. Disable the network interface

Before changing the IP address, you need to disable the network interface. This will temporarily disconnect your system from the network. To disable the network interface, you can use the command “sudo ifconfig [interface] down” or “sudo ip link set [interface] down” in the terminal. Replace [interface] with the name of the network interface that you identified in the previous step.

5. Change the IP address

Now that the network interface is disabled, you can proceed to change the IP address. To change the IP address, you can use the command “sudo ifconfig [interface] [new_ip_address] netmask [netmask]” or “sudo ip addr add [new_ip_address]/[netmask] dev [interface]”. Replace [interface] with the name of the network interface, [new_ip_address] with the desired IP address, and [netmask] with the appropriate netmask. This command will assign the new IP address to the specified network interface.

6. Set the network interface up again

After changing the IP address, you need to set the network interface up again to reconnect your system to the network. To set the network interface up, you can use the command “sudo ifconfig [interface] up” or “sudo ip link set [interface] up” in the terminal. Replace [interface] with the name of the network interface that you modified in the previous step.

7. Verify the new IP address

Once the network interface is set up again, you can verify the new IP address to ensure that the change was successful. To verify the new IP address, you can use the command “ifconfig” or “ip addr show” in the terminal. This will display the updated list of network interfaces along with their corresponding IP addresses. Check if the IP address of the interface you modified has been changed to the desired value.

8. Test the network connectivity

Finally, it is important to test the network connectivity to ensure that the IP address change was successful. You can do this by trying to access the internet or by pinging another device on the network. If you are able to establish a connection or receive a response from the ping, then the IP address change was successful and your system is now connected to the desired network.

Changing the IP address in Linux can be a straightforward process if you follow these step-by-step instructions. By opening a terminal window, checking the current IP address, identifying the network interface, disabling the interface, changing the IP address, setting the interface up again, verifying the new IP address, and testing the network connectivity, you can easily modify your IP address and ensure that your system is connected to the desired network.

1. Can I change the IP address of multiple network interfaces at once?

No, you need to change the IP address of each network interface individually. The steps outlined in this guide should be repeated for each interface that you want to modify.

2. Will changing the IP address affect my network settings?

Yes, changing the IP address may affect your network settings. It is important to ensure that the new IP address is compatible with your network configuration and that it does not conflict with any other devices on the network.

3. What should I do if I encounter any issues while changing the IP address?

If you encounter any issues while changing the IP address, you can try restarting your system or consulting the documentation for your specific Linux distribution. You can also seek assistance from online forums or communities dedicated to Linux networking.

Similar Posts

Best laptop for linux os: top picks for running linux operating system | find your perfect linux laptop today.

Looking for the best laptop for Linux OS? Check out our top picks for running the Linux operating system and find your perfect Linux laptop today!

When Did Linux Come Out? Uncover the Origins and Impact of Linux

Uncover the origins and impact of Linux. Learn when Linux came out, its significance, and how it became a cornerstone of the open-source movement. Find out more!

Monitor Mode in Kali Linux: Enable and Use Monitor Mode with Ease

Discover how to enable and utilize monitor mode in Kali Linux to analyze wireless networks and conduct security testing. Capture and analyze wireless traffic effortlessly. Start now!

Compare Linux Distros: Top Linux Distributions for Comparison | Find Your Perfect Linux Distro!

Find the ideal Linux distro for your needs. Compare top distros like Ubuntu, Fedora, Debian, and more. Discover your perfect Linux distribution today!

$user linux: Discover Popular Linux Distributions | Find Your Perfect Fit Today!

Find the perfect Linux distribution for $user linux. Explore popular options like Ubuntu, Fedora, Debian, CentOS, and more. Start your Linux journey today and unleash the power of open-source technology.

Linux ISO Creation: Step-by-Step Guide for Creating a Linux ISO | Get Started Now!

Discover the complete process of Linux ISO creation in our step-by-step guide. Choose a distribution, download the ISO, create a bootable drive, install Linux, and customize settings. Start creating your own Linux ISO today!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

 Powerful Protection for WordPress, from Shield Security

Tecmint: Linux Howtos, Tutorials & Guides

How to Set Static IP Address and Configure Network in Linux

If you are a Linux system administrator, time will come when you will need to configure networking on your system. Unlike desktop machines where you can use dynamic IP addresses, on a server infrastructure, you will need to setup a static IP address (at least in most cases).

Read Also: How to Set or Change System Hostname in Linux </p

This article is meant to show you how to configure static IP address on most frequently used Linux distributions.

For the purpose of this tutorial, we will use the following Internet Protocol version 4 (IPv4) details:

Configure Static IP Address in RHEL/CentOS/Fedora:

To configure static IP address in  RHEL / CentOS / Fedora , you will need to edit:

Where in the above "ifcfg-eth0" answers to your network interface eth0 . If your interface is named “ eth1" then the file that you will need to edit is "ifcfg-eth1" .

Let’s start with the first file:

Open that file and set:

Note : Make sure to open the file corresponding to your network interface. You can find your network interface name with ifconfig -a command .

In that file make the following changes:

You will only need to edit the settings for:

  • DNS1 and DNS2

Other settings should have already been predefined.

Next edit resolve.conf file by opening it with a text editor such as nano or vi :

Once you have made your changes restart the networking with:

Set Static IP Address in Debian / Ubuntu

To setup static IP address in Debian / Ubuntu , open the following file:

You may see a line looking like this:

Change it so it looks like this:

Save the file and then edit /etc/resolv.conf like this:

Restart the networking on your system with:

Your static IP address has been configured.

Conclusion:

You now know how to configure a static IP address on a Linux distro. If you have any questions or comments, please do not hesitate to submit them in the comment section below.

Previous article:

Next article:

Photo of author

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Related Posts

Fix “bash: curl: command not found”

How to Fix “bash: curl: command not found” Error

Advance Commands for Linux Admin

Level Up Linux: 20 Advanced Commands for Mid-Level Users

Extract Linux Tar Files Different or New Directory

How to Extract Tar Files to Specific or Different Directory in Linux

Debian Goodies Utilities to Manage Debian Packakges

8 Useful ‘Debian Goodies Utilities’ for Package Management

Delete User Accounts with Home Directory in Linux

How to Delete User Accounts and Their Home Directories in Linux

Find and Kill Running Processes in Linux

How to Find and Kill Running Processes in Linux

32 thoughts on “How to Set Static IP Address and Configure Network in Linux”

The time will come when you will need to configure networking on your system. Unlike desktop machines where you can use dynamic IP addresses, on a server infrastructure, you will need to set up a static IP address (at least in most cases).

Terrible – and my ‘ linux distro ‘ isn’t the same as yours, there’s no ‘ /etc/sysconfig/ ‘ folder.

In Ubuntu 20.04 there is no interfaces file they switch to netplan . If you can update this article to include the new change it will help a lot.

thanks Raouf

Well, this isn’t correct. Just trashed my Linux mint distro

Is it public Static IP? or can I use to access data from other networks?

Failed to restart network.service: Unit network.service not found.

I’m asking a question on a fairly old thread, but just in case, is it possible to do this on a WIFI network?

For example, when using the first command (# nano /etc/network/interfaces ) in Ubuntu, the result I see is:

There isn’t an “ eth0 ” on my server because it is connected by WIFI only. Will it still work using another option?

Yes it will work I think so, just change the settings in the interfaces file as explained in this article.

I set the static IP in ifcfg-eth0, added HWADDR and UUID, but on reboot system does not associate the IP to eth0.

This is VM. Any idea why its happening and steps to troubleshoot.

I think you need to make sure that you select “ manual ” and the correct IP address, subnet mask, and gateway and save the configuration as explained in the article. Also, I personally would select a new and different IP address, so that you can really check if it has been saved by opening the terminal and typing:

after a restart.

If i set ip address as static am not able to ping google.com why and also packages are not installed.

Please give me reply as soon as possible.

@Rajeshkar,

Please add the DNS Name servers in your /etc/resolv.conf file..

@Ravi Saive thanks for your reply , yes i did /etc.resolv.conf also but getting the same problem

@Rajesekar,

The file is /etc/resolv.conf , in this file add your DNS name servers for example.

When I enter the /etc/resolv.conf file, what is it supposed to look like? And when you say “edit” do you mean delete what’s there and write what you’ve provided, or just add new lines?

Hello Marin, Thank you very much for this article. It was a major help in my class project. This is my first time using a vm and it is an awesome learning experience. I’m really glad I ran into this article, it was well written and easy to follow.

Just wanted to say a million thank you’s for this well-written, comprehensive and easily-understood article! Awesome stuff! A real lifesaver too, as I had to quickly configure a static IP for myself to get access to remote computing. Thank you! :-D

A question from a linux newbie. Does this instruction apply for both ubuntu running on my desktop PC as well as debian linux on an embedded board?

Yes, the instructions will works on any Debian/Ubuntu based distribution without any issues..have you tried on your embedded board? does these instructions worked? let us know.

Hi Ravi, thanks for your reply.

Default the folder /etc/sysconfig does not exist on my embedded system. Of Course i could create it as well as the files mentioned, but it would be out of the context of this instructions.

Thanks, Rob

I found here very good stuff! You are doing an excellent job and I like your site! Thanks!

Thanks for finding this site very useful and thanks for appreciating our work, Keep visiting for more such useful articles…

Great job, I was I actually looking for an article like this one. So thank you so very much. Keep up the good work.

Thanks for appreciating and finding this article useful, keep connected to Tecmint for such wonderful articles…:)

What if I have 2 NICs on my server one for LAN & one for WAN and I want to set one of them (WAN) as default gateway? How to configure this server as gateway and as a router.

The easiest way to add default gateway using route command as shown:

Don’t forget to replace the gateway IP address and interface-name in the above command.

One can also use following command to setup static IP on eth0 interface for example. # ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up # route add default gw 192.168.0.1 # service network restart

Thanks for the tip, but I think setting IP address directly from the commandline using ifconfig and route will only allow you to set temporarily, once you reboot, these settings disappears. So, the best option to set static IP address permanently in network configuration files only….

wipe on reboot, so that best option is to set permannetly

Hello Ravi, What is difference between the service “NetworkManager” and “network”

@Augustine,

This article will help you to understand the difference between and NetworkManager and Network: http://askubuntu.com/questions/1786/what-is-the-difference-between-network-manager-and-ifconfig-ifup-etc

Why do we need to specify DNS in both ifcfg-eth0 and resolvlf.conf?

Hello Augustine,

Actually if you have added the DNS servers in the ifcfig-eth0 file the DNS servers will be automatically added to /etc/resolv.conf. You can skip defining the DNS servers in the ifcfig-eth0 file, but then you will need to have them set in /etc/resolv.conf manually. It’s a good practice to make sure that the DNS servers are specified correctly in both files, this is why the article says to set them in both files.

Got something to say? Join the discussion. Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Save my name, email, and website in this browser for the next time I comment.

ServerLog Header Logo

How to Change IP address in Linux

This post will discuss a step by step procedure of changing, adding and removing IPv4 and IPv6 address in RedHat and Debian based Linux distributions. As most of the server lacks Graphical User Interface only command line methods are configured here. We’ve used “nano” command line editing tools as “root” user. Use your suitable command line editor and prefix “sudo” to commands if you are not “root” but have “sudo” right to edit configuration file, alter and restart network interfaces. 

Difficulty: Easy           Time Required: Less than 5 minutes

Step 1: Identifying the network interface device

“ifconfig” display all available network interfaces. By default it’s installed, but if not, it must be installed from “base” repository using the following command

CentOS or RHEL

Debian and Ubuntu

Following is a sample output of ifconfig from CentOS 7.2 

ifconfig output from CentOS 7

In above configuration currently two network interface devices are present. ”eth0” and ”lo”. The interface “lo” stand for loop back device and act as interface for “localhost” that is t communicate within the device itself. So the primary interface device is “eth0” here. In your case this may be venet0 or anything else . 

Step 2: Changing IP address for desired interface. This can be achieved in two different way viz. using shell command or editing configuration file.

Problem with this method is those added or deleted IP addresses are not permanent in system and get deleted whenever the network interface is restarted or the system is rebooted

Editing Configuration file : A static IP address must be permanently added by editing configuration file. IP address added hence never get deleted on network restart or system reboot. This methods differ from RedHat to Debian based system and both are discussed bellow

ifcfg-eth0 file sample

  • DEVICE= Device Name, i.e. eth0 here
  • NM_CONTROLLED= The device is controlled by Network Manager or not. Keep it yes, else restarting network may not apply changes made on the file
  • BOOTPROTO= Options are “dhcp”, “static”. “dhcp” indicated IP address will be auto assigned to the device from ISP’s DHCP server. “static” means manually added static IP address
  • IPADDR=  This is the persistent static IPv4 address of your system. Change it with your desired IP address  to change the IPv4 of your system. Warning: Using an IP address that doesn’t assigned to you by your ISP will break network connectivity.
  • ONBOOT= “yes” indicate the device will start on system startup, “no” will do the reverse.
  • GATEWAY= IPv4 address of your ISP’s Gateway router (Provided by ISP)
  • IPV6INIT=”yes” indicates the Linux kernel will allow IPv6 connectivity for that device. “no” will break IPv6 connectivity for that device.
  • IPV6ADDR=””2001:470:1f06:1302::2/64″ indicates the present IPv6 address of the system. Change it with new IPV6 address.
  • IPV6_AUTOCONF=”no” indicates IPv6 Gateway will not be auto-configured by system. (I may be wrong here)
  • IPV6_DEFAULTGW=”fe80::1″ indicates the IPv6 address of your ISP’s gateway router.
  • IPV6_FAILURE_FATAL=”no” indicates if the system is unable to assign that IPv6 address to your device network will continue with IPv4 connectivity. Option “yes” will break network connectivity of the device “eth0” here in case of an IPv6 failure.
  • IPV6ADDR_SECONDARIES=”2a02:c207:2009:5972::200/64 2a02:c207:2009:5972::2001/64″ This define multiple extra IPv6 address in the system. Addresses are to be separated by space. And the entire value must be quoted . This is not mandatory for any other values in the configuration file. For outgoing connection system will use the last IPv6 address mentioned in this field, unless otherwise specified by outgoing traffic sending applications configuration file.

Now restart network using the following command to effct the modified configuration file.

ifaces configuration in debian

  • auto venet0:0 indicate name of the device, here “venet0:0”

Now restart network using the following command to make the change effect

Step 3: Testing the configuration: Use ping and ping6 to check newly added IPv4 and IPv6 address

If all configurations are correct you will get like following figure

ping and ping6 test for newly added IPv4 and IPv6

For any confusion or wrong explanation please leave a comment or email to admin at “admin”@”serverlog.net” or write author directly to “authorname”@”serverlog.net”. ServerLog welcome all to write here. For more please mail to Serverlog Admin. Thank you for reading us.

Visits: 542

  • What is a Daemon Process in RedHAT
  • How to Synchronize IIT Bombay gpo with Gmail

You May Also Like

Restart rooted android device without power button steps image

How to restart Android phone without pressing power button (root required)

Tenda N150 Router

How to set or reset Tenda N150 router Admin & Wifi Password

how to change ip address linux

A simple parent chield program in C with fork and execvp

Leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Setting a Static IP in Ubuntu – Linux IP Address Tutorial

In most network configurations, the router DHCP server assigns the IP address dynamically by default. If you want to ensure that your system IP stays the same every time, you can force it to use a static IP.

That's what we will learn in this article. We will explore two ways to set a static IP in Ubuntu.

Static IP addresses find their use in the following situations:

  • Configuring port forwarding.
  • Configuring your system as a server such as an FTP server, web server, or a media server.

Pre-requisites:

To follow this tutorial you will need the following:

  • Ubuntu installation, preferably with a GUI.
  • sudo rights as we will be modifying system configuration files.

How to Set a Static IP Using the Command Line

In this section, we will explore all the steps in detail needed to configure a static IP.

Step 1: Launch the terminal

You can launch the terminal using the shortcut Ctrl+ Shift+t .

Step 2: Note information about the current network

We will need our current network details such as the current assigned IP, subnet mask, and the network adapter name so that we can apply the necessary changes in the configurations.

Use the command below to find details of the available adapters and the respective IP information.

The output will look something like this:

image-14

For my network, the current adapter is eth0 . It could be different for your system

  • Note the current network adapter name

As my current adapter is eth0 , the below details are relevant.

It is worth noting that the current IP 172.23.199.129 is dynamically assigned. It has 20 bits reserved for the netmask. The broadcast address is 172.23.207.255 .

  • Note the subnet

We can find the subnet mask details using the command below:

Select the output against your adapter and read it carefully.

image-15

Based on the class and subnet mask, the usable host IP range for my network is: 172.23.192.1 - 172.23.207.254 .

Subnetting is a vast topic. For more info on subnetting and your usable IP ranges, check out this article .

Step 3: Make configuration changes

Netplan is the default network management tool for the latest Ubuntu versions. Configuration files for Netplan are written using YAML and end with the extension .yaml .

Note: Be careful about spaces in the configuration file as they are part of the syntax. Without proper indentation, the file won't be read properly.

  • Go to the netplan directory located at /etc/netplan .

ls into the /etc/netplan directory.

If you do not see any files, you can create one. The name could be anything, but by convention, it should start with a number like 01- and end with .yaml . The number sets the priority if you have more than one configuration file.

I'll create a file named 01-network-manager-all.yaml .

Let's add these lines to the file. We'll build the file step by step.

The top-level node in a Netplan configuration file is a network: mapping that contains version: 2 (means that it is using network definition version 2).

Next, we'll add a renderer, that controls the overall network. The renderer is systemd-networkd by default, but we'll set it to NetworkManager .

Now, our file looks like this:

Next, we'll add ethernets and refer to the network adapter name we looked for earlier in step#2. Other device types supported are modems: , wifis: , or bridges: .

As we are setting a static IP and we do not want to dynamically assign an IP to this network adapter, we'll set dhcp4 to no .

Now we'll specify the specific static IP we noted in step #2 depending on our subnet and the usable IP range. It was 172.23.207.254 .

Next, we'll specify the gateway, which is the router or network device that assigns the IP addresses. Mine is on 192.168.1.1 .

Next, we'll define nameservers . This is where you define a DNS server or a second DNS server. Here the first value is   8.8.8.8 which is Google's primary DNS server and the second value is 8.8.8.4 which is Google's secondary DNS server. These values can vary depending on your requirements.

Step 4: Apply and test the changes

We can test the changes first before permanently applying them using this command:

If there are no errors, it will ask if you want to apply these settings.

Now, finally, test the changes with the command ip a and you'll see that the static IP has been applied.

image-17

How to Set a Static IP Using the GUI

It is very easy to set a static IP through the Ubuntu GUI/ Desktop. Here are the steps:

  • Search for settings .
  • Click on either Network or Wi-Fi tab, depending on the interface you would like to modify.
  • To open the interface settings, click on the gear icon next to the interface name.
  • Select “Manual” in the IPV4 tab and enter your static IP address, Netmask and Gateway.
  • Click on the Apply button.

image-16

  • Verify by using the command ip a

image-18

In this article, we covered two methods to set the static IP in Ubuntu. I hope you found the article useful.

What’s your favorite thing you learned from this tutorial? Let me know on Twitter !

You can read my other posts here .

I am a DevOps Consultant and writer at FreeCodeCamp. I aim to provide easy and to-the-point content for Techies!

If you read this far, thank the author to show them you care. Say Thanks

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

XDA Developers

How to set a static internal IP in Ubuntu

Quick links, how to set static internal ip in ubuntu using the gui, how to set static internal ip in ubuntu using the terminal and text editor.

There comes a time when you might have to configure Ubuntu or any other Linux distribution with a static IP address. While you can't change your external static IP address, since it's the one your internet service provider provides, you can change your internal one. This is the IP address used on your network inside your home or office.

Though many tasks on Ubuntu usually require you to visit the terminal app and deal with lines of text, changing your internal IP is easy. You can do this through the settings app and the Graphical User Interface (GUI). Of course, if you want, you can also swap things out by going through the terminal. Here's how.

Without any technical know-how or knowledge, you can set a static IP in Ubuntu through the settings app. Just note, you will have to use the terminal once to find a range of IP addresses that you can assign. Once you do that, you just tap the Windows Key or the Superkey on your device and search for Settings . Once the app is open, proceed with the steps below.

  • If you're connected to the internet via Wi-Fi, choose Wi-Fi . If you're connected via Ethernet, select Network.
  • Once the interface is open, click the settings icon next to the network you're connected to.
  • From the list of tabs at the top, choose IPv4.
  • Under ipv4 method, be sure to choose Manual.
  • Under Addresses, enter the IP address, the Netmask, and the Gateway you want to use. For finding IP addresses that'll work on your network, you can proceed with the steps below.
  • Open a terminal session. With Ctrl, Alt, and T. Install net-tools with the command sudo apt install net-tools.
  • In this case, we have an inet of 192.168.1.176 and a netmask of 255.255.255.0. We can enter those numbers and can calculate the usable range using this website .
  • When you've calculated the usable range of addresses, choose a valid IP address that falls within this range. Then, you can click Apply at the top.

Any changes you apply will automatically go into effect. If you want, you can also use the terminal to confirm your IP address. Launch it with Ctrl, Alt, and T on your keyboard. Once launched, enter the command ip addr or ip a . You should see an interface IP address listed.

If you're a bit more technical and want to set a static IP in Ubuntu using the terminal, that is possible. You'll have to edit some lines of text and go through a few extra steps, but here's how:

  • Display information about your network. Use the command nmcli connection show. You'll see a network name, a UUID, a Type, and a Device. If this package isn't installed (though it should be, as it comes preinstalled with Ubuntu), then run sudo apt-get install network-manager
  • Note down the range of IP addresses you'll be able to use. Use the command ip addr to find out your machine's current IP address. This tutorial assumes that your network adapter is called enp0s3. If it isn't, then look for the correct one and also change the interface names in the subsequent commands. In the above example, we have an inet of 10.0.2.15, with the /24 denoting that the network uses a 255.255.255.0 subnet mask. In most cases, your usable network range will be whatever is in the first three places of the internal IP address, and then any unused number on your network between 1 and 255 in the last section. For example, we can use 10.0.2.16. If you're unsure, you can enter the subnet mask and your internal IP address into this website to calculate the usable range.
  • Note the IP address of your default gateway with the command ip r. In our example, it's 10.2.2.2.
  • Next, we'll add a new static connection option. Run the following command, making sure to change the numbers after "ip4" and "gw4" depending on your network conditions. These are the IP address you want to change your machine to and the current default gateway, respectively. sudo nmcli con add con-name "static" ifname enp0s3 type ethernet ip4 10.0.2.13/24 gw4 10.0.2.2 In our case, we do the following.
  • Set your DNS, manual DHCP (so, a static IP), and enable the connection. You can do that by running the following commands in succession. nmcli con mod "static" ipv4.dns "1.1.1.1,8.8.8.8" You can swap out the DNS servers above for whatever you want, they are in order of primary and secondary. nmcli con mod "static" ipv4.method manual; nmcli con up "static" ifname enp0s3 Once done, you can run nmcli con show to see if the new connection is enabled. If the output above looks like yours, then you're ready to go!

Setting complete

That's all you need to set up a static IP in Ubuntu. It doesn't take much effort. Remember, we're always writing about Linux, so you can check out our guide to the best Linux laptops should you need one.

How to set a static internal IP in Ubuntu

You are using an outdated browser. Please upgrade your browser or activate Google Chrome Frame to improve your experience.

Begin typing your search above and press return to search. Press Esc to cancel.

Linux Genie

How to Set Up a Static IP Address on Debian 12

How to Set Static IP Address on Debian 12?

A static IP address is an IP address that does not change/modify with time. It is useful for setting up servers, remote access, or other network services that require a fixed IP address (need to be reachable at a fixed location). By default, Debian 12 uses a dynamic IP address that is allocated by a DHCP server. However, you can configure your Debian 12 system to use a static IP address by editing the network configuration files.

This guide will explain all possible methods to set up a static IP address on Debian 12 along with the step-by-step instructions.

Prerequisite: Create a Backup File

Before network configuration, it is good practice to create a backup of the existing network settings via the “ cp ” command:

How to Set Up a Static IP Address on Debian 12?

There are different methods to set up a static IP address on Debian 12, depending on the network interface you are using. You can use either the command line or graphical interface to configure your network settings.

To set up a static IP address on Debian 12, follow these:

  • Method 1: Editing the /etc/network/interfaces File
  • Method 2: Using the nmcli (Command-line Tool)
  • Method 3: Using the nmtui (Text-based Interface)
  • Method 4: Using NetworkManager (Graphical-based Interface)

Let’s begin with the first method.

Method 1: Set Up a Static IP Address on Debian 12 Editing the /etc/network/interfaces File

The “ /etc/network/interfaces ” file is a configuration file that defines how the network interfaces are configured on the system. To change an interface’s IP address, first check its current IP address:

how to change ip address linux

Here, the network interface “ ens33 ” has the IP address “ 192.168.157.135 ”. The last IP address on the network is “ 192.168.157.255 ”, which is the broadcast address. The IP address must be in the range of “ 192.168.157.135 ” to “ 192.168.157.255 ”.

To set up a static IP address on Debian 12, edit the “/ etc/network/interfaces ” file and add the desired IP address, netmask, gateway, and DNS server for your interface. After saving the file, restart the network service to take effect as follow:

Step 1: Open /etc/network/interfaces File

First, access the /etc/network/interfaces file to edit the desired networking file via nano (editor):

how to change ip address linux

Step 2: Configure Network Interface

Find the line that starts with “ iface ” and match to the network interface for configuration. For instance, to configure the ethernet interface “ ens33 ”, add the following lines (address, netmask, gateway, and dns-nameservers):

Users can replace the values with your own:

how to change ip address linux

Save and close the file by pressing Ctrl+O and then Ctrl+X.

Note : Users can find the network interface using the “ nmcli connection show ” command by following the “ Device Name ” column.

IMPORTANT : Users ensure the default gateway is the same as the assigned IP address (for NAT or Bridged Network). Otherwise, look for “ iface ens33 inet dhcp ” and change the word “ dhcp ” to “ static ” by following the above configuration.

Step 3: Restart Networking Service

Finally, restart the networking service using the “ systemctl ” command or reboot the system for the changes to take effect:

how to change ip address linux

Step 4: Verify Set up IP Address

To check the static IP address on the running system, use the “ ip ” command with “ a ” utility:

how to change ip address linux

Finally, the static IP address has been set up using the “/ etc/network/interfaces ” file on Debian 12.

Note : Each method has independent settings/configurations to set up a static IP address on the Debian system.

Method 2: Set Up a Static IP Address on Debian 12 Using the nmcli

The nmcli is a part of the “ NetworkManager ” package that allows users to manage network connections from the terminal. This tool specifies the IP address, prefix, gateway, and DNS server associated with the device.

To set up a static IP address on Debian 12 using nmcli, follow these steps:

Step 1: List Network Connections

To list all the available network connections on the system, use “ nmcli ” command with “ connection show ”. It prints the network connections along with the connection name, UUID, connection type and device name:

how to change ip address linux

Step 2: Configure Network Connection

To configure the ethernet connection “ ens33 ”, use the “ Wired connection 1 ” in the below instructions:

Now, configure/modify connection settings. Such as IP address

  • Assign/Set Static IP Address

how to change ip address linux

  • Set Default Gateway

how to change ip address linux

  • Modify Configuration from Automatic to Static

how to change ip address linux

  • Set the DNS IP (Google DNS Server)

how to change ip address linux

  • Activate/Enable the Connection

how to change ip address linux

Note : To deactivate the connection, replace the “ down ” utility with the “ up ” utility in the above command.

Verify Static IP Address

how to change ip address linux

Tip: Add or Delete Network Connection

Restart the NetworkManager service by typing sudo systemctl restart NetworkManager or reboot your system for the changes to take effect:

Finally, the static IP address has been set up on Debian 12 using nmcli command line tool.

Method 3: Set Up a Static IP Address on Debian 12 Using the nmtui

The nmtui is another part of the “ NetworkManager ” package that allows you to manage the network connections from a text-based user interface (TUI).

To set up a static IP address on Debian 12 using nmtui, follow these steps:

Step 1: Launch nmtui Interface

First, type “ nmtui ” command to launch the interface, use the arrow keys, and Enter key to navigate through the menus and options

Step 2: Edit a Connection

Select “ Edit a connection ” option and press Enter:

how to change ip address linux

Select the connection (e.g., “ Wired connection 1 ”) that users want to configure and press Enter:

how to change ip address linux

It navigates to the “ Edit a connection ” interface. At there,

  • Select “ IPv4 CONFIGURATION ” and press Enter. Pick “ Manual ” from the list and hit the “ Enter ” button.
  • Select “ Show ” to add or edit the IPv4 addresses of the connection.
  • Enter the static IP address (192.168.157.10), gateway(192.168.157.2) and DNS servers (8.8.8.8 8.8.4.4) of the connection that users want to assign to the connection.

Scroll down, and hit the “ OK ” button to save the address and return to the previous menu:

how to change ip address linux

Step 3: Restart the NetworkManager Services

how to change ip address linux

Then, press the “ Activate/Deactivate ” for the changes to take effect. Finally, back, and then “ Quit ” to exit the interface:

how to change ip address linux

Step 4: Verify Static IP Address

Now, users can verify the Static IP address using the “ ip ” command with the “ a ” utility:

how to change ip address linux

This section has set up/configured the static IP address on Debian 12 using nmtui tool.

Method 4: Set Up a Static IP Address on Debian 12 Using NetworkManager

The GUI method is an easy-to-implement method for static IP address configuration. To set up a static IP address using the graphical interface. Here are the steps:

Step 1: Click on the Network Icon

Click on the network icon on the top right corner of the screen and select “Wired Settings

how to change ip address linux

Step 2: Access the Network Interface

In the “ Wired ” tab, hit the gear icon under the network interface for configuration:

how to change ip address linux

Step 3: Edit Network Information

In the “ IPv4 ” tab, switch the method from “ Automatic (DHCP) ” to “ Manual ”. After that, enter the IP address (192.168.157.135), subnet mask (255.255.255.0), gateway (192.168.157.135) and DNS servers (8.8.4.4, 8.8.8.8). Finally, click on “ Apply ” to save the changes:

how to change ip address linux

Note : If a user found any issue, check the Gateway that remains the same as in the previous configuration located in the “ Details ” tab.

Step 4: Restart Network Interface

Now, restart the network interface via toggle button for the changes to take effect:

how to change ip address linux

Step 5: Verification

User can verify the static ip address on settings by navigating to the “ Detail ” tab:

how to change ip address linux

In this way, a static IP address has been set up on Debian 12 using the GUI.

Setting up a static IP address on Debian 12 is a simple and useful task that can improve your network security and stability. To set up a static IP address on Debian 12, use the “ /etc/network/interfaces ” file, the “ nmcli ” tool, and the “ nmtui ” interface.

Alternatively, use the “ NetworkManager ” graphical tool and configure the IPv4 settings for your connection. The easiest method is to use the “ NetworkManager ” tool to static IP addresses on Debian 12.

This guide has explained all possible ways to set up a static IP address on Debian 12.

Print Friendly, PDF & Email

6 Linux commands to find Public IP addresses for your machine

Do you want to find the public IP address of your cloud server or any machine running with Linux distros such as Ubuntu, RHEL, AlmaLinux, Oracle, Debian, etc? Then the commands given in this article will surely help you a lot.

Finding the public IP address of your machine becomes necessary if you want to access some web application, set up remote access, do some troubleshooting work, or just for your knowledge want to know your machine’s virtual footprint. Here, we discuss how to use simple tools like curl and wget to network utilities like dig and nslookup to look for public IP addresses, each command offers a unique approach to revealing this essential detail.

Well, we can check our Private addresses simply by using the “ ip a” command but for public addresses, here are the commands to follow:

Curl is the default command utility available in almost all Linux out of the box and even if not then installation of cURL is quite easy. But do you know we can use it to fetch the details of our Public IP address attached to our Server? For example, we can use the CURL to get the details from “ifconfig.me “, here is the way to use it.

For Ipv4 public address:

To get an Ipv6 public IP address:

Note : “ -w “\n ” in the command is just to get the output in the next line, followed by the command prompt. If you want, you can use the command without it. Whereas -4 represents IPv4 and -6 for IPv6 addresses.

In the given screenshot, first, we identified our AWS Cloud server running Ubuntu Linux’s private IP address and then used the “ cURL ” command to get Public IP addresses – Ipv4 and Ipv6.

use curl to check Linux public IP address

If you don’t want to use the cURL and have “ wget ” on your system already then that can be used similarly to retrieve our public IP address with the help of ipecho.net service and print it to the terminal.

use Wget to get public Ipaddress

The dig is another popular command to find the public address of a particular domain name or simply your own. In the given command the “ dig ” will ask for the IP address of the domain myip.opendns.com from an OpenDNS resolver i.e “ resolver1.opendns.com ” which in return sends back the public IP address of the user who requested instead of myip.opendns.com because it is programmed in such as way.

4. nslookup

Instead of the “ dig ” command, we can use nslookup which works similarly to fetch the public IP address from the OpenDNS resolver. nslookup performs a DNS lookup for the myip.opendns.com domain using the OpenDNS resolver.

To get IPV4 using nslookup:

nslookup command to find public address

In this list of commands to find the Public IP address of your server or desktop another name is “ host ” like nslookup you can use it as well. Let’s see how to use it.

Ipv4 will be provided:

IPv6 will be in the output:

host command to get IP address public sever

6. ipconfig.io or ipinfo.io

Again if the first command given in this list that uses cURL is not working for you then you can go for the given ones:

You can add the -4 option in the above-given commands to get the IPv4 address.

So, these were a few commands we can use on our Linux server or desktop to quickly identify and note the Public IP address to perform some networking tasks or troubleshooting.

Other Articles:

How to find the IP address of a Guest in VirtualBox?

  • Installing CyberPanel on Ubuntu 22.04 LTS Linux Server

Use Cockpit as Virt-Manager alternative to manage KVM VMs

5 Commands to list IP Address Information on Ubuntu

5 Commands to list IP Address Information on Ubuntu

Newly installed Bitnami Ghost blog keeps redirecting to the LocalHost

Newly installed Bitnami Ghost blog keeps redirecting to the LocalHost

How to install KVM on Oracle Linux 9?

How to install KVM on Oracle Linux 9?

How to Install Cockpit-Podman for Container Management on Linux

How to Install Cockpit-Podman for Container Management on Linux

Leave a Comment Cancel reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed .

VideoGamer.com

How to make Palworld dedicated server – The ultimate guide

How to make Palworld dedicated server – The ultimate guide

Posted in Guides

Video Gamer is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Prices subject to change. Learn more

Making a dedicated server for Palworld is a must if you have a large community or want to play with your friends. You can have up to 32 players on the server, and each player can have multiple bases. Setting up a server can be somewhat complicated, which is why we prepared a guide for you. Our guide will cover multiple ways to set up a server, including the cheapest option.

It’s important to note that you’ll have to start over on a new server. Due to this, make sure to check out our Palworld beginner’s guide and choose the best location for your base .

Palworld dedicated server – Fast and easy setup

The easiest way to set up a Palworld dedicated server is by purchasing it from a server provider. Your server will be up and running within a few minutes, but there are also a few downsides. First, you won’t have entire control over your server, which is a big deal for many server administrators. Secondly, an easy installation comes at a cost, meaning that you may have to pay more for these types of servers.

Many different websites offer these services, but our recommendation is Shockbyte . This company offers a budget-friendly Palworld server starting at less than $9 per month. If you want a 32-player server, you’ll have to spend at least $15 a month for an annual plan.

To get started with your Palworld dedicated server, please follow these steps:

  • Open Shockbyte
  • Go to Palworld
  • Select server size (Lamball – 12 players, Grizzbolt – 32 players)
  • Click Order Now
  • Select your preferences and click on Continue
  • Pay for the server

A screen shot of the palworld dedicated server hosting page.

While Shockbyte advertises its Palworld server for only $19.99 for a monthly plan, the truth is that you’ll likely end up paying more. At the moment, the game is not optimized, so you’ll have to upgrade to at least 16 GB of RAM, which costs $36.00 per month. On top of this, you’ll have to spend $10 more to upgrade your CPU.

Renting a Palworld dedicated server through Shockbyte will likely be a great option in the future once Pocket Pair optimizes the game. At the moment, however, even a server with 16 gigabytes of RAM is not good enough, which is why we advise you to take a look at the next step.

How to set up a Palworld dedicated server on Linux

If you play Palworld on a computer, you can easily set up a server through Steam. However, we don’t advise this, as you’ll need to keep your computer running 24/7. On top of this, we don’t recommend playing Palworld on the same computer you use for hosting a dedicated server. Due to this, you’ll need to rent a server and install Palworld’s application on it.

Our step-by-step guide will lead you through the entire process of the setup. Once again, you can choose any server provider you like, from Google to Amazon. However, we recommend Hetzner due to low server costs. You can set up your Palworld dedicated server for as low as $13.50 through this provider, although you’ll need to have some technical knowledge about it.

To start, you’ll first have to rent a server. If you don’t already have a Hetzner account, make sure to make one.

A screenshot of a page with different logos on it, featuring a palworld logo.

Once you log in to your account, follow these steps:

  • Visit the Cloud section and create a new project
  • Open the project and click on the Add Server button
  • Choose the location of your server
  • Select Ubuntu 22.04 as the Image
  • Click on Dedicated vCPU under Type
  • Select CCX13
  • Click on Create & Buy Now on the right-hand menu

The CCX13 server is the cheapest dedicated server you can use for Palworld. It comes with two virtual CPUs, 8 GB of RAM, 80 GB of SSD storage, and costs just above $13 per hour. This is a slightly better configuration than what Shockbyte offers without any upgrades, yet it’s much cheaper, and you also receive full access to your server.

Linux dedicated server is amazing for Palworld

Running your Palworld dedicated server on a Linux system is a great idea. The only downside is that you won’t be able to install many mods on your server. However, it will be stable, and your users will love it.

It will take a minute or two for your server to start for the first time, and you will receive root access with a username and password to the email address. Once you receive these details, open the terminal to begin the setup of your Palworld dedicated server. When you open it for the first time, you’ll have to enter your username and password, then you’ll be prompted to change the password right away. After this, you can start installing and configuring your game server.

We recommend you use an SSH client to run commands, such as PuTTY . This free tool will allow you to easily access your server and copy-paste commands.

A screen shot of a computer screen with a black background showing the palworld dedicated server status.

1) Prepare Ubuntu system for Palworld dedicated server

The first thing you need to do is make sure your operating system is updated with the latest packages. To do this, run the following commands through the terminal:

When you’re done upgrading the system, you will need to add a new package that will allow you to install the dedicated server. To do this, run this command:

Finally, you need to add a 32-bit architecture.

2) Install Steam CMD

As you selected a Linux system for your Palworld server, you’ll have to install Steam CMD. This is a command-line version of the popular game launcher, and you need it to download the application for the dedicated server.

First, you will need to add the multiverse depository to your server.

After this, perform another update.

Finally, use the command to install SteamCMD, which we will use for the rest of the guide.

3) Create a new user for the dedicated server

We don’t recommend you use a root user to run a Palworld dedicated server or any other application on your system. Due to this, you need to create a new user on your system. In this guide, we will create a new user called “steam” with the following command:

We will use this username for the rest of our guide. You may change this to a different name, but it won’t make any difference. If you select a different name, however, make sure to change “steam” to your preferred username in every other command we post in this guide.

Once we create a new user, we need to link it to the SteamCMD tool. To do this, open the .bashrc file with your preferred text editor. You can use the following command to do so:

Scroll to the bottom of the file and copy-paste the following:

After you make changes to the file, press CTRL+X to exit. You may also need to press the Y button and confirm it with the Return key to apply changes.

Once you save the file, you will be ready to use your new user account. At this point, you need to swap to the new user with this command:

Finally, use the cd (change directory) command to change to the home directory of this new user.

4) Perform final steps for server installation

After adding all the necessary repositories and creating a new user, it’s time to install another requirement for the Palworld dedicated server. To run the server, you need to install the Steamworks SDK redistributable with the following command:

Once this is done, you need to create a directory that will contain the “steamclient.so” file.

Finally, you need to copy the file you acquired by installing the Steamworks SDK redistributable. You will put the file in a newly created directory from the previous step.

5) Install the Palworld dedicated server

If you’ve followed all the steps so far and haven’t run into any issues, you will be able to install the Palworld dedicated server. More specifically, you will download a large file from Steam, which will allow you to have your own gaming community in the game.

To begin installing the server, use the command below.

This process might take a while, as the dedicated server file is quite big.

6) Run the server

Once you’re done with the installation, you will need to change the installation directory. Again, we will use the cd command, but this time, we will put the entire path to the directory.

At the end, you simply need to use this short command to start the server:

If you intend this to be a Community server, use the following command instead:

To connect to your Palworld dedicated server, all you need to do is launch the game, go to Multiplayer, and enter the IP address of your Hetzner server at the bottom of your screen. Make sure to add :8211 at the end, which is a default port.

If you used the second command to start the server, it will appear on the list of Community servers. This will make it much easier for other players to find it, although you may run into cheaters and hackers while playing the game.

How to change settings on your Palworld server

Whether you play Palworld in a single-player mode or on your own dedicated server, you can change in-game settings. These settings affect the catch rate of Pals, day-and-night cycles, and much more. On top of that, you need to change these settings to configure the name of your server, admin password, and many other options.

Pocket Pair provides default Palworld settings that you need to copy to your installation directory and change. To do this, use the following command:

After using the command, you need to edit a configuration file. We will provide you with a command you can use to do so, although we recommend you use an FTP client, such as FileZilla , to access and edit your files more easily.

Editing this file will allow you to fine-tune your Palworld dedicated server. Feel free to play with different settings and discuss different options with your community. We advise you to increase the XP rate in the beginning, allowing players to easily catch up with their single-player progress.

Since you will be the owner of the server, you need to set up its password. To do so, find the following and replace it with your password.

To set a password for your Palworld server, you simply need to put it between the quotation marks and save the file. You can activate admin commands by typing in /AdminPassword [yourpassword] in the game chat. For the full list of commands, please visit our guide for Palworld admin controls and console commands .

Run your server at the system boot

Palworld is a poorly optimized game, which makes sense considering it’s in early access. Unfortunately, this means that your dedicated server will likely crash from time to time. As you will not always be online to run it again, we advise you to make it run whenever your system boots. On top of this, the server will restart itself whenever it crashes.

If you are still using the steam user, use the exit command to go back to the root user.

After this, you need to create a new file that tells the system to start and restart your Palworld dedicated server. To do this, either use an FTP client or the following command:

The file should be blank, and you need to copy-paste the following code into it.

During this process, you will add a few more arguments, such as -useperfthreads, which will make your server run faster. Furthermore, your Palworld dedicated server will automatically check the game version before running and automatically update if necessary, and the restart command will help keep the server online 24/7.

Once you add these lines to the file, save it with CTRL+X and exit. This file will also create a new service on your Linux system, and you’ll need to start it.

If this command doesn’t work, that’s because the Palworld server is already running. Therefore, there is no need to start it.

Finally, we want this service to start whenever we boot the system, so we’ll use a slightly different command for this.

Palworld dedicated server – FAQ

How can i make my own dedicated server for palworld.

Our guide above explains detailed steps you need to take to install a Palworld dedicated server. However, you can also use services that automatically set this up for you, although you’ll end up paying more without having full control over your server.

My Palworld server keeps crashing, why is that?

If your server keeps crashing, you likely run out of memory to run it. Unfortunately, the video game is not optimized, which is why it requires a vast amount of resources. If these crashes occur every few hours, try to upgrade to at least 16 GB of RAM. At this stage of the game, we recommend having at least 32 gigabytes if you intend to have more than 10 concurrent players on your server.

How can I ban cheaters from Palworld?

To keep your server clean, you will need to use the /BanPlayer command, followed by the player’s Steam ID. To use this command, you will first have to use the /AdminPassword command.

IMAGES

  1. How To Change IP Address with Terminal on Linux

    how to change ip address linux

  2. How to Change IP Address in Linux

    how to change ip address linux

  3. How to configure IP address in Linux

    how to change ip address linux

  4. How to change IP address in Linux by command line

    how to change ip address linux

  5. How to Change IP Address in Linux

    how to change ip address linux

  6. How to change the IP address on Ubuntu

    how to change ip address linux

VIDEO

  1. Change IP address in Linux. Linux for Beginners. Episode 23 #learn_linux #linux

  2. Setting IP address Debian 12 #linux #debian12

  3. Konfigurasi IP Address

  4. how to get ip address on linux system

  5. Linux change IP address Fedora

  6. How to Find IP Address in Ubuntu using Commands and GUI

COMMENTS

  1. How to Change IP Address in Linux

    Quick Tip How to Change IP Address in Linux Learn different ways of changing the IP address in Linux. Also learn how to make the changes [ermanent. Sep 20, 2022 — Team LHB How to Change IP Address in Linux 10 Sec Bitcoin ETFs Opened a Gateway for Capital: Michael Saylor As a sysadmin, you'll often deal with IP address configuration.

  2. How To Change IP Address on Linux

    To change your IP address on Linux, use the "ifconfig" command followed by the name of your network interface and the new IP address to be changed on your computer. To assign the subnet mask, you can either add a "netmask" clause followed by the subnet mask or use the CIDR notation directly.

  3. 3 Ways to change ip address in Linux

    To change IP address in Linux, we can use "ifconfig" command. Type ifconfig followed by the name of your network interface and the new IP address. Press enter. The new ip address will be assigned to this interface. For example, ifconfig eth0 192.168..100 netmask 255.255.255. will change the ip address on eth0 to 192.168..100.

  4. Manual Network Configuration in Linux and How to Set a Static IP Address

    Administration Networking ip systemctl 1. Introduction Many Linux distributions come with a network manager. In theory, it should help during the networking setup. Yet, we might not always want to install or use managers when setting up an interface.

  5. How to Set a Static IP Address in Ubuntu

    Quick Links What Is a Static IP Address? Setting a Static IP in Ubuntu Set a Static IP in Ubuntu with the GUI Connection Convenience Key Takeaways After gathering your connection name, subnet mask, and default gateway, you can set a static IP address in the terminal using the nmcli command.

  6. How to Change Your IP Address From the Command Line in Linux

    sudo route add default gw 192.168..253 eth0 To see your new setting, you will need to display the routing table. Type the following command at the prompt, and then hit Enter: route -n Related: That's all there is to changing your IP address from the terminal.

  7. How to Use the ip Command on Linux

    Key Takeaways The ip command has replaced the older ifconfig command in modern versions of Linux. The ip command allows you to configure IP addresses, network interfaces, and routing rules on the fly without rebooting. Run "ip addr" in the Terminal to get your PC's local IP address.

  8. How to Change IP Address in Linux [3 Effective Methods]

    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: Open a Terminal window. Identify the network interface you want to modify by running the command: <strong>

  9. How To Change IP Address Linux

    Method 1: Changing IP Address Using Command Line Interface (CLI) The CLI is a powerful tool for Linux users to change their IP address. By utilizing commands such as ifconfig and ip, users can easily modify their network settings directly from the terminal.

  10. How to Configure Static IP Address on Ubuntu 20.04

    5 min read This article explains how to set up a static IP address on Ubuntu 20.04. Typically, in most network configurations, the IP address is assigned dynamically by the router DHCP server. Setting a static IP address may be required in different situations, such as configuring port forwarding or running a media server .

  11. How to Change IP Address in Linux: Step-by-Step Guide

    To change the IP address, you can use the command "sudo ifconfig [interface] [new_ip_address] netmask [netmask]" or "sudo ip addr add [new_ip_address]/ [netmask] dev [interface]". Replace [interface] with the name of the network interface, [new_ip_address] with the desired IP address, and [netmask] with the appropriate netmask.

  12. How to Set Static IP Address and Configure Network in Linux

    Gateway: 192.168..1 DNS Server 1: 8.8.8.8 DNS Server 2 : 4.4.4.4 Configure Static IP Address in RHEL/CentOS/Fedora: To configure static IP address in RHEL / CentOS / Fedora, you will need to edit: /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 Where in the above "ifcfg-eth0" answers to your network interface eth0.

  13. How to Change IP Address on Linux?

    Step 1: Display Network Details Execute the " ifconfig " command to display the current interface details, including its IP address: # ifconfig Here, the " ens33 " is the network interface having an IP address "192.168.253.130". Step 2: Network Interface Down The "ens33" interface is in running status.

  14. Change IP address on Ubuntu Server

    Follow the step by step instructions below to change the IP address on server by setting a static IP. Locate and edit with administrative privileges the /etc/netplan/50-cloud-init.yaml file (it may be called /etc/netplan/01-netcfg.yaml instead) with the following configuration.

  15. Linux change ip address

    A. There are different ways to change IP address in Linux (a) Command Line tools (b) Modify configuration files (c) Use GUI tools Task: Display current IP address and setting for network interface called eth0 Use ifconfig command: # ifconfig eth0 Output: eth0 Link encap:Ethernet HWaddr 00:30:48:5A:BF:46

  16. Netplan static IP on Ubuntu configuration

    Click on top right network icon and select settings corresponding to the network interface you wish to assign with the static IP address. Select wired or Wifi network settings. Next, click on the gear box icon next to your network connection you wish to configure. This could be wired or wireless connection.

  17. How to Change IP address in Linux

    Step 2: Changing IP address for desired interface. This can be achieved in two different way viz. using shell command or editing configuration file. Using Shell Command: This is rather easy method for adding and deleting IP address. Different command line tools like "ifconfig", "ip addr" may be used. This commands are mostly operating ...

  18. Setting a Static IP in Ubuntu

    To open the interface settings, click on the gear icon next to the interface name. Select "Manual" in the IPV4 tab and enter your static IP address, Netmask and Gateway. Click on the Apply button. Manually setting a static IP using Ubuntu Desktop. Verify by using the command ip a.

  19. How to change IP address on RHEL 8 / CentOS 8 Linux

    You can manually change your IP address by modifying the corresponding configuration file for each network card. First see how your network cards are named by invoking ifconfig in a Terminal window: $ ifconfig or $ ip a The output for a wired connection should name your network card something like ens33.

  20. How to set up static IP address on Debian Linux 10/11

    See your new IP address assigned on Debian Linux. Again type the following ip command: $ ip -c addr show $ ip -c addr show enp0s5. When you change your IP address, you need to restart other services such as Nginx, SSH, etc. It all depends upon how you configured those services with IP binding.

  21. Linux ip Command with Examples

    For example, to bring the interface eth0 online, you would type:. ip link set eth0 up. And to bring if offline. ip link set eth0 down Displaying and Altering the Routing Table #. To assign, remove, and display the kernel routing table use the route object. The most commonly used commands when working with the routes objects are: list, add, and del. Display routing table #

  22. How to Set Static IP Address and Modifying Routing Table on Linux

    To configure a temporary IP address, use the following command syntax: ifconfig <interface> <ipv4address> netmask <subnetmask>. Assuming you want to make the following changes: The network device name is eth0. Change the IP address to the static value 192.168.1.10. Set the subnet mask to 255.255.255..

  23. How to configure a static IP address on CentOS 7 / RHEL 7

    Verification. Verify new IP settings using the ip command for the NIC named eth0: # ip a s eth0. Verify new routing settings: # ip r. Next, verify DNS servers settings using the cat command or grep command to query the /etc/resolv.conf file as follows: # cat /etc/resolv.conf. Finally verify the internet connectivity using the ping command:

  24. How to set a static internal IP in Ubuntu

    If you're connected to the internet via Wi-Fi, choose Wi-Fi.If you're connected via Ethernet, select Network.; Once the interface is open, click the settings icon next to the network you're ...

  25. How to Set Static IP Address on Debian 12?

    A static IP address is an IP address that does not change/modify with time. It is useful for setting up servers, remote access, or other network services that require a fixed IP address (need to be reachable at a fixed location). By default, Debian 12 uses a dynamic IP address that is allocated by a DHCP server.

  26. 6 Linux commands to find Public IP addresses for your machine

    For Ipv4 public address: curl -4 ifconfig.me -w "\n" To get an Ipv6 public IP address: curl -6 ifconfig.me -w "\n" Note: "-w "\n" in the command is just to get the output in the next line, followed by the command prompt.If you want, you can use the command without it.

  27. linux

    My server has 5 different external IPs (all working) I added them by using: ip addr add xx.xx.xx.xx/32 dev eth0 ip addr add yy.yy.yy.yy/32 dev eth0 ip addr add zz.zz.zz.zz/32 dev eth0 How can I

  28. How to make Palworld dedicated server

    How to set up a Palworld dedicated server on Linux. ... Finally, use the cd (change directory) command to change to the home directory of this new user. ... and enter the IP address of your ...