Debian 10 Static IP

Debian 10 static IP works just like the previous version. They changed the naming of the network interfaces in Debian 9. However if you have upgraded from Debian 8 or older, your LAN port is probably still named ETH0. These instructions require sudo or root.

Debian 10 static IP

Debian 10 static IP

This is how you set a Debian 10 static IP. First, you need to open /etc/network/interfaces with your favorite text editor. Nano is always installed so you can use that. I often use Vim since that is the editor I’m used to. If your Debian 10 is set up with a Dynamic IP, it probably looks something like this.

Debian 10 Static IP
Debian 10 with dynamic IP

Your interface might have a different name than enp1s0. What we need to do here is to change DHCP to static, and add the address, gateway, and netmask. Also, your network settings are most likely different from the settings on my network. I use the 192.168.2.0/24. Let’s look at an example from one of my servers at home.

ronny@db2:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0
iface enp1s0 inet static
address 192.168.2.82
netmask 255.255.255.0
gateway 192.168.2.1

Apply the changes

A restart of the network service is required to apply any new settings to the network interfaces. So if you are connected with SSH, you need to restart the computer to apply the settings. Because the connection will be lost when you restart the network service. 

To restart the network service, run this: /etc/init.d/networking restart

This will restart the network service, but will not work because the network interface will be down. So you need to get it up again by running this command: ifup enp1s0 (your actual interface instead of enp1s0)

To verify that the new IP address working, run this command: ip addr

You might see now that you have two inet addresses. You can actually use both. To get rid of your old dynamic IP address, you can just reboot your computer.

You can probably use your router to assign static IP addresses too. Check your router documentation on how to do this.

If you have Debian 9, here is how to set static IP.

A link to the Debian documentation.

About Author

Related Posts

php8 gd

PHP8 gd Activate after installation

PHP8 GD activate after installation. GD doesn’t get activated by default. Not even a reboot after installation will activate it. So how do we do it? In…

Debian 12: linux-image-6.1.0-10amd64

Troubleshooting dependency issues in Debian 12: Resolving linux-image-6.1.0-10amd64 package dependency problems. If you installed the Debian 12 from the live image the issue is the raspi-firmware. Even…

4 Best Free Nas Software That Is Open Source

Free NAS software or operating systems that are free to use and will turn a computer into a NAS more advanced than the dedicated boxes sold. What…

Raspbian default password

Raspbian default password

Looking for the Raspbian default password? It is the most essential username and password that you will need for your raspberry. At least if you are running…

OpenMediaVault default password

OpenMediaVault default password

OpenMediaVault default password is printed in the documentation. I did not see it the first time I installed it either. So I had to do some detective…

Debian change dns

Debian change DNS settings to a new DNS

Debian change DNS settings for speed improvement or privacy. It is really easy to do. So let us see how it’s done and get to it. The…

Leave a Reply