# eth0 detected but can't ping or connect to internet (SOLVED)

## cocacola

For some reasons my gentoo is able to detect the ethernet card, but I can't ping to or connect to websites.

These are the config files that I have (i only configured this during installation):

```
/etc/hostname

127.0.0.1 localhost

::1 ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix

ff02::1 ipv6-allnodes

ff02::2 ipv6-allrouters

ff02::3 ipv6-allhosts

```

```
/etc/conf.d/net

config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"

```

and this is what i got for "ifconfig"

```

eth0     Link encap:Ethernet  HWADDR: xx:xx:xx:xx:xx:xx

         inet addr: 130.179.130.10 Bcast: 130.179.130.135 Mask: 255.255.248.0

         UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU: 1500 Metric: 1

         RX packets 25169 errors: 0 drop: 0 overruns: 0 frames: 0

         TX packets 27 errors: 0 drop: 0 overruns: 0 carriers: 0

         collision: 0 txqueuelen: 1000

         RX bytes: 2115205 (2.0 Mb) TX bytes: 2770 (2.7 Kb)

         Interrupt: 9 Base address: 0xa000

lo ....

```

anyone has any ideas why i got this problem?

greatly appreciate any suggests and comments.Last edited by cocacola on Sun Jan 28, 2007 11:24 pm; edited 1 time in total

----------

## Dan

whats the output of 

# route

#ping -c 3  google.com

and 

#ping -c 3 64.233.187.99

also post your /etc/resolv.conf

----------

## cocacola

here is the output for #route

```

Destination    Gateway        Genmask        Flags     Metric    Ref       Use       Iface

192.178.0.0    *              255.255.255.0  U         0         0         0         eth0

loopback       *              255.0.0.0      U         0         0         0         lo

default        192.178.0.1    0.0.0.0        UG        0         0         0         eth0

```

#ping -c 3 www.google.com

unknown host

#ping -c 3 64.233.187.99

```
3 packets transmitted, 3 received, 0% loss, time 2000ms

rtt min/avg/max/dev = 87.308/96.526/109.366/9.368 ms
```

and inside /etc/resolv.conf, there's nothing (it only has a comment about the lo)

----------

## defenderBG

your default gateway should be unreachable:

default        192.178.0.1    0.0.0.0        UG        0         0         0         eth0

because your ip address is (based on ifconfig):

inet addr: 130.179.130.10 Bcast: 130.179.130.135 Mask: 255.255.248.0

but u could ping google.com (when using the ip), so apperantly ur problem is the resolv.conf:

ask ur admin for the dns server ip and when u know it:

echo "nameserver <ip-add>" >> /etc/resolv.conf

u can try with 81.210.131.2 and 81.210.131.3:

echo "nameserver 81.210.131.2" >> /etc/resolv.conf

echo "nameserver 81.210.131.3" >> /etc/resolv.conf

----------

## jmack1010

You aren't letting dhcp set your nameserver settings automagically.  It is not necessary to go through the trouble of manually setting your dhcp info if you are using dhcp.  Just remove:

 *Quote:*   

> dhcp_eth0="nodns nontp nonis" 

 

from /etc/conf.d/net.

Your nameservers will be set by your isp's or home dhcp server.

Joe

----------

## cocacola

 *jmack1010 wrote:*   

> You aren't letting dhcp set your nameserver settings automagically.  It is not necessary to go through the trouble of manually setting your dhcp info if you are using dhcp.  Just remove:
> 
> dhcp_eth0="nodns nontp nonis"
> 
> from /etc/conf.d/net.
> ...

 

yes, i got it now, just by removing that line. Thanks, Joe.

Thanks defenderBG, and dcoats, too, for attempting to help  :Smile: 

----------

