Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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 www.google.com" when I attempt using ping.

auto eth0
iface eth0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1 

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:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
        inet6 addr: fe80::208:a1ff:fe0d:93a1/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        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
192.168.0.0    0.0.0.0      255.255.255.0  U     0      0    0   eth0
0.0.0.0        192.168.0.1  0.0.0.0        UG    100    0    0   eth0

DNS information from /etc/resolv.conf:

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

1 Answer

up vote 1 down vote accepted

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

you can also do:

/sbin/ifconfig eth0 192.168.0.100 netmask 255.255.255.0 up
/sbin/route add default gw 192.168.0.1 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 192.168.1.1, then you need to change your IP and gateway to be 192.168.1.100 and 192.168.1.1 –  cpbills May 15 '10 at 20:38
show 2 more comments

Your Answer

 
discard

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.