- TechRepublic

Account Information

How to set a static IP address on Debian server
Share with Your Friends
Your email has been sent
Jack Wallen walks you through the process of giving a standard user sudo privileges so they can set a static IP address on Debian server.
Debian is one of the most reliable operating systems on the planet. Its slower release cycle means each iteration gets plenty of attention before each release. And Debian isn’t just for desktops. In fact, Debian has been deployed as a server for years.
The one thing many new admins might find with deploying Debian as a server is that setting an IP address isn’t exactly as intuitive as other distributions. RHEL-based Linux distributions have the nmtui ncurses tools for configuring network connections, and Ubuntu-based distributions have netplan. With Debian, setting a static IP address is a bit more old-school, so I’m going to show you how it’s done.
SEE: 40+ open source and Linux terms you need to know (TechRepublic Premium)
What you need to setup an IP address in a Debian server
To set the IP address on Debian server, you’ll need a running instance of the OS and either a user with sudo privileges or access to the root user account. I’ll show you first how to give a standard user sudo privileges.
How to give a standard user sudo privileges in a Debian server
Let’s create a new user first. I’ll demonstrate by creating the user olivia (you can name the user whatever you like). To do that, log into Debian server as the root user and issue the command:
adduser olivia
Once you’ve added the new user, add that user to the sudo group with:
sudo usermod -aG sudo olivia
Exit from the root user and log in with the new user account.
How to set a static IP address in a Debian server
The first thing you must do is locate the name of your network device. For that, issue the command:
ip -c link show
You should at least see two devices, lo (for loopback) and another named device (such as enp0s3).
Next, let’s back up the current network configuration file with the command:
sudo cp /etc/network/interfaces ~/
Open the configuration file for editing with the command:
sudo nano /etc/network/interfaces
If you find nano isn’t installed, add it with the command:
sudo apt-get install nano -y
With the interfaces file open for editing, you should see a DHCP configuration that looks like this:
# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet dhcp
Comment that block out so it looks like this:
# allow-hotplug enp0s3
# iface enp0s3 inet dhcp
Now, we can add the necessary configuration for a static IP address. Let’s configure enp0s3 to use the address 192.168.1.97, with a gateway of 192.168.1.1, and a DNS nameserver of 1.1.1.1. That configuration will look like this:
auto enp0s3
iface enp0s3 inet static
address 192.168.1.97
netmask 255.255.255.0
gateway 192.168.1.1
dns-domain example.com
dns-nameservers 1.1.1.1
Make sure to edit the above configuration to match your network scheme. Save and close the file.
Finally, restart the networking service with the command:
sudo systemctl restart networking
Make sure the networking configuration is correct, by issuing the command:
You should see the static IP address you configured. You’re good to go.
And that’s all there is to configure a static IP address in Debian server. Of course, if you installed your instance of Debian server with a desktop environment, you could simply use the GUI tool for this process. But for those who prefer to keep their servers sans GUI, this is the way to go.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Daily Tech Insider Newsletter
Stay up to date on the latest in technology with Daily Tech Insider. We bring you news on industry-leading companies, products, and people, as well as highlighted articles, downloads, and top resources. You’ll receive primers on hot tech topics that will help you stay ahead of the game.
- How to become a developer: A cheat sheet (TechRepublic)
- How-to guide for Linux administrators (free PDF) (TechRepublic)
- Linux 101: What tech pros need to know (TechRepublic Premium)
- Linux, Android, and more open source tech coverage (TechRepublic on Flipboard)
Contact Jack Wallen
Your message has been sent
- See all of Jack's content
- Open source
Editor's Picks

TechRepublic Premium editorial calendar: IT policies, checklists, toolkits and research for download
TechRepublic Premium content helps you solve your toughest IT issues and jump-start your career or next project.

The best payroll software for your small business in 2023
Looking for the best payroll software for your small business? Check out our top picks for 2023 and read our in-depth analysis.

Top cybersecurity threats for 2023
Next year, cybercriminals will be as busy as ever. Are IT departments ready?

Salesforce supercharges its tech stack with new integrations for Slack, Tableau
The company, which for several years has been on a buying spree for best-of-breed products, is integrating platforms to generate synergies for speed, insights and collaboration.

The best applicant tracking systems for 2023
Organize a number of different applicants using an ATS to cut down on the amount of unnecessary time spent finding the right candidate.

108 Excel tips every user should master
Whether you are a Microsoft Excel beginner or an advanced user, you'll benefit from these step-by-step tutorials.

IT training policy
Successful IT departments are defined not only by the technology they deploy and manage, but by the skills and capabilities of their people. IT workers must keep up to date with the latest technology trends and evolutions, as well as developing soft skills like project management, presentation and persuasion, and general management. Due to the ...
MSP best practices: Network switch and router maintenance checklist
Managed services providers often prioritize properly configuring and implementing client network switches and firewalls. However, regularly reviewing and updating such components is an equally important responsibility. It’s essential to ensure clients understand the necessity of regularly auditing, updating and creating new backups for network switches and routers as well as the need for scheduling the ...
Service level agreement policy
A service level agreement is a proven method for establishing expectations for arrangements between a service provider and a customer. SLAs involve identifying standards for availability and uptime, problem response/resolution times, service quality, performance metrics and other operational concepts. SLAs streamline operations and allow both parties to identify a proper framework for ensuring business efficiency ...
- TechRepublic on Twitter
- TechRepublic on Facebook
- TechRepublic on LinkedIn
- TechRepublic on Flipboard
- Privacy Policy
- Terms of Use
- Property of TechnologyAdvice
How to Set Static IP Address on Debian 11 (Bullseye)
In this guide, we will demonstrate how to set static ip address on Debian 11 (Bullseye).
When we install Debian Linux on our system then during the installation it tries to get DHCP ip address from modem (or dhcp server) if available. But it is always to recommended to have a static IP address on your system. The main benefit of Static IP address is that it will be persistent across the reboot.
In Debian 11, we can set the static ip address either via GUI (Graphical User Interface) or via command line (cli).
Set Static IP Address via GUI
Login to your Debian Desktop environment, From Settings –> Choose Network

Click on Wired Settings and then we will get the following window,
Note: To disable IPv6, go to IPv6 tab and choose ‘Disable’ option
Click on IPv4 Tab
Above window shows that Automatic DHCP is configured, so to configure Static IP choose Manual and then specify the IP details like IP address, netmask, gateway and dns server IP.
Note: To Specify the dns server IP first disable the automatic dns IP by toggling it.
Click on Apply to save the changes.
Now, disable and enable the interface by toggling it so that new IP address is assigned to the Interface.
Now again click on wired settings to verify whether the new static ip address is assigned or not.
Perfect, above confirms that new static IP address is configured successfully. Now let’s see the alternate way to configure IP address in Debian Linux.
Set Static IP Address via Command Line
Open the terminal and identify the interface on which we will configure static IP address. Run below ip command ,
Now run nmcli command to get connection name,
Once we get the connection name, run below nmcli command to assign static ipv4 address,
$ nmcli con mod ‘connection-name’ ipv4.address <IP-Address>
Set the gateway by running below
Change Configuration from DHCP to Manual , so that IP will be static and persistent, run
Set the DNS server IP by running below command,
Disable and enable the connection so that above changes come into the effect.
Now Run IP Command to check IP address,
Output of above commands would look like below:
Perfect, above output confirms that static IP address has been configured successfully on eth0 interface.
Set Static IP Address on Minimal Installed Debian 11
Whenever we install minimal Debian 11 then we will have only the CLI console and don’t have any nmcli utility. So, to configure static ip address we will edit the file ‘ /etc/network/interfaces ’.
Following is the default content in the file,
Edit the file and set the static IP address as shown below,
Delete the line ‘ allow-htplug enp0s3 ’ and change dhcp parameter to static . Below is my sample file, change interface name and ip details as per your environment.
save & close the file.
To make above changes into the effect the restart the network service
Now, run ip command to verify the ip address,
That’s all from this post. Please do share your feedback and queries in below comments section.
Also Read : How to Install Kubernetes Cluster on Debian 11 with Kubeadm
1 thought on “How to Set Static IP Address on Debian 11 (Bullseye)”
Nice Guide. Appreciate it.
In case someone has used “sudo raspi-config” > Advanced Options > Network Interface Names > Would you like to enable predictable network interface names ?
[email protected] :~ $ sudo nmcli connection modify Wired\ connection\ 1 ipv4.addresses 192.168.1.10/24 [email protected] :~ $ sudo nmcli connection modify Wired\ connection\ 1 ipv4.gateway 192.168.1.1 [email protected] :~ $ sudo nmcli connection modify Wired\ connection\ 1 ipv4.method manual [email protected] :~ $ sudo nmcli connection modify Wired\ connection\ 1 ipv4.dns ‘8.8.8.8’ [email protected] :~ $ sudo reboot
Leave a Comment Cancel reply

How-tos and tutorials for sys admins
How to Configure Static IP in Debian 10

When you install a new OS, by default it is configured to obtain a dynamic IP address from the DHCP server. However, sometimes you have to configure the static IP address on your machine. It can be for various reasons like when a service needs to connect through an IP address instead of a domain name or when you are hosting a web server or to give someone remote access to your system. Whatever the reason is, you must know how to configure a static IP in your system. This post will explain to you how to do this.
You can configure static IP in Debian 10 system using any of the following methods:
Configure Static IP through Command Line
Configure static ip through gui.
Let’s get started.
You can configure the static IP through /etc/network/interfaces file from your command line. However, for this, you first need to know the network interface name.
You can find the currently available network interface by running the below command in Terminal:
After running the above command, we received the following output.

Now we will open the interface configuration file and configure static IP for ens33.
To open network interface configuration file, execute the following command:
Then add lines in the following syntax replacing the interface with your network interface name and xxx.xxx.xxx.xxx with the relevant IP address.
For our network interface ens33, we have modified the configuration lines as follows:

Once you have completed the configurations, save and close the file.
Then restart the networking services. Use the below command to do so:
You can also use the ifdown and ifup command to apply the configuration changes. First, run the ifdown command to bring down the interface:
Then bring up the interface using ifup :
Now to verify if the IP address has been changed successfully, issue the below command in Terminal:

You can also change the static IP through the Settings utility in your Debian system. To launch the Settings utility in your system, right-click the desktop and then click Settings .

Then from the left pane in the Settings window, select the Network tab.

On the right pane, click the cog icon in front of the network interface you want to configure.

This will open the following configuration window where you will see the current IP 192.168.72.158 which is the IP address obtained from DHCP server. Go to IPv4 tab.

Then in the IPv4 Method , choose Manual .

Now the Addresses field will appear. Enter the IP address, Netmask, and Gateway for your interface. If you also want to set the DNS address manually, switch off the Automatic button and enter the DNS server address.
Here, we have specified 192.168.72.159 as our interface IP address, 255.255.255.0 as netmask, and the 192.168.72.2 ad the default gateway. Then we have specified 8.8.8.8 and 8.8.4.4 as our DNS servers.
Now click the Apply button to apply all the configuration changes.

Now to confirm if the new IP address has been successfully configured, go to the Details tab. Alternatively, you can also use the “ip a” command in Terminal to verify the IP address.
There you have the static IP configuration in Debian 10. Using either the command line or GUI method, you can easily configure the static IP address on your system.

Ummara Mushtaq is a Telecommunication engineer with two years of experience in server support and networking. She writes technical articles based on Linux system administration for LinuxWays.
- ← How to Change the Background in Zoom
- How to Find Your Public IP address in Ubuntu 20.04 LTS →
Similar Posts

Truncate Command in Linux

zstd – Open-Source Data Compression Algorithm in Linux

Top 5 Email Clients 2021

IMAGES
VIDEO
COMMENTS
The first option is to add IP address configuration directly into /etc/network/interfaces file. Append the following line to your existing /etc/network/interfaces: address 10.1.1.125 netmask 255.0.0.0 gateway 10.1.1.1 The resulting content /etc/network/interfaces file should look like the one below.
How to set a static IP address in a Debian server The first thing you must do is locate the name of your network device. For that, issue the command: ip -c link show You should at least...
Enter IP on Debian 10. Below that, there’s a blank table of addresses. Press the Add button next to it to set up a new static address. A new row will open up on the table. Enter your desired IP address in the Address cell and the IP of your router in the Gateway. The default Netmask is 255.255.255.0.
How to static IP address on Debian Linux The procedure is as follows to set up and configure a static IP information: Open the terminal application. Log in to remote or server using ssh command. Backup /etc/network/interfaces file running sudo cp /etc/network/interfaces /root/ Edit the /etc/network/interfaces
Set Static IP Address via Command Line Open the terminal and identify the interface on which we will configure static IP address. Run below ip command, $ ip add show Now run nmcli command to get connection name, $ nmcli connection Once we get the connection name, run below nmcli command to assign static ipv4 address, Syntax:
There are two ways of configuring a static IP on Debian. You can achieve this using GUI or on command-line. Configure Static IP Address using the Graphical User Interface ( GUI ) If you are running a Debian 11 desktop instance, log in using your username and password.
You can also change the static IP through the Settings utility in your Debian system. To launch the Settings utility in your system, right-click the desktop and then click Settings. Then from the left pane in the Settings window, select the Network tab. On the right pane, click the cog icon in front of the network interface you want to configure.