Debian: Configure a static IP address

In order to configure a network device statically, you have to edit /etc/network/interfaces:

# vi /etc/network/interfaces

There you can configure a static IP address and the subnet mask:

auto eth0
iface eth0 inet static

In order to have the changes enabled, you need to restart the network interface either with:

# /etc/init.d/networking restart


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


# ifdown eth0
# ifup eth0

You can then check the new eth0 settings with:

# ifconfig -a


Leave a Reply

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