# DHCP not working

## ey3s

Hey guys, so i just installed gentoo for the first time but I am having troubles connecting to the internet.  I am plugged in via ethernet, and I am using DHCP.

When I type the command /etc/init.d/net.eth0 start I get this:

*Caching service dependencies...                                     [OK]

*Loading networking modules for eth0

*modules:  apipa arping ccwgroup iptunnel macchanger macnet rename ifconfig system dhcpcd ip6to4

*ifconfig provides interface

*dhcpcd provides dhcp

*Configuring eth0 for MAC address (my mac address)    [OK]

*Bringing up eth0

*dhcp

*Running dhcpd...

eth0:  dhcpd 4.0.2 starting

eth0:  waiting for carrier

eth0:  timed out

My /etc/conf.d/net looks like this:

config_eth0=( "dhcp" )

Any ideas?  I've been searching through the forums and google and I haven't found a fix to this problem.

----------

## Hu

Obvious question first: is there a DHCP server on the network?  If so, is it allowed to service your MAC address?

----------

## ey3s

 *Hu wrote:*   

> Obvious question first: is there a DHCP server on the network?  If so, is it allowed to service your MAC address?

 

Yes, there is a dhcp server on the network and it is allowing my mac address. I am dual booting this same machine with windows and it works perfectly.

----------

## deadram

Find out what ip/gateway you get when you boot windows. Configure your network in gentoo for a statically ip. If your windows boot has a lease on that ip, then no other box on the network should have that one in use (and most routers should let that ip connect to the internet and such). Then find out if you can ping other networked computers, the gateway, your ISPs dns, an internet host etc...

I'm guessing your using a set-up of internet->router (like a linksys 4 port?)->this computer?

Worth noting that I've managed to break DHCP with iptables and/or with funky options in the proc file system. Your problem might be there?

----------

## UberLord

 *ey3s wrote:*   

> eth0:  waiting for carrier
> 
> eth0:  timed out[/b]

 

If you're sure the carrier is UP (cable plugged in and link active) then file a kernel bug that your driver ins't reporting it correctly.

Until it's fixed, you can pass dhcpcd the -K option to ignore network link status.

----------

## ey3s

 *deadram wrote:*   

> Find out what ip/gateway you get when you boot windows. Configure your network in gentoo for a statically ip. If your windows boot has a lease on that ip, then no other box on the network should have that one in use (and most routers should let that ip connect to the internet and such). Then find out if you can ping other networked computers, the gateway, your ISPs dns, an internet host etc...
> 
> I'm guessing your using a set-up of internet->router (like a linksys 4 port?)->this computer?
> 
> Worth noting that I've managed to break DHCP with iptables and/or with funky options in the proc file system. Your problem might be there?

 

Yeah, I've got the standard internet->router->my computer configuration using a linksys router.  I configured gentoo for a static ip and when I type /etc/init.d/net.eth0 start I get:

*Caching service dependencies... [OK]

*Loading networking modules for eth0

*modules: apipa arping ccwgroup iptunnel macchanger macnet rename ifconfig system dhcpcd ip6to4

system dhpcd ip6to4

*ifconfig provides interface

*dhcpcd provides dhcp

*Configuring eth0 for MAC address (my mac address) [OK]

*Bringing up eth0

*192.168.132                                                                   [OK]

*Adding routes

*default via 192.168.1.1...                                                [OK]

which looks good right?

Now when I ping 192.168.1.1 I get the message "Destination Host Unreachable"

I get this same message when I try to ping other computers on my network too.

 *UberLord wrote:*   

> 
> 
> If you're sure the carrier is UP (cable plugged in and link active) then file a kernel bug that your driver ins't reporting it correctly.
> 
> Until it's fixed, you can pass dhcpcd the -K option to ignore network link status.
> ...

 

Now I'm not really sure but would there really be a kernel bug if I could access the internet when I used the live cd?

Also, could my problem have something to do with the /etc/hosts file?

Thanks and I really appreciate you guys helping me.  :Very Happy: 

----------

## huckabuck

My /etc/conf.d/net looks like this, i have the same setup as you ;

config_eth0=( "192.168.1.69 broadcast 192.168.1.255 netmask 255.255.255.0" )

dhcp_eth0="nodns nontp nonis"

routes_eth0=( "default via 192.168.1.1" )

I'd had issues with dns servers also, so now i use the opendns nameservers ...

my /etc/resolv.conf file now looks like this ;

nameserver 208.67.222.222

nameserver 208.67.220.220

----------

## deadram

 *ey3s wrote:*   

> Now when I ping 192.168.1.1 I get the message "Destination Host Unreachable"
> 
> I get this same message when I try to ping other computers on my network too.
> 
> 

 

I'd guess maybe the NIC driver you installed in your kernel is slightly off (I've noticed a few drivers in older kernel versions with ISA cards that "work" with some driver, but only actually function with the other driver). Or you paid a lot for your router; and it's getting upset that the MAC in your linux boot isn't the MAC in your windows boot; But you said the liveCD can connect?

Running iptables? Have ipv4 support in the kernel? made any changes to your proc fs (via /etc/sysctl.conf)?

Hummm... Using a crossover cable?!? Maybe the windows driver can auto-detect a crossover network cable, but the linux driver maintainer never got around to adding support for that?

/etc/hosts is only in use when you do domain name lookup. "ping 192.168.1.1" won't care what the heck is in hosts. Only "ping google.com" or the likes will use your host file

```
user@computer $ /sbin/route 

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.1.0     *               255.255.255.0   U     0      0        0 eth0

link-local      *               255.255.0.0     U     0      0        0 eth0

loopback        *               255.0.0.0       U     0      0        0 lo

default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
```

See something like that in your route output?

 *Quote:*   

> *Bringing up eth0
> 
> *192.168.132 [OK]
> 
> *Adding routes
> ...

 

192.168.132 isn't an IP, was that just a typo in your post; or a typo in your config?

----------

## UberLord

 *ey3s wrote:*   

> Now I'm not really sure but would there really be a kernel bug if I could access the internet when I used the live cd?

 

LiveCD doesn't use dhcpcd for carrier detection - it uses other tools. dhcpcd relies purely on kernel for carrier.

Also, I doubt that the kernel you installed is the exact same version on the livecd.

 *Quote:*   

> Also, could my problem have something to do with the /etc/hosts file?

 

Nothing todo with the carrier error message.

----------

## ey3s

 *deadram wrote:*   

>  *ey3s wrote:*   Now when I ping 192.168.1.1 I get the message "Destination Host Unreachable"
> 
> I get this same message when I try to ping other computers on my network too.
> 
>  
> ...

 

Hey, so my ip routing table looks exactly the same as yours except that I don't have the line that says link-local.  And the ip address I put in earlier was just a typo in my post (whoops).  I meant to put in 192.168.1.132.  So, I'm guessing that the absence of the link-local line is not a good thing.  Is this because of the driver issue you were talking about or can it be fixed?

----------

