Search The Site

Setup and Configure A Static IP On Debian

There are many reasons as to why you may want to set a static IP on your Debian box. For example you may want to run a Web server or a DNS server. If you are using CentOS or RedHat please view the following article for information on how to configure a static IP address in CentOS - Redhat and Fedora. Complete the following steps to set a static IP on your Debian box.

Edit the/etc/network/interfaces file. At a terminal window type in the following command nano /etc/network/interfaces and then add your values, when you are finished your file should look like the following:

  • #iface eth0 inet dhcp
    iface eth0 inet static
    address 192.168.1.200
    network 192.168.1.0
    dns-nameservers 192.168.1.1
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

Now we need to restart our networking by typing in the following: /etc/init.d/networking restart

If you want to switch back to a DHCP assigned IP address just reverse the procedure outlined above.