# Boot up DHCP time out. Running DHCP after login gets IP.

## Mateo61

I am new to Linux so please be gentle!

I have just finished installing Gentoo on a Dell Precision 670. The installation went great was getting IP able was able to sync and emerge. I got to finalizing the installation but when I rebooted the DHCP client timed out. After Login I can run /sbin/dhcpcd or /etc/init.d/net.eth0 start and I am able to get the IP address instantaneous.

*Starting eth0

*  Loading network 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 xx:xx:xx:xx:xx:xx ... "(MAC numbers removed by Mateo)"

*   Bringing up eth0

*       dhcp

*          Running dhcpcd

Error,  eth0: timed out

*  ERROR: cannot start net mount as net.eth0 could not start.

My /etc/conf.d/net at first had nothing in it so it defaulted to DHCP. Same problem.

The is what I have since added

modules=( "dhcpcd" )

config_eth0=( "dhcp" )

dhcpcd_eth0="-I ' ' "

(No Joy)

As I said after logging in I can run

/sbin/dhcpcd or /etc/init.d/net.eth0 to get an IP address.

Thanks

----------

## wudmx

 *Mateo61 wrote:*   

> The is what I have since added
> 
> modules=( "dhcpcd" )
> 
> config_eth0=( "dhcp" )
> ...

 

Change your lines in /etc/conf.d/net to these ones:

```
modules=( "iwconfig" )

config_eth0=( "dhcp" )

```

Is there any improvement now? 

HTH

wudmx

----------

## Mateo61

I apologize if my post was misleading. I am not using wireless. I am using a built in Intel ethernet connected to a internal hard wired network with a DHCP server.

I assume the "modules=( "iwconfig" ) is for wireless.

Any way I changed the /etc/conf.d/net to 

modules=( "iwconfig" )

config_eth0( "dhcp" )

# dhcpcd_eth0="-I ''"

After reboot the message was and I paraphase: wireless device support not installed.

THank you for the response!

There is one module that gets loaded that I am not sure of "IP6to4"

THere is also Netconsole: not configured aborting.

Any help will be appreciated. THanks.

----------

## wudmx

my mistake, sorry. 

Try this please. 

```
modules=( "ifconfig" )

config_eth0=( "dhcp" ) 
```

Before you manually run /etc/init.d/net.eth0 restart, check whether there is a file under /var/run/ with a name beginning with "dhcpcd". Is there such a file?

--

wudmx

----------

## Mateo61

under /var/run I have these files. (I did ls -la)

cron.pid

random-seed

syslog-ng.pid

utmp

1 Directory.

console

there was no file with dhcpcd.

I changed my /etc/conf.d/net to read:

modules=( "ifconfig" ) 

config_eth0=( "dhcp" )

I restarted net.eth0 and recieved my IP.

While it is rebooting I wanted to say that in the dmesg i have at the end "eth0: no IPv6 routers present"

Is that because one of the modules I have loading is "ip6to4"?

Any way it finished rebooting and dhcpcd timed out with no IP.

Any ideas? Thanks

----------

## wudmx

 *Mateo61 wrote:*   

> While it is rebooting I wanted to say that in the dmesg i have at the end "eth0: no IPv6 routers present"
> 
> Is that because one of the modules I have loading is "ip6to4"?

 

Do you need this module? If not, you should compile a kernel without IPv6 support. 

If you use the ip6to4 module, then you should know this. I've found it in the /etc/conf.d/net.example : 

 *Quote:*   

> # 6to4 Tunnels allow IPv6 to work over IPv4 addresses, provided you
> 
> # have a non-private address configured on an interface.
> 
> # link_6to4="eth0"              # Interface to base it's addresses on
> ...

 

So I've never used this before - I would try to add these lines to your /etc/conf.d/net: 

 *Quote:*   

> link_6to4="eth0"
> 
> config_6to4=( "ip6to4" )
> 
> RC_NEED_6to4="net.eth0"

 

Last question: Do you want to assign eth0 an IPv4 or IPv6 address? 

HTH

wudmx

----------

## Mateo61

I need an IPv4 Address.

I thought I could just comment out that module but I could not find it in any conf file anywhere.

I rebooted with the change to the net file.

link_6to4="eth0" 

config_6to4=( "ip6to4" ) 

RC_NEED_6to4="net.eth0"

no joy (no IP).

I did do two things though I disabled IPv6 protocol in /etc/modules.d/aliases

then I did a 

modules_force=( "ifconfig" "dhcpcd" )

config_eth0=( "dhcp" )

and it worked! 

I will remove the modules_force first to see if it was just disabling the protocol.

Thanks for your help!!!

----------

## wudmx

Nice to see it's working now. 

I'm no IPv6 specialist, but perhaps you have enabled IPv6 in the kernel. To see this either check you .config:

```
less /usr/src/linux/.config | grep IPV6
```

If IPv6 is not set, it will print: # CONFIG_IPV6 is not set

Or you look into the kernel config using make menuconfig:

```
cd /usr/src/linux

make menuconfig

go into Networking...

go into Network options...
```

Look at the line "The IPv6 Protocol". It should be prefixed with <> (then it is not set); if there is <M> or <*>, then it is set. Use Space to change the value and recompile your kernel. If you need more help on this, just ask!

Bye

wudmx

----------

## wudmx

By the way, do you have the USE flag ipv6 enabled? 

Add -ipv6 to your USE variable in /etc/make.conf if you really don't need it. After that try rebuilding all your packages with this command line:

```
emerge --ask --verbose --tree --deep --update --newuse world
```

This will update all your existing packages with regard to the new USE variable. The -ipv6 should be highlighted in your output.

HTH

wudmx

----------

## Mateo61

I am not sure what happened but it only happened once that I got the IP on reboot. I have not been able to recreate it.

I am forcing the modules (ifconfig and dhcpcd) and have the IPv6 turned off in the aliases file and have not been able to get an IP since.

I guess I just got lucky or maybe I was seeing things.

Anyway, I grep IPV6 in the .config and I have

CONFIG_IPV6=y

CONFIG_IPV6_SIT=y

The rest are not set. Those are:

IPV6_PRIVACY

IPV6_ROUTER_PREf

IPV6_OPTIMISTIC_DAD

IPV6_MIP6

IPV6_TUNNEL

IPV6_MULTIPLE_Tables

In menuconfig I have 

<*> IPv6 Protocol

       <*> IPv6: IPsec Transport mode

       <*> IPv6: IPsec Tunnel mode

       <*> IPv6: IPsec BEET mode

       <*> IPv6: IPv6 in IPv4 Tunnel (SIT Driver)

Took out IPv6. exited and performed a make (did I need to do a make && make modules_install?).

I need to copy the bzImage created over to /boot/kernel-2.6.22-gentoo-r5 then reboot?

Still no joy on boot:

says loading modules for eth0

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

It is still loading modules that I thought I took out in menuconfig (ip6to4).

I checked /usr/src/linux/.config and IPV6 is not set.

The kernel in /boot that GRUB is using to boot has a different size and date from the original so I beleive that I am using the new kernel that I made.

Thanks for any help!

What am I doing wrong

----------

## wudmx

 *Mateo61 wrote:*   

> Took out IPv6. exited and performed a make (did I need to do a make && make modules_install?).
> 
> I need to copy the bzImage created over to /boot/kernel-2.6.22-gentoo-r5 then reboot?
> 
> Still no joy on boot:
> ...

 

Yes, you did something wrong, you configured your kernel correctly, as you want it, but you didn't installed it correctly.

Change to your kernel sources:

```
cd /usr/src/linux
```

Then configure your kernel (you have already done that step, only for completeness), changes should be saved to .config:

```
make menuconfig
```

Compile the kernel:

```
make
```

Install the compiled modules (they are installed somewhere in /lib/modules/your-kernel-version/):

```
make modules_install
```

check whether your /boot partition is mounted: 

```
mount
```

This gives a list of the mounted partitions. /boot should be listed if not, invoke mount /boot. 

copy your new kernel to the /boot directory and rename it (I assume that you install a kernel with version 2.6.22-gentoo-r5:

```
cp arch/i386/boot/bzImage /boot/kernel-2.6.22-gentoo-r5
```

edit your grub configuration (if you use lilo, check for yourself how to do it), I don't know how your /boot/grub/grub.conf looks like, but you should add a new entry to it which looks something like this:

```
title=Gentoo Linux (vmlinuz - 2.6.22.2-gentoo-r5)

root (hd0,0)

kernel /boot/kernel-2.6.22-gentoo-r5 root=/dev/hda3
```

Be sure that /dev/hda3 is your root partition (have a look into your /etc/fstab or look at mount) and compare the root (hd0,0) line with another root line in another kernel section in grub.conf. So you have a new entry in your grub-configuration, and you can choose this new entry while booting. 

Now reboot, check your modules with modules, and tell me whether it is working. If you need more help, feel free to ask. 

If you got it working you should consider checking whether there are packages installed on your system which use ipv6. You can do that using equery, a tool which is in the gentoolkit package (install it!). Then run equery hasuse ipv6. This gives you a list of all installed packages which offer an ipv6 USE flag. It does not mean that the ipv6 flag was enabled for them on installing. You can check that in the second column: there should be only []. Here is an example entry from my system:

```
duxon log # equery hasuse ipv6

[ Searching for USE flag ipv6 in all categories among: ]

 * installed packages

[I--] [  ] dev-lang/python-2.4.4-r5 (2.4)

[I--] [  ] sys-process/psmisc-22.5-r2 (0)

[I--] [  ] net-mail/fetchmail-6.3.8-r1 (0)

[I--] [  ] www-client/lynx-2.8.6-r2 (0)

[I--] [  ] x11-base/xorg-server-1.3.0.0-r1 (0)

[I--] [  ] dev-libs/libxml2-2.6.28 (2)

[I--] [  ] dev-libs/apr-1.2.8 (1)

[I--] [  ] x11-apps/xauth-1.0.2 (0)

[I--] [  ] x11-apps/xhost-1.0.2 (0)

[I--] [  ] sys-apps/tcp-wrappers-7.6-r8 (0)

[I--] [  ] x11-libs/libX11-1.1.2-r1 (0)

[I--] [  ] x11-libs/libXmu-1.0.3 (0)

[I--] [  ] x11-libs/libXfont-1.3.0 (0)

[I--] [  ] x11-libs/libICE-1.0.3 (0)

[I--] [  ] x11-libs/libSM-1.0.2 (0)

[I--] [  ] net-irc/irssi-0.8.11 (0)

[I--] [  ] net-misc/curl-7.16.4 (0)

[I--] [  ] net-misc/iputils-20060512 (0)

[I--] [  ] net-misc/wget-1.10.2 (0)

[I--] [  ] net-misc/rsync-2.6.9-r3 (0)

[I--] [  ] media-video/mplayer-1.0_rc1_p20070824 (0)

[I--] [  ] net-ftp/ncftp-3.2.0 (0)
```

As you can see, all packages listed there were not compiled with ipv6 support (which should be the same in your case). If it is not the case for you, then update your system with new use-flags. Add -ipv6 into your USE variables in /etc/make.conf and invoke the following:

```
emerge --verbose --newuse --deep --update --ask world
```

So far so good, you've got something to work on :D 

Good luck!

wudmx

----------

## Mateo61

I have to apologize since I have no other computer on this network I cant remote log in and cut and paste exactly what I am doing into the forum. I try to paraphrase the commands and I think I make it harder to follow what I am doing.

       I am pretty sure that I installed the kernel correctly because afterwards I checked the size and the date of the Kernel that Grub is using and it matches the time and size that I created it at. You are right though my boot partition does not automatically mount, I have to manually mount it.

I am not sure about  *Quote:*   

> Now reboot, check your modules with modules, and tell me whether it is working.

 

How do I check my modules with modules?

I have also noticed something that after I log in and run "/etc/init.d/net.eth0 restart" manually to get my IP. I see this:

```
* Starting eth0 

* Loading network 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 xx:xx:xx:xx:xx:xx ... "(MAC numbers removed by Mateo)" 

* Bringing up eth0 

* dhcp 

* Running dhcpcd 

```

and I receive my IP. if the module "ip6to4" was really hanging this up it should not work when restart net.eth0 manually.

I think that I will install the gentoolkit and check the use flag on the installed packages.

Thanks for all the help.

----------

## wudmx

 *Mateo61 wrote:*   

> I am pretty sure that I installed the kernel correctly because afterwards I checked the size and the date of the Kernel that Grub is using and it matches the time and size that I created it at.

 

Type uname -a and (-a = all) information about your kernel is being shown, also the build time of your kernel. With this output you can verify, if it is your new kernel!

 *Mateo61 wrote:*   

> I am not sure about  *Quote:*   Now reboot, check your modules with modules, and tell me whether it is working. 
> 
> How do I check my modules with modules?

 

My failure, I meant "check your modules with lsmod". This command lists the current modules in use. You can use modprobe (or insmod) to add a module and rmmod to remove an existing one. I think if you have configured the kernel correctly, there should be no "ip6to4" in the output of lsmod after rebooting. 

 *Mateo61 wrote:*   

> if the module "ip6to4" was really hanging this up it should not work when restart net.eth0 manually.

 

Could you post your current /etc/conf.d/net, ls -lh /etc/conf.d/net*, /etc/modules.autoload.d/kernel-2.6 .

 *Mateo61 wrote:*   

> I think that I will install the gentoolkit and check the use flag on the installed packages.

 

Please do that and follow the steps in my previous posting!

HTH

wudmx

----------

## Mateo61

Typed uname -a. Time matches when I built the new kernel.

lsmmod does not list any modules.

just has 

```
modules           size        used by
```

then nothing underneath.

/etc/conf.d/net   has:

```
modules =( "ifconfig" "dhcpcd" )

config_eth0=( "dhcp" )
```

ls -lh /etc/conf.d/net*

```
/etc/conf.d/net

/etc/conf.d/net.examples
```

/etc/modules.autoload.d/kernel-2.6

```
# Example

# aic7xxx
```

I did an "emerge gentoolkit" and it installed fine. I had only one package that had the ipv6 use flag.

```
pluto # equery hasuse ipv6 

[ Searching for USE flag ipv6 in all categories among: ] 

 * installed packages 

[I--] [ M ] dev-lang/python-2.4.4-r5 (2.4) 
```

all of the other packages did not have the ipv6 flag enabled.

I added a -ipv6 ("dash" ipv6) in my /etc/make.conf then I ran

```
emerge --verbose --newuse --deep --update --ask world
```

it is still downloading and updating the packages.

I have to assume after it is done I rebuild my kernel and then try it.

Thanks I will let you know how it works out.

----------

## wudmx

[quote="Mateo61"]I have to assume after it is done I rebuild my kernel and then try it. [quote]

No, just reboot. And check again with equery that no package is installed with ipv6 support.

----------

## Mateo61

I have not given up!! I am still trying to resolve this issue.

I ran into problems with the emerge command one of the files (man-pages-2.63.tar.b2z) had already been moved to the archives directory on the mirrors so when it cannot locate the file the emerge process aborts.

I have posted under the portage & Programing forum that issue.

Topic: This is easy. Emerge fails at ..../man-pages-2.63.tar.b2z

Post: post 4439753

Thank you for all of your help!!

Again I have not given up. (I have thought about starting all over, but have not done it yet.)

----------

## Mateo61

Well I finally resolved the emerge issues and I was able to emerge world with my "-newuse" flag option, with out any problems. Now when I do a 

```
pluto # equery hasuse ipv6 

[ Searching for USE flag ipv6 in all categories among: ] 

 * installed packages 

[I--] [  ] dev-lang/python-2.4.4-r5 (2.4) 
```

there are no packages with ipv6 in it.

Still no joy on getting an IP at boot time.

Any help would be appreciated.

----------

