Configure static IP on Debian 8

by Daniel Pham
Published: Updated:

Configure static IP on Debian 8. I wrote a similar post for Ubuntu 16. Generally, Ubuntu-based or Debian-based operating systems have a pretty similar configuration.

Define the interface to configure static ip

Define the interface you want to set up. A server with multiple network interfaces is normal. So you need to determine which interface you want to configure the static IP.

You can use one of the following commands to display all the interfaces that are present in the server.

ifconfig -a
ip a
ip link show

Personally I think you should use the command ip link show.

Configure static IP on Debian

Step 1, open the /etc/network/interfaces file using the nano command below.

nano /etc/network/interfaces

Step 2, copy the following configuration to the file and change the information that matches your system. For example, I would set up an interface named eth1.

auto eth1
iface eth1 inet static
address 192.168.56.30
netmask 255.255.255.0
gateway 192.168.56.1
dns-nameservers 8.8.8.8 8.8.4.4
Configure static IP on Debian 8
Configure static IP for interface ‘eth1’ on Debian 8.

Step 3, restart the server’s network service to apply the new configuration. Note that you need to make sure that it is possible to console or connect to another server’s IP. Because after restart the network service, the old IP of the interface will be lost.

systemctl restart networking.service

Check new IP

Now you can type the following command to test whether the IP has been applied to the interface you want or not.

ip a | grep eth1
Configure static IP on Debian 8
Check new IP were successful apply.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.