LKBEN11113: Howto configure a static IP Address on a debian GNU Linux System


You need to change from DHCP to static IP addressing for some reason


Static IP addressing is often used on server systems


To configure a static IP (an IP that will never change) in debian you must edit the file
/etc/networking/interfaces and put the following:


# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0

iface eth0 inet static

This information can even take DNS information too!

allow-hotplug eth0
iface eth0 inet static
 dns-domain lan

The reconfiguration of the network CANNOT be done with a dpkg-reconfigure command! This is only supported during installation.

To reconfigure the only thing to do is edit /etc/network/interfaces with a text editor, once
saved /etc/networking/interfaces you can restart networking with /etc/init.d/networking restart.

/etc/init.d/networking stop
/etc/init.d/networking start
/etc/init.d/networking restart

The network configuration package ifupdown delivers the basic networking functionality. The resolvconf package is used to supplement ifupdown to support reconfiguration of network address resolution by automating the writing of /etc/resolv.conf.


The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.