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

I am following this tutorial for setting up a testing server for my web development projects.

When I attempt setting up a static IP address (using the configuration below), I receive the error "ping: unknown host" when I attempt using ping.

auto eth0
iface eth0 inet static

Ping works fine when the configuration is:

auto eth0
iface eth0 inet dhcp

I am a novice to server setup and administration.

Here is the output from /sbin/ifconfig eth0, as requested:

eth0    Link encap:Ethernet HWaddr 00:08:a1:0d:93:a1
        inet addr: Bcast: Mask:
        inet6 addr: fe80::208:a1ff:fe0d:93a1/64 Scope:Link
        RX packets:69 errors:0 dropped:0 overruns:0 frame:0
        TX packets:303 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:9323 (9.3 KB) TX bytes:12240 (12.2 KB)
        Interrupt:21 Base address:0xd800

Output from route -n:

Kernal IP routing table
Destination    Gateway      Genmask        Flags Metric Ref  Use Iface  U     0      0    0   eth0        UG    100    0    0   eth0

DNS information from /etc/resolv.conf:

domain home
search home
share|improve this question
Are you sure you're using the correct subnet for the network you're on? Is the IP address of your router? Can you ping the router? – EEAA May 15 '10 at 20:27
@ErikA I just pinged my router ( and it says "Destination Host Unreacheable" – Mike Moore May 15 '10 at 20:35

1 Answer 1

up vote 1 down vote accepted

did you run /etc/init.d/networking restart

you can also do:

/sbin/ifconfig eth0 netmask up
/sbin/route add default gw eth0

that should bring up eth0, and allow you to try pinging things, if restarting networking fails

share|improve this answer
use /sbin/ifconfig eth0 to display what your network settings are, if you're still having problems, and post them to your question, so we can see. in /etc/network/interfaces i'm pretty sure you don't /need/ network and broadcast, just in case they're "wrong" – cpbills May 15 '10 at 19:59
@cpbills Restarting and the other suggestions did not fix the issue. I just posted the output from /sbin/ifconfig eth0 as you requested. Thank-you for your help. – Mike Moore May 15 '10 at 20:10
can you show us the output of route -n, also, check /etc/resolv.conf for DNS host data, you should have at least one nameserver entry – cpbills May 15 '10 at 20:23
@cpbills I just added output from route -n and /etc/resolv.conf – Mike Moore May 15 '10 at 20:34
if your router is, then you need to change your IP and gateway to be and – cpbills May 15 '10 at 20:38

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.