Network Configuration

Manually configure network in Debian

If you are manually setting a static IP address in Debian, you have to edit /etc/network/interfaces. For example, if you want to change your eth0 interface to use a static IP address instead of dynamic IP address , change the following settings accordingly.

#iface eth0 inet dhcp #Comment this line out with the pound(#) key. It was your dhcp setting(dynamic IP address).
# Add the following lines below in /etc/network/interfaces.
# Add the 'auto' line below. Otherwise, at reboot eth0 interface will not be up. You have to manually run ifup eth0.
auto eth0
# Set eth0 interface to use static IP address
iface eth0 inet static
    # Enter your static IP address for eth0 interface.
    # Enter the IP address of your gateway(router).

Make sure that the nameserver in /etc/resolv.conf as follows:


Then, run the following for the changes to take effects:

/etc/init.d/networking restart
ifdown eth0
ifup eth0


Debian's network configuration manual

/etc/resolv.conf - your name servers go in there /etc/hostname - hostname for your box /etc/hosts

ifconfig eth0 netmask up #computer
route add -net netmask eth0 #network
route add default gw eth0 #router/gateway