# Dhcpcd

## optiluca

After having forgotten to install DHCPCD during the system installation process, I booted the CD, chrooted into my installed system, emerged dhcpcd, rebooted, but dhcpcd fails to start.  A line appears saying something like "Starting DHCPCD        [!!]".  I have no idea about what to do.

I understand I haven't given much information, since I don't get big error messages, so if you need some more info could you tell me where to find it?

Thanks

Luca

----------

## Albert_g

Hi

you can try looking at /var/log, and also the /etc/dhcp* files/directories

dhcpd shoyuld be configured prior to its use, man dhcpd may also help with it.

Albert

----------

## magic919

If you forgot that then maybe you forgot to add net.eth0 to the default runlevel too?  Try /etc/init.d/net.eth0 start and see what it does.

----------

## optiluca

/etc/init.d/net.eth0 start

 * Starting eth0

 *   Configuration not set for eth0 - assuming DHCP

 *   Bringing up eth0

 *     dhcp

 *       Running dhcpcd ...                                               [ !! ]

 :Sad: 

----------

## Albert_g

Dear optiluca,

have you edited the /etc/dhcpcd.conf file ?

Albert

----------

## specks

I just installed gentoo on a Dell C840. The installation went great, I got X working and Gnome installed and working. I then did an emerge -uDva world and dispatch-conf. I thought I carefully went through all the config files correctly, but now I cannot get networking to work.

The error I get at boot or when I try to start it manually is this:

```

$ /etc/init.d/net.eth0 start

* Starting eth0

*   Bringing up eth0

*      dhcp

*          Running dhcpcd ...                                  [ !! ]

```

My  /etc/conf.d/domainname:

```

# /etc/conf.d/domainname

# When setting up resolv.conf, what should take precedence?

# If you wish to always override DHCP/whatever, set this to 1.

OVERRIDE=1

# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf

# properly (domain entry in /etc/resolv.conf, and FQDN in /etc/hosts).

#

#DNSDOMAIN=""

DNSDOMAIN="byu.edu"

# This only set what /bin/hostname returns.  If you need to setup NIS, meaning

# what /bin/domainname returns, please see:

#

#   http://www.linux-nis.org/nis-howto/HOWTO/

#

#NISDOMAIN=""

```

My /etc/conf.d/hostname:

```

# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="acostic"

```

My /etc/conf.d/net:

```

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "dhcp" )

dhcpcd_eth0="-h acostic -t 10"

```

My /etc/hosts:

```
# /etc/hosts

#

# This file describes a number of hostname-to-address

# mappings for the TCP/IP subsystem.  It is mostly

# used at boot time, when no name servers are running.

# On small systems, this file can be used instead of a

# "named" name server.  Just add the names, addresses

# and any aliases to this file...

#

127.0.0.1       localhost acostic

10.25.67.154 specks.byu.edu specks

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

Any help would be greatly appreciated.

Edited to Add: Here is the output from the syslog:

```

Feb 16 11:15:16 [dhcpcd] dhcpStart: interface eth0 is not Ethernet or 802.2 Token Ring_

```

----------

## CloudBolt

try 

```
# ifconfig eth0
```

and post the output here.

also try 

```
# ifconfig eth1
```

and post the output

----------

## optiluca

 *Albert_g wrote:*   

> Dear optiluca,
> 
> have you edited the /etc/dhcpcd.conf file ?
> 
> Albert

 

I copied the example one to it...

BTW Isn't it /etc/dhcp/dhcpcd.conf?

----------

## Albert_g

Yup, it may be the file that you point

but copying the example isn't enough, you have to actively edit it to select the paramenters of the server, such as the range of served IPs, if there are some fixed IP/MAC pairs, and so on.

man dhcpd.conf

Albert

----------

## specks

cloudbolt:

```
# ifconfig eth0

eth0      Link encap:UNSPEC  HWaddr 34-4F-C0-00-34-0B-DC-21-00-00-00-00-00-00-00-00

             BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
```

```
# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:08:74:07:4E:C0

             BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

             Interrupt:11 Base address:0xc00
```

Edited to add:

It looks like eth0 may have become the wireless card - which I'm not interested in using. Why would my network card move from eth0 to eth1?

I created a net.eth1 symlink in /etc/init.d to net.lo and started it up - it works. But this is just wierd.

----------

## UberLord

Try re-emerging dhcpcd

----------

## CloudBolt

 *specks wrote:*   

> cloudbolt:
> 
> ```
> # ifconfig eth0
> 
> ...

 

I know, it's the same problem I had. when you finished emerging X, a window manager and all of its dependencies you probably typed etc-update and let it overwrite all configfiles, this is probably what caused eth0 to become eth1, as that is what I did.

----------

## optiluca

optipc luca # ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:13:D4:69:8F:23

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:177 Base address:0x4000

optipc luca # ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:60:4C:30:57:BD

          UP BROADCAST RUNNING MULTICAST  MTU:65535  Metric:1

          RX packets:424 errors:0 dropped:0 overruns:0 frame:0

          TX packets:423 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:119070 (116.2 Kb)  TX bytes:46836 (45.7 Kb)

----------

## CloudBolt

 *optiluca wrote:*   

> optipc luca # ifconfig eth0
> 
> eth0      Link encap:Ethernet  HWaddr 00:13:D4:69:8F:23
> 
>           BROADCAST MULTICAST  MTU:1500  Metric:1
> ...

 

execute these commands in a terminal:

```
# cd /etc/init.d

# ln -s net.eth0 net.eth1

# rc-update add net.eth1 default

# rc-update del net.eth0 default
```

this copies your startup script for eth0 to start eth1 on boot, adds the startup script for eth1 to the default runlevel(which is the runlevel executed first when you boot your gentoo box), and deletes eth0 from the default runlevel(so that you don't get an error every time you boot)

----------

## ewtrowbr

Dude... How you gonna serve DHCP out an interface without an IP address configured? Configure an Ip address on the eth1 interface. Then Make sure that /etc/cond.d/dhcp specifies that the eth1 interface is the one specified. 

Hope this helps you

openwall conf.d # more dhcp

# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.conf,v 1.6 2004/08/2

8 02:55:40 vapier Exp $

# Configure which interface or interfaces to for dhcp to listen on

# list all interfaces space separated.

IFACE="eth1"

# Insert any other options needed

DHCPD_OPTS="-q"

# If you wish to run dhcp in a chroot, run:

# ebuild /var/db/pkg/net-misc/<dhcp version>/<dhcp-version>.ebuild config

# and un-comment the following line.

# You can specify a different chroot directory but MAKE SURE it's empty.

#CHROOT="/chroot/dhcp"

openwall conf.d #

openwall conf.d # ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:11:11:30:D4:23

          inet addr:192.168.1.254  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:97444007 errors:0 dropped:0 overruns:0 frame:0

          TX packets:101823047 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1760818074 (1679.2 Mb)  TX bytes:2353777575 (2244.7 Mb)

openwall conf.d #

----------

## optiluca

[quote="CloudBolt"] *optiluca wrote:*   

> 
> 
> ```
> # cd /etc/init.d
> 
> ...

 

At boot time I get a message saying that eth1 doesn't exist...

 *ewtrowbr wrote:*   

> Dude... How you gonna serve DHCP out an interface without an IP address configured? Configure an Ip address on the eth1 interface. Then Make sure that /etc/cond.d/dhcp specifies that the eth1 interface is the one specified. 
> 
> 

 

I haven't got a /etc/cond.d/dhcp...

BTW I'm using a Eagle-usb modem, and I followed these instructions:

http://gentoo-wiki.com/HARDWARE_Install_a_modem_that_uses_the_eagle-usb_software

----------

## ewtrowbr

My bad. I'm the bozo. I thought we were trying to get a dhcp server running. My mistake.

----------

## bertdevriese

Well,

I've been having the same problem and I can confirm: when you compare to the liveCD, eth0 is now the wireless connection instead of the wired connection, and eth1 is the wired connection. This was pretty confusing to me in the beginning because on the bootcd the wired connection was the eth0 device.

Adding the symlink as described in the "Gentoo Handbook" works fine

```
# cd /etc/init.d

# ln -s net.eth0 net.eth1

# rc-update add net.eth1 default
```

That way, you can use eth1 as the wired connection. No more problems from that point.

----------

