# Can't get IP through hub

## Chickencha

I've had a working Gentoo install for a few months.  Now, after moving my computer to a new location that has a slightly different network setup, I'm having network troubles: dhcpcd is timing out at boot.  I've tried running /etc/init.d/net.eth0 manually after boot and tried running dhcpcd eth0 as well.  Both had the same result.

My old setup was simply my computer connected to a router, while my new setup is my computer connected to a hub which is connected to a router.  (It might also be interesting to note that the routers in these setups are the same model.)  I know that the problem is with my computer because I've tried putting a different computer in its place and that computer had no troubles.  I haven't actually tried connecting my computer directly to this new router because it's fairly inconvenient and I can see no reason why it wouldn't work, having worked with another router that was exactly the same.

I've messed around with my /etc/conf.d/net a little.  Initially I didn't have anything there, so my eth0 defaulted to dhcp.  That worked fine in my old setup, so I never bothered to change it.  With these new problems I've added the following to /etc/conf.d/net:

```

config_eth0=( "dhcp" )

```

I've also tried setting up a static IP the way I've seen other people suggest doing it:

```

config_eth0=( "192.168.0.2/24" )

routes_eth0=( "default via 192.168.0.1" )

```

Also no success there.

I really know very little about networking, so I'm out of ideas and haven't found any other posts that have been helpful.  Does anyone have any suggestions?

----------

## vaguy02

Okay, this is going to be a really dumb question, but is your NIC card starting up at all. Meaning is eth0 starting correctly?

----------

## Chickencha

Yes, I'm positive eth0 is starting correctly.  As mentioned, my install has been fine for several months.  During boot, I can see that eth0 is started, then dhcpcd tries to get an IP and times out.  (I am assigned some sort of default IP after the timeout, but it does me no good.)

The only thing that's changed is the location of the computer and the network itself.  I haven't changed anything in my kernel configuration or anything else that I can think of that would affect my NIC's ability to start.  Thank you for your response, though.

----------

## flybynite

There was a change in the newer version of dhcpcd.  Try adding the -I option. 

dhcpcd_eth0="-I ''

or emerge dhcpcd with the vram flag.

----------

## padoor

you can keep the /etc/conf.d/net the default file without any change or editing.

boot with cd and copy resolv.conf to /etc again.

manually add route and gateway

try to run dhcpcd manually after boot up.

you cannot specify a static ip in a dhcp connection.

ping your gateway

one or more of the above may work for you.

----------

## cjubon

 *Quote:*   

> I'm positive eth0 is starting correctly. As mentioned, my install has been fine for several months. During boot, I can see that eth0 is started, then dhcpcd tries to get an IP and times out. 

 

This exactly means that your eth0 is not starting up.

Silly question therefore: are you sure that the physical connection is ok (connectors, plugs and cables, etc.)? You can check this with the LEDs from the hub. They should be green even when you didn't actually get an address. E.g., if you're using the same cable that was used for plugging in the laptop into your old router, it may very well be that this is a so-called crossover cable that you probably shouln't use with your new setup.

 *Quote:*   

> There was a change in the newer version of dhcpcd. Try adding the -I option.
> 
> dhcpcd_eth0="-I ''
> 
> or emerge dhcpcd with the vram flag.

 

This advice does not apply to the dhcp client (your laptop) but to the dhcp server (the router machine). But if you have checked the first point, it may be worth considering an upgrade of the router dhcpcd software.

----------

## Chickencha

 *cjubon wrote:*   

> Silly question therefore: are you sure that the physical connection is ok (connectors, plugs and cables, etc.)? You can check this with the LEDs from the hub. They should be green even when you didn't actually get an address. E.g., if you're using the same cable that was used for plugging in the laptop into your old router, it may very well be that this is a so-called crossover cable that you probably shouln't use with your new setup.

 

Everything seems fine, since when I hooked up another computer to the same place with the same cable, it was able to get an IP.  However, the LEDs from the hub aren't on when I turn on my Gentoo box.

----------

## vaguy02

please post 

```
grep eth0 /var/log/dmesg
```

and

```
rc-status
```

----------

## Chickencha

(Please note that all of the following was copied by hand, so it is possible that there are typos.  I've done my best to reproduce it accurately.)

```
grep eth0 /var/log/dmesg
```

Produces:

```
eth0: forcedeth.c: subsystem: 01849:03ef bound to 0000:00:07.0
```

```
rc-status
```

Produces:

Runlevel: default

dbus       [ started ]

hald       [ started ]

local      [ started ]

netmount   [ started ]

ntp-client [ stopped ]

ntpd       [ started ]

samba      [ started ]

syslog-ng  [ started ]

vixie-cron [ started ]

xdm        [ started ]

----------

## vaguy02

I don't see eth0 (or any network interface listed on your rc-status output).....

Are you manually starting your network interface once in the kernel?

----------

## Chickencha

I'm not sure what you mean.  I can tell you that if I run rcstatus -a, net.lo shows up at the boot runlevel as [ started ] and net.eth0 shows up at the "UNASSIGNED" runlevel as [ started ], which doesn't seem quite right...

----------

## vaguy02

Try doing this.

```
rc-update add net.eth0 default
```

then restart the system.

----------

## Chickencha

Okay, I tried that, but still no luck.  (It still seems strange, though, since I seem to remember adding net.eth0 to the default runlevel when I installed Gentoo.  Oh well.)

----------

## vaguy02

Can you do another 

```
rc-status
```

to make sure it loaded correctly on startup

----------

## Chickencha

Yes, it did.  net.eth0 is now listed under default as [ started ].

----------

## vaguy02

Are you able to ping the dhcp server by address now?

----------

## Chickencha

No, I just get the message "connect: network is unreachable."

----------

## vaguy02

ugh, okay. I defer to someone else. If it shows that the network interface is active, and other people can connect and your dhcpcd has a default config.....I'm out of suggestions.

----------

## Chickencha

Okay, thank you for your responses.  I appreciate it.

Edit:

For anyone else who might be able to help, I have found a few things that could be relevant.

1) Last time I had an internet connection, I updated and emerged a new xinetd.  Could this be part of my problem?  (I could be way off here, I just don't know.)

2) According to the page on my motherboard, my network card is a Realtek PHY RTL8201CL.  Is forcedeth really the driver I want to be using?  It just seems weird that things would work up until now...

----------

## cjubon

 *Chickencha wrote:*   

> When I hooked up another computer to the same place with the same cable, it was able to get an IP.  However, the LEDs from the hub aren't on when I turn on my Gentoo box.

 

Hi, here I'm back again  :Smile:  I think we should exclude a hardware issue before proceeding. Maybe it's just your connector in the laptop. Is your laptop able to connect to any other network? Why not trying to plug it directly into the router, just for testing? If you look inside your connector, do you have the impression that one of the I think eight small metal contacts is lower than the others or twisted or something like that? Please check all that. Sometimes it's that easy.

----------

## Chickencha

 *cjubon wrote:*   

> Why not trying to plug it directly into the router, just for testing?

 

Well, the main reason I haven't tried that yet is that this computer isn't actually a laptop.  :Razz:   I probably will try that later today, though.  I'll post the results.

----------

## cjubon

oops sorry

----------

## wicki

I am having what I believe to be the same problem here.

Originally I installed Gentoo from a 2004 LiveCD if I remember correctly... I had it plugged in to the 2Wire Modem/Router/Switch that comes with SBC/AT&T DSL service and everything was working fine.  Now we have moved, can no longer get this DSL service, so I'm trying to stop using this 2Wire device.  I've set up my /etc/conf.d/net to use DHCP and also tried setting it for a static IP, both of which work fine using the other router.  

The reaaally strange thing is, I have DHCP service turned on on the new router, and DHCP service turned off on the 2Wire device.  And I have a network cable running from the 2Wire router to the new router.  New router has same IP as the 2Wire router did have.  If I plug the cable in from the Gentoo machine directly to the new router, it does not work.  But if I plug it in through the 2Wire device, it is getting an IP address from the new router and it works fine!

Any reason why this would be?  It's almost like it is relying on being connected directly to this hardware otherwise it does not want to work!  :Sad: Last edited by wicki on Sun Nov 18, 2007 11:25 pm; edited 1 time in total

----------

## wicki

Also I forgot to mention, one piece that is slightly different is, when I plug the Gentoo computer into the new switch, the lights LNK lights DO come on.. I just can't ping it from any other computer in the network!

----------

## padoor

it seems like the input impedance buffer dead in your network card.

try with new card.

----------

## wicki

But it still works perfectly fine when I plug in to the old router/switch!  Would that still matter?  Also if I plug in to the old switch, which is plugged in to the new switch.. then manually set the gateway to the address of the new switch, it also works.  Even though it is plugged in to the old switch, if I run a route on it, it does not even include the address of the switch it is directly plugged in to with the route... just goes straight to the interface address of the new switch!

----------

## Chickencha

I've got an update.  I moved my computer so that I could connect it directly to the router and BAM! I got an IP.  I'm posting from it right now.  So it definitely doesn't seem to be a hardware problem.

----------

## wicki

Yes it really sounds kind of like the same problem I am having .... I think I'm going to try to dig out my old LiveCD and see if it will grab an IP through the new hardware, if so I'll try to look at the config and see if I can glean anything from it!

----------

## cjubon

 *Chickencha wrote:*   

> I moved my computer so that I could connect it directly to the router and BAM! I got an IP.  I'm posting from it right now.  So it definitely doesn't seem to be a hardware problem.

  Well, I hope you don't mind that I insisted. I just have my experiences.

 *Chickencha wrote:*   

> my network card is a Realtek PHY RTL8201CL. Is forcedeth really the driver I want to be using

 

forcedeth should be okay, but there seem to be problems, see here for example: http://help.lockergnome.com/linux/linux-debian-RTL8201CL-ethernet-card-ftopict391601.html

My last suggestion is to update your dhcpcd on the router machine (you seem to have access). There were changes recently and you may have two incompatibly configured versions on client and server: *Quote:*   

>  * You have installed dhcpcd with DUID support.
> 
>  * This means that we will generate a DUID in /var/lib/dhcpcd/dhcpcd.duid
> 
>  * This is generated from a MAC address of the card and a timestamp.
> ...

 flybynite's advice earlier in this thread was correct, putting dhcpcd_eth0="-I" in your client's /etc/conf.d/net.eth0 should also work if you cannot upgrade the server. Good luck!

----------

## Chickencha

Well, I'm back again.  I never did get this problem resolved and now I'm once again in this situation except that it's now permanent for the forseeable future.

To summarize the problem once again:

```

Router --- Hub --- Gentoo box

```

With this setup, I cannot get an IP through DHCP on the Gentoo box.  It is confirmed that all hardware involved is working.  The Gentoo computer is able to get an IP when directly connected to the router and other computers are able to get an IP from the hub (in the exact place that the Gentoo box is now in).

I have tried a few things since last time, including the suggestions above.  I tried booting from a live CD and couldn't get an IP while running that either.  Also, it seems like many of the people responding are assuming that I'm using a Gentoo router, which is not the case.  The router is just a D-Link DI-524 (with the most recent firmware).  I have complete access to everything.

Any further suggestions would be appreciated.

----------

## Malvineous

I would suggest sticking another PC into the hub and using wireshark to monitor the DHCP traffic - it may shed some light as to why the DHCP requests aren't making it to the router, or why the responses aren't making it back to the box.

You could also try a different DHCP client - a few problems have been posted in the last couple of days where people can't get an IP from their router, at least one of which was a D-Link router judging by the web interface.  In that case changing to dhclient instead of dhcpcd fixed the problem.

----------

## Chickencha

I tried dhclient, but no luck there.  It says "No network available" (or something like that).  I think the wireshark thing's going to have to wait until I have a little more time to put into this.

----------

## Malvineous

I suppose you could also run wireshark on your local PC and then re-run dhcpcd to monitor the traffic - I don't know how wireshark behaves if the interface it's listening to goes down in the middle of everything.

I assume everything works if you give the PC a static IP?

Edit: Also, have you tried enabling or disabling autonegotiation?  Sometimes that doesn't work as well as you might expect, especially with older hardware (e.g. the hub.)

----------

