Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to configure my Debian machine (Lenny) to use a static ip address. Here's what my interfaces file currently looks like:

# This file describes the network interfaces available on your system.
# and how to activate them. For more information, see interfaces

#The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

Here's what I've done. I went in to my router settings and changed it's dynamic ip range to to So I could use anything above 100 as my static address. Then I came in to the interfaces file and edited to what you see above. I set the address to be because that's out of the range that's reserved for dynamic addresses by my router and I also set the network to because that's the ip address of my router.

I'm not sure what i'm getting wrong but I have no connection to the internet. I'm not sure i've got the right IP addresses.

Any ideas?

share|improve this question
up vote 5 down vote accepted

You should add "gateway" and change the network entry to "network".

share|improve this answer
Actually, he can go ahead and get rid of the network statement. It is only required for ancient kernels. – Jason Berg Jul 24 '10 at 18:38
Hi, Thanks for the reply. I've done what you suggested. restarted the machine and noticed that on startup there was a message saying: configuring network interfaces..../etc/network/interfaces:11: duplicate interfaces Ifup: Couldn't read interfaces file "/etc/network/interfaces" So i went in to the network dirctory did a ls -a and there was a file called interfaces~ with exactly the same content. I removed it and re-booted but still have this message on startup. Double checked and there's only one interfaces file with the correct text in it. Any ideas? – elduderino Jul 24 '10 at 18:57
whoops my bad. Somehow an extra line of text was in the file iface eth0 inet static It works now :) Thanks – elduderino Jul 24 '10 at 19:15

Add the below configuration also.

Open /etc/resolv.conf. In it use the nameserver directive to specify your name server(s). The nameserver directive(s) will be searched in the order entered here. Here is an example: nameserver nameserver

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.