# Dhcpcd doesn't work with service net.eth0 [solved]

## x0fis

Hello,

I compiled kernel with CONFIG_PF_INET and driver for ethernet card CONFIG_E1000 and installed dhcpcd

Now command dhcpcd eth0 works with no errors and correctly sets IP, mask, etc.. on eth0 device

Next step was some standard way to automatization. I choosed service net.eth0 for it. But dhcp works wrong. eth0 only has added flags UP RUNNING.

My steps:

I made symlink from /etc/init.d/net.lo to /etc/init.d/net.eth0

Made /etc/conf.d/net and added into the line config_eth0="dhcp"

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

Result

What can by wrong?

Thank youLast edited by x0fis on Mon May 12, 2014 11:03 am; edited 1 time in total

----------

## szatox

i suppose your openrc attempts to configure eth0 twice and it couses conflicts.

Why? becouse net.eth0 provides net. And dhcpcd provides net. if you have any service that has anything to do with net in your default runlevel it will trigger BOTH, dhcpcd and net.eth0.

Net.eth0 will bring eth0 up and then attempt to use dhcp to obtain IP address. This will most likely refer to dhcpcd, but it might also use udhcp or other dhcp client.

Dhcpcd will however run as a service too, bringing all network interfaces up (including eth0) and trying to obtain IP addresses. And then you're screwed, becouse you have 2 programs (or 2 instances of 1 program) doing the very same thing on the very same object and they both see something is wrong, so they either give up or try again, and see something is wrong again. Which one is a case hardly matters. What does matter is none of those will succeed.

So, run `rc-status`, then just to make sure `rc-update --update` and rc-status again. It might be just a problem with cache (fixed by rc-update --update), or you might see something described above. Solution in this case is removing or disabling with `chmod -x` some of conflicting stuff so you only have 1 way to configure any particular interface left.

----------

## khayyam

x0fis ...

adding the following to /etc/rc.conf will prevent dhcpcd from providing 'net'. Doing this should then set net.${IFACE} as the default provider (though you may also want to look at the section that describes 'rc_depend_strict').

```
rc_dhcpcd_provide="!net"
```

best ... khay

----------

## tpereira

I think I have the same problem: dhcpcd sometimes gets an address, sometimes not.

I sort of solved it by doing the following:

1. add to /etc/conf.d/net

config_eth0="noop"

2. move the service net.eth0 to runlevel boot

3. add the service dhcpcd tp runlevel default

I know this is not really fixing the problem...

----------

## khayyam

 *tpereira wrote:*   

> 1. add to /etc/conf.d/net ... config_eth0="noop"
> 
> 2. move the service net.eth0 to runlevel boot
> 
> 3. add the service dhcpcd tp runlevel default

 

tpereira ... when using net.${IFACE} dhcpcd should not be in any runlevel, its started by netscripts dependent on "config_${IFACE}="dhcp" or, if no configuration is provided, dhcpcd (or some dhcp client) is the default. The following should resolve your issue ...

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

# rc-update add net.eth0 default

# rc-update del dhcpcd default
```

/etc/conf.d/net

```
config_eth0="dhcp"

modules_eth0="dhcpcd"
```

/etc/rc.conf

```
rc_dhcpcd_provide="!net"
```

HTH & best ... khay

----------

## tpereira

Khayyam,

For testing, I have done what you say and I get the same problem I am getting with several other servers. Some of them remote.

This is an extract of my /var/log/messages:

```
May  9 13:09:05 gentooTEST kernel: [    6.978249] kjournald starting.  Commit interval 5 seconds

May  9 13:09:05 gentooTEST kernel: [    6.979061] EXT3-fs (sda4): using internal journal

May  9 13:09:05 gentooTEST kernel: [    6.979069] EXT3-fs (sda4): mounted filesystem with ordered data mode

May  9 13:09:05 gentooTEST /usr/sbin/gpm[1295]: *** info [daemon/startup.c(136)]: 

May  9 13:09:05 gentooTEST /usr/sbin/gpm[1295]: Started gpm successfully. Entered daemon mode.

May  9 13:09:05 gentooTEST kernel: [    9.252755] uhci_hcd 0000:00:1d.0: reserve dev 3 ep81-INT, period 8, phase 4, 118 us

May  9 13:09:06 gentooTEST kernel: [    9.827361] r8169 0 000:01:00.0 enp1s0: link down

May  9 13:09:06 gentooTEST kernel: [    9.827382] r8169 0000:01:00.0 enp1s0: link down

May  9 13:09:06 gentooTEST kernel: [    9.827436] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May  9 13:09:06 gentooTEST dhcpcd[1423]: version 6.2.0 starting

May  9 13:09:06 gentooTEST dhcpcd[1423]: enp1s0: waiting for carrier

May  9 13:09:08 gentooTEST kernel: [   12.297781] r8169 0000:01:00.0 enp1s0: link up

May  9 13:09:08 gentooTEST kernel: [   12.297800] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May  9 13:09:08 gentooTEST dhcpcd[1423]: enp1s0: carrier acquired

May  9 13:09:08 gentooTEST dhcpcd[1423]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

May  9 13:09:08 gentooTEST dhcpcd[1423]: enp1s0: IAID 85:98:70:65

May  9 13:09:08 gentooTEST dhcpcd[1423]: enp1s0: soliciting an IPv6 router

May  9 13:09:08 gentooTEST dhcpcd[1423]: enp1s0: rebinding lease of 10.136.235.223

May  9 13:09:13 gentooTEST dhcpcd[1423]: enp1s0: DHCP lease expired

May  9 13:09:13 gentooTEST dhcpcd[1423]: enp1s0: soliciting a DHCP lease

May  9 13:09:22 gentooTEST dhcpcd[1423]: enp1s0: no IPv6 Routers available

May  9 13:09:36 gentooTEST dhcpcd[1423]: timed out

May  9 13:09:36 gentooTEST dhcpcd[1423]: allowing 8 seconds for IPv4LL timeout

May  9 13:09:40 gentooTEST dhcpcd[1423]: enp1s0: offered 10.136.235.223 from XXX.XXX.XXX.XXX

May  9 13:09:44 gentooTEST dhcpcd[1423]: timed out

May  9 13:09:44 gentooTEST dhcpcd[1423]: exited

May  9 13:09:44 gentooTEST /etc/init.d/net.enp1s0[1331]: ERROR: net.enp1s0 failed to start

May  9 13:09:44 gentooTEST ntpdate[1479]: Can't find host 0.gentoo.pool.ntp.org: System error (-11)

May  9 13:09:44 gentooTEST ntpdate[1479]: Can't find host 1.gentoo.pool.ntp.org: System error (-11)

May  9 13:09:44 gentooTEST ntpdate[1479]: Can't find host 2.gentoo.pool.ntp.org: System error (-11)

May  9 13:09:44 gentooTEST ntpdate[1479]: Can't find host 3.gentoo.pool.ntp.org: System error (-11)
```

After booting like this, I get "net.enp1s0    [stopped]" from rc-config show all and I am able to start it by doing /etc/init.d/net.enp1s0 start.

Also, by repeatedly doing /etc/init.d/net.enp1s0 restart, I get an IP address every other time:

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                                                                                                                           [ ok

 *   Removing addresses

 *     10.136.235.223/16

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[3739]: version 6.2.0 starting

dhcpcd[3739]: enp1s0: waiting for carrier

dhcpcd[3739]: enp1s0: carrier acquired

dhcpcd[3739]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

dhcpcd[3739]: enp1s0: IAID 85:98:70:65

dhcpcd[3739]: enp1s0: soliciting an IPv6 router

dhcpcd[3739]: enp1s0: rebinding lease of 10.136.235.223

dhcpcd[3739]: enp1s0: DHCP lease expired

dhcpcd[3739]: enp1s0: soliciting a DHCP lease

dhcpcd[3739]: enp1s0: no IPv6 Routers available

dhcpcd[3739]: timed out

dhcpcd[3739]: allowing 8 seconds for IPv4LL timeout

dhcpcd[3739]: enp1s0: offered 10.136.235.223 from XXX.XXX.XXX.XXX

dhcpcd[3739]: timed out

dhcpcd[3739]: exited                                                                                                                                                         [ !!

 * ERROR: net.enp1s0 failed to start

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[3889]: version 6.2.0 starting

dhcpcd[3889]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

dhcpcd[3889]: enp1s0: IAID 85:98:70:65

dhcpcd[3889]: enp1s0: soliciting an IPv6 router

dhcpcd[3889]: enp1s0: soliciting a DHCP lease

dhcpcd[3889]: enp1s0: offered 10.136.235.223 from  XXX.XXX.XXX.XXX

dhcpcd[3889]: enp1s0: leased 10.136.235.223 for 72000 seconds

dhcpcd[3889]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[3889]: enp1s0: adding default route via 10.136.254.254

dhcpcd[3889]: forked to background, child pid 3929                                                                                                                           [ ok

 *     received address 10.136.235.223/16                                                                                                                                    [ ok

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                                                                                                                           [ ok

 *   Removing addresses

 *     10.136.235.223/16

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[4192]: version 6.2.0 starting

dhcpcd[4192]: enp1s0: waiting for carrier

dhcpcd[4192]: enp1s0: carrier acquired

dhcpcd[4192]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

dhcpcd[4192]: enp1s0: IAID 85:98:70:65

dhcpcd[4192]: enp1s0: soliciting an IPv6 router

dhcpcd[4192]: enp1s0: rebinding lease of 10.136.235.223

dhcpcd[4192]: enp1s0: DHCP lease expired

dhcpcd[4192]: enp1s0: soliciting a DHCP lease

dhcpcd[4192]: enp1s0: no IPv6 Routers available

dhcpcd[4192]: timed out

dhcpcd[4192]: allowing 8 seconds for IPv4LL timeout

dhcpcd[4192]: enp1s0: offered 10.136.235.223 from  XXX.XXX.XXX.XXX

dhcpcd[4192]: timed out

dhcpcd[4192]: exited                                                                                                                                                       [ !! ]

 * ERROR: net.enp1s0 failed to start

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[4329]: version 6.2.0 starting

dhcpcd[4329]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

dhcpcd[4329]: enp1s0: IAID 85:98:70:65

dhcpcd[4329]: enp1s0: soliciting an IPv6 router

dhcpcd[4329]: enp1s0: soliciting a DHCP lease

dhcpcd[4329]: enp1s0: offered 10.136.235.223 from  XXX.XXX.XXX.XXX

dhcpcd[4329]: enp1s0: leased 10.136.235.223 for 72000 seconds

dhcpcd[4329]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[4329]: enp1s0: adding default route via 10.136.254.254

dhcpcd[4329]: forked to background, child pid 4369                                                                                                                         [ ok ]

 *     received address 10.136.235.223/16                                                                                                                                  [ ok ]

```

Any help would me much appreciated.

My dhcpcd version:

```
net-misc/dhcpcd-6.2.0-r1 was built with the following:

USE="ipv6 udev"
```

kernel is 3.10.25-gentoo

----------

## khayyam

tpereira ...

It seems the issue is with dhcp renewal, please try the following:

/etc/conf.d/net

```
dhcp_enp1s0="release"

# I'm not sure why you have a timeout of 8 seconds for IPv4LL or why its failing (but

# disabling it, and extending the timeout to 20 seconds).

dhcpcd_enp1s0="-t 20 --noipv4ll"

# as you're not using ipv6 you might as well disable it

enable_ipv6_enp1s0="false"
```

Also "DUID is not enabled by default" as "not all DHCP servers work with it" (man dhcpcd), this is infact enabled by default (on gentoo) for some reason, try editing /etc/dhcpcd.conf and commenting 'duid' out. Not sure this plays into the issue above but worth testing without DUID enabled.

best ... khay

----------

## tpereira

I've done what you told me, but got the same results.

But I have more info. After making /etc/conf.d/net

```
config_enp1s0="noop"
```

and starting enp.1s0

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 start

 * Bringing up interface enp1s0                                                  [ ok ]
```

I am able to get an IP address repeatedly by making dhcpcd -d:

```
gentooTEST tpereira # dhcpcd -d

dhcpcd[16092]: version 6.2.0 starting

dhcpcd[16092]: udev: starting

dhcpcd[16092]: dev: loaded udev

dhcpcd[16092]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT

dhcpcd[16092]: enp1s0: using hwaddr 00:21:85:98:70:65

dhcpcd[16092]: enp1s0: soliciting a DHCP lease

dhcpcd[16092]: enp1s0: sending DISCOVER (xid 0xc90037a3), next in 3.06 seconds

dhcpcd[16092]: enp1s0: offered 10.136.227.241 from XXX.XXX.XXX.XXX

dhcpcd[16092]: enp1s0: sending REQUEST (xid 0xc90037a3), next in 3.28 seconds

dhcpcd[16092]: enp1s0: acknowledged 10.136.227.241 from XXX.XXX.XXX.XXX

dhcpcd[16092]: enp1s0: leased 10.136.227.241 for 72000 seconds

dhcpcd[16092]: enp1s0: renew in 36000 seconds, rebind in 63000 seconds

dhcpcd[16092]: enp1s0: adding IP address 10.136.227.241/16

dhcpcd[16092]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[16092]: enp1s0: adding default route via 10.136.254.254

dhcpcd[16092]: enp1s0: writing lease `/var/lib/dhcpcd/dhcpcd-enp1s0.lease'

dhcpcd[16092]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' BOUND

dhcpcd[16092]: forking to background

dhcpcd[16092]: forked to background, child pid 16123

gentooTEST tpereira # dhcpcd --exit

dhcpcd[16154]: sending signal 15 to pid 16123

dhcpcd[16154]: waiting for pid 16123 to exit

gentooTEST tpereira # dhcpcd -d

dhcpcd[16197]: version 6.2.0 starting

dhcpcd[16197]: udev: starting

dhcpcd[16197]: dev: loaded udev

dhcpcd[16197]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT

dhcpcd[16197]: enp1s0: using hwaddr 00:21:85:98:70:65

dhcpcd[16197]: enp1s0: soliciting a DHCP lease

dhcpcd[16197]: enp1s0: sending DISCOVER (xid 0xbf681f65), next in 3.88 seconds

dhcpcd[16197]: enp1s0: offered 10.136.227.241 from XXX.XXX.XXX.XXX

dhcpcd[16197]: enp1s0: sending REQUEST (xid 0xbf681f65), next in 4.62 seconds

dhcpcd[16197]: enp1s0: acknowledged 10.136.227.241 from XXX.XXX.XXX.XXX

dhcpcd[16197]: enp1s0: leased 10.136.227.241 for 72000 seconds

dhcpcd[16197]: enp1s0: renew in 36000 seconds, rebind in 63000 seconds

dhcpcd[16197]: enp1s0: adding IP address 10.136.227.241/16

dhcpcd[16197]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[16197]: enp1s0: adding default route via 10.136.254.254

dhcpcd[16197]: enp1s0: writing lease `/var/lib/dhcpcd/dhcpcd-enp1s0.lease'

dhcpcd[16197]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' BOUND

dhcpcd[16197]: forking to background

dhcpcd[16197]: forked to background, child pid 16229

```

----------

## khayyam

 *tpereira wrote:*   

> I've done what you told me, but got the same results.

 

tpereira ... no, not the same, because as you see in your "dhcpcd -d" DUID isn't used, and your renewal is successful. Anyhow, it would have been useful to see what those "same results" were.

 *tpereira wrote:*   

> 
> 
> ```
> config_enp1s0="noop"
> ```
> ...

 

This is a "no operation" ... "If the interface is down or there are no addresses assigned, then we move onto the next step (default dhcp)". So, it shouldn't be any different to config_*="dhcp" ... I'm suspecting that something is hotplugging the interface, is anything defined in that regard (ie, in /etc/rc.conf)? 

Anyhow, the fact that having the service in the boot runlevel resolves the issue somewhat suggest that something is interfering subsequently, are sys-apps/ifplugd or sys-apps/netplugd installed, and are there any changes you've made to /etc/rc.conf that may be relevent?

best ... khay

----------

## tpereira

Monday, I'll post the "same results". Now it is not possible, because I'll get locked out of that system.

My /etc/rc.conf:

```
tpereira@gentooTEST ~ $ grep ^[^#] /etc/rc.conf

rc_shell=/sbin/sulogin

rc_logger="YES"

rc_log_path="/var/log/rc.log"

unicode="YES"

rc_dhcpcd_provide="!net"

rc_tty_number=12

```

sys-apps/ifplugd and sys-apps/netplugd are not installed.

best, tpereira

----------

## tpereira

/etc/conf.d/net:

```
config_enp1s0="dhcp"

dhcp_enp1s0="release"

dhcpcd_enp1s0="-t 20 --noipv4ll"

enable_ipv6_enp1s0="false"
```

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[19622]: version 6.2.0 starting

dhcpcd[19622]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

dhcpcd[19622]: enp1s0: IAID 85:98:70:65

dhcpcd[19622]: enp1s0: soliciting an IPv6 router

dhcpcd[19622]: enp1s0: soliciting a DHCP lease

dhcpcd[19622]: enp1s0: offered 10.136.221.250 from XXX.XXX.XXX.XXX

dhcpcd[19622]: enp1s0: no IPv6 Routers available

dhcpcd[19622]: enp1s0: leased 10.136.221.250 for 72000 seconds

dhcpcd[19622]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[19622]: enp1s0: adding default route via 10.136.254.254

dhcpcd[19622]: forked to background, child pid 19770                                         [ ok ]

 *     received address 10.136.221.250/16                                                    [ ok ]

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                                           [ ok ]

 *   Removing addresses

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[20245]: version 6.2.0 starting

dhcpcd[20245]: enp1s0: waiting for carrier

dhcpcd[20245]: enp1s0: carrier acquired

dhcpcd[20245]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

dhcpcd[20245]: enp1s0: IAID 85:98:70:65

dhcpcd[20245]: enp1s0: soliciting an IPv6 router

dhcpcd[20245]: enp1s0: soliciting a DHCP lease

dhcpcd[20245]: enp1s0: no IPv6 Routers available

dhcpcd[20245]: timed out

dhcpcd[20245]: exited                                                                        [ !! ]

 * ERROR: net.enp1s0 failed to start
```

/var/log/messages:

```
May 12 11:49:44 gentooTEST dhcpcd[19622]: version 6.2.0 starting

May 12 11:49:44 gentooTEST dhcpcd[19622]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

May 12 11:49:44 gentooTEST dhcpcd[19622]: enp1s0: IAID 85:98:70:65

May 12 11:49:44 gentooTEST dhcpcd[19622]: enp1s0: soliciting an IPv6 router

May 12 11:49:44 gentooTEST dhcpcd[19622]: enp1s0: soliciting a DHCP lease

May 12 11:49:56 gentooTEST dhcpcd[19622]: enp1s0: offered 10.136.221.250 from XXX.XXX.XXX.XXX

May 12 11:49:56 gentooTEST dhcpcd[19622]: enp1s0: no IPv6 Routers available

May 12 11:50:01 gentooTEST cron[19739]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)

May 12 11:50:01 gentooTEST dhcpcd[19622]: enp1s0: leased 10.136.221.250 for 72000 seconds

May 12 11:50:01 gentooTEST dhcpcd[19622]: enp1s0: adding route to 10.136.0.0/16

May 12 11:50:01 gentooTEST dhcpcd[19622]: enp1s0: adding default route via 10.136.254.254

May 12 11:50:01 gentooTEST dhcpcd[19622]: forked to background, child pid 19770

May 12 11:50:30 gentooTEST dhcpcd[19770]: received SIGHUP from PID 20044, releasing

May 12 11:50:30 gentooTEST dhcpcd[19770]: enp1s0: removing interface

May 12 11:50:30 gentooTEST dhcpcd[19770]: enp1s0: releasing lease of 10.136.221.250

May 12 11:50:30 gentooTEST dhcpcd[19770]: enp1s0: deleting route to 10.136.0.0/16

May 12 11:50:30 gentooTEST dhcpcd[19770]: enp1s0: deleting default route via 10.136.254.254

May 12 11:50:30 gentooTEST dhcpcd[19770]: exited

May 12 11:50:31 gentooTEST kernel: [232714.446356] r8169 0000:01:00.0 enp1s0: link down

May 12 11:50:31 gentooTEST kernel: [232714.446375] r8169 0000:01:00.0 enp1s0: link down

May 12 11:50:31 gentooTEST kernel: [232714.446419] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 12 11:50:31 gentooTEST dhcpcd[20245]: version 6.2.0 starting

May 12 11:50:31 gentooTEST dhcpcd[20245]: enp1s0: waiting for carrier

May 12 11:50:33 gentooTEST dhcpcd[20245]: enp1s0: carrier acquired

May 12 11:50:33 gentooTEST kernel: [232717.214303] r8169 0000:01:00.0 enp1s0: link up

May 12 11:50:33 gentooTEST kernel: [232717.214323] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 12 11:50:33 gentooTEST dhcpcd[20245]: DUID 00:01:00:01:1a:82:40:83:00:0e:a6:39:c9:50

May 12 11:50:33 gentooTEST dhcpcd[20245]: enp1s0: IAID 85:98:70:65

May 12 11:50:33 gentooTEST dhcpcd[20245]: enp1s0: soliciting an IPv6 router

May 12 11:50:33 gentooTEST dhcpcd[20245]: enp1s0: soliciting a DHCP lease

May 12 11:50:46 gentooTEST dhcpcd[20245]: enp1s0: no IPv6 Routers available

May 12 11:50:51 gentooTEST dhcpcd[20245]: timed out

May 12 11:50:51 gentooTEST dhcpcd[20245]: exited

May 12 11:50:51 gentooTEST /etc/init.d/net.enp1s0[19968]: ERROR: net.enp1s0 failed to start
```

/etc/dhcpcd.conf 

```
hostname

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier

nohook lookup-hostname
```

----------

## khayyam

tpereira ... I have to admit I'm not seeing the issue here ... the only thing that I can see that might cause this is your dhcpcd.conf, you're requesting 'hostname' but then have a 'nohook hostname'. Could you try with the following:

/etc/dhcpcd.conf 

```
#hostname

persistent

option rapid_commit

#option domain_name_servers, domain_name, domain_search, host_name

option domain_name_servers, domain_name, domain_search

option classless_static_routes

option ntp_servers

require dhcp_server_identifier

nohook lookup-hostname
```

... I generally don't change dhcpcd.conf but use /etc/conf.d to pass parameters to dhpcd via 'dhcp_wlan0=' and 'dhcpcd_wlan0'. Anyhow, you might also try with the default dhcpcd.conf.

best ... khay

----------

## tpereira

khayyam, I get the same deal:

```
gentooTEST tpereira # cat /etc/dhcpcd.conf 

#hostname

persistent

option rapid_commit

#option domain_name_servers, domain_name, domain_search, host_name

option domain_name_servers, domain_name, domain_search

option classless_static_routes

option ntp_servers

require dhcp_server_identifier

nohook lookup-hostname
```

```
gentooTEST tpereira # cat /etc/conf.d/net

config_enp1s0="dhcp"

dhcp_enp1s0="release"

dhcpcd_enp1s0="-t 20 --noipv4ll"

enable_ipv6_enp1s0="false"
```

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[8154]: version 6.2.0 starting

dhcpcd[8154]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

dhcpcd[8154]: enp1s0: IAID 85:98:70:65

dhcpcd[8154]: enp1s0: soliciting an IPv6 router

dhcpcd[8154]: enp1s0: soliciting a DHCP lease

dhcpcd[8154]: enp1s0: offered 10.136.222.248 from XXX.XXX.XXX.XXX

dhcpcd[8154]: enp1s0: no IPv6 Routers available

dhcpcd[8154]: enp1s0: leased 10.136.222.248 for 72000 seconds

dhcpcd[8154]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[8154]: enp1s0: adding default route via 10.136.254.254

dhcpcd[8154]: forked to background, child pid 8299                                    [ ok ]

 *     received address 10.136.222.248/16                                             [ ok ]

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                                    [ ok ]

 *   Removing addresses

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[8647]: version 6.2.0 starting

dhcpcd[8647]: enp1s0: waiting for carrier

dhcpcd[8647]: enp1s0: carrier acquired

dhcpcd[8647]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

dhcpcd[8647]: enp1s0: IAID 85:98:70:65

dhcpcd[8647]: enp1s0: soliciting an IPv6 router

dhcpcd[8647]: enp1s0: soliciting a DHCP lease

dhcpcd[8647]: enp1s0: no IPv6 Routers available

dhcpcd[8647]: timed out

dhcpcd[8647]: exited                                                                  [ !! ]

 * ERROR: net.enp1s0 failed to start
```

/var/log/messages:

```
May 12 13:18:47 gentooTEST dhcpcd[8154]: version 6.2.0 starting

May 12 13:18:47 gentooTEST dhcpcd[8154]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 12 13:18:47 gentooTEST dhcpcd[8154]: enp1s0: IAID 85:98:70:65

May 12 13:18:47 gentooTEST dhcpcd[8154]: enp1s0: soliciting an IPv6 router

May 12 13:18:47 gentooTEST dhcpcd[8154]: enp1s0: soliciting a DHCP lease

May 12 13:18:58 gentooTEST dhcpcd[8154]: enp1s0: offered 10.136.222.248 from XXX.XXX.XXX.XXX

May 12 13:18:59 gentooTEST dhcpcd[8154]: enp1s0: no IPv6 Routers available

May 12 13:19:04 gentooTEST dhcpcd[8154]: enp1s0: leased 10.136.222.248 for 72000 seconds

May 12 13:19:04 gentooTEST dhcpcd[8154]: enp1s0: adding route to 10.136.0.0/16

May 12 13:19:04 gentooTEST dhcpcd[8154]: enp1s0: adding default route via 10.136.254.254

May 12 13:19:04 gentooTEST dhcpcd[8154]: forked to background, child pid 8299

May 12 13:19:12 gentooTEST dhcpcd[8299]: received SIGHUP from PID 8454, releasing

May 12 13:19:12 gentooTEST dhcpcd[8299]: enp1s0: removing interface

May 12 13:19:12 gentooTEST dhcpcd[8299]: enp1s0: releasing lease of 10.136.222.248

May 12 13:19:12 gentooTEST dhcpcd[8299]: enp1s0: deleting route to 10.136.0.0/16

May 12 13:19:12 gentooTEST dhcpcd[8299]: enp1s0: deleting default route via 10.136.254.254

May 12 13:19:12 gentooTEST dhcpcd[8299]: exited

May 12 13:19:13 gentooTEST kernel: [ 4229.313461] r8169 0000:01:00.0 enp1s0: link down

May 12 13:19:13 gentooTEST kernel: [ 4229.313492] r8169 0000:01:00.0 enp1s0: link down

May 12 13:19:13 gentooTEST kernel: [ 4229.313540] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 12 13:19:13 gentooTEST dhcpcd[8647]: version 6.2.0 starting

May 12 13:19:13 gentooTEST dhcpcd[8647]: enp1s0: waiting for carrier

May 12 13:19:15 gentooTEST dhcpcd[8647]: enp1s0: carrier acquired

May 12 13:19:15 gentooTEST kernel: [ 4231.701092] r8169 0000:01:00.0 enp1s0: link up

May 12 13:19:15 gentooTEST kernel: [ 4231.701111] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 12 13:19:15 gentooTEST dhcpcd[8647]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 12 13:19:15 gentooTEST dhcpcd[8647]: enp1s0: IAID 85:98:70:65

May 12 13:19:15 gentooTEST dhcpcd[8647]: enp1s0: soliciting an IPv6 router

May 12 13:19:15 gentooTEST dhcpcd[8647]: enp1s0: soliciting a DHCP lease

May 12 13:19:28 gentooTEST dhcpcd[8647]: enp1s0: no IPv6 Routers available

May 12 13:19:33 gentooTEST dhcpcd[8647]: timed out

May 12 13:19:33 gentooTEST dhcpcd[8647]: exited

May 12 13:19:33 gentooTEST /etc/init.d/net.enp1s0[8372]: ERROR: net.enp1s0 failed to start
```

----------

## khayyam

 *tpereira wrote:*   

> khayyam, I get the same deal

 

tpereira ... yes, and I'm confused by the dhcp output, DUID is used though it is disabled in the dhcpcd.conf. Did you test with a unmodified dhcpcd.conf? Something like the following ...  

/etc/dhcpcd.conf

```
hostname

persistent

duid

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier
```

/etc/conf.d/net

```
modules_enp1s0="dhcpcd"

config_enp1s0="dhcp"

dhcpcd_enp1s0="--noipv4ll --ipv4only --waitip 4"

enable_ipv6_enp1s0="false"
```

Again, I'm really not sure what exactly is happening, and why a restart of net.enp1s0 is not getting ipv4 or why it susequently trys, and fails, to get ipv6. I also don't understand why DUID was not sent when using 'dhcpcd -d' (in a previous post) but it is when it is when disabled in your dhcpcd.conf ... that is a mystery, are you sure the configuration provided above is correct?

best ... khay

----------

## tpereira

I rechecked:

```
gentooTEST tpereira # cat /etc/dhcpcd.conf

hostname

persistent

duid

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier
```

```
gentooTEST tpereira # cat /etc/conf.d/net

modules_enp1s0="dhcpcd"

config_enp1s0="dhcp"

dhcpcd_enp1s0="--noipv4ll --ipv4only --waitip 4"

enable_ipv6_enp1s0="false"

```

```
gentooTEST etc # /etc/init.d/net.enp1s0 start

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[27605]: version 6.2.0 starting

dhcpcd[27605]: dev: loaded udev

dhcpcd[27605]: 4: interface not found or invalid

dhcpcd[27605]: enp1s0: waiting for carrier

dhcpcd[27605]: enp1s0: carrier acquired

dhcpcd[27605]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

dhcpcd[27605]: enp1s0: IAID 85:98:70:65

dhcpcd[27605]: enp1s0: rebinding lease of 10.136.225.242

dhcpcd[27605]: enp1s0: DHCP lease expired

dhcpcd[27605]: enp1s0: soliciting a DHCP lease

dhcpcd[27605]: timed out

dhcpcd[27605]: forked to background, child pid 27847                      [ ok ]

 *     received address                                                   [ ok ]

gentooTEST etc # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Removing addresses

 *     10.136.224.244/16

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[28321]: dhcpcd already running on pid 27847 (/run/dhcpcd.pid)      [ !! ]

 * ERROR: net.enp1s0 failed to start

gentooTEST etc # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[28813]: dhcpcd already running on pid 27847 (/run/dhcpcd.pid)      [ !! ]

 * ERROR: net.enp1s0 failed to start

gentooTEST etc # /etc/init.d/net.enp1s0 stop

 * WARNING: net.enp1s0 is already stopped

gentooTEST etc # /etc/init.d/net.enp1s0 start

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[29018]: dhcpcd already running on pid 27847 (/run/dhcpcd.pid)      [ !! ]

 * ERROR: net.enp1s0 failed to start
```

/var/log/messages:

```
May 12 21:23:59 gentooTEST kernel: [20536.323376] r8169 0000:01:00.0 enp1s0: link down

May 12 21:23:59 gentooTEST kernel: [20536.323404] r8169 0000:01:00.0 enp1s0: link down

May 12 21:23:59 gentooTEST kernel: [20536.323454] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 12 21:23:59 gentooTEST dhcpcd[27605]: version 6.2.0 starting

May 12 21:23:59 gentooTEST dhcpcd[27605]: dev: loaded udev

May 12 21:23:59 gentooTEST dhcpcd[27605]: 4: interface not found or invalid

May 12 21:23:59 gentooTEST dhcpcd[27605]: enp1s0: waiting for carrier

May 12 21:24:01 gentooTEST dhcpcd[27605]: enp1s0: carrier acquired

May 12 21:24:01 gentooTEST kernel: [20538.794673] r8169 0000:01:00.0 enp1s0: link up

May 12 21:24:01 gentooTEST kernel: [20538.794694] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 12 21:24:01 gentooTEST dhcpcd[27605]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 12 21:24:01 gentooTEST dhcpcd[27605]: enp1s0: IAID 85:98:70:65

May 12 21:24:01 gentooTEST dhcpcd[27605]: enp1s0: rebinding lease of 10.136.225.242

May 12 21:24:06 gentooTEST dhcpcd[27605]: enp1s0: DHCP lease expired

May 12 21:24:06 gentooTEST dhcpcd[27605]: enp1s0: soliciting a DHCP lease

May 12 21:24:29 gentooTEST dhcpcd[27605]: timed out

May 12 21:24:29 gentooTEST dhcpcd[27605]: forked to background, child pid 27847

May 12 21:24:34 gentooTEST dhcpcd[27847]: enp1s0: offered 10.136.224.244 from xxx.xxx.xxx.xxx

May 12 21:24:39 gentooTEST dhcpcd[27847]: enp1s0: leased 10.136.224.244 for 72000 seconds

May 12 21:24:39 gentooTEST dhcpcd[27847]: enp1s0: adding route to 10.136.0.0/16

May 12 21:24:39 gentooTEST dhcpcd[27847]: enp1s0: adding default route via 10.136.254.254

May 12 21:24:44 gentooTEST dhcpcd[27847]: enp1s0: removing IP address 10.136.224.244/16

May 12 21:24:44 gentooTEST dhcpcd[27847]: enp1s0: deleting route to 10.136.0.0/16

May 12 21:24:44 gentooTEST dhcpcd[27847]: enp1s0: deleting default route via 10.136.254.254

May 12 21:24:45 gentooTEST dhcpcd[27847]: enp1s0: carrier lost

May 12 21:24:45 gentooTEST kernel: [20582.368928] r8169 0000:01:00.0 enp1s0: link down

May 12 21:24:45 gentooTEST kernel: [20582.368952] r8169 0000:01:00.0 enp1s0: link down

May 12 21:24:45 gentooTEST kernel: [20582.369031] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 12 21:24:45 gentooTEST dhcpcd[27847]: enp1s0: carrier acquired

May 12 21:24:45 gentooTEST dhcpcd[27847]: enp1s0: carrier lost

May 12 21:24:45 gentooTEST dhcpcd[27847]: enp1s0: waiting for carrier

May 12 21:24:45 gentooTEST dhcpcd[28321]: dhcpcd already running on pid 27847 (/run/dhcpcd.pid)

May 12 21:24:45 gentooTEST /etc/init.d/net.enp1s0[28007]: ERROR: net.enp1s0 failed to start

May 12 21:24:48 gentooTEST dhcpcd[27847]: enp1s0: carrier acquired

May 12 21:24:48 gentooTEST kernel: [20585.149866] r8169 0000:01:00.0 enp1s0: link up

May 12 21:24:48 gentooTEST kernel: [20585.149887] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 12 21:24:48 gentooTEST dhcpcd[27847]: enp1s0: IAID 85:98:70:65

May 12 21:24:48 gentooTEST dhcpcd[27847]: enp1s0: rebinding lease of 10.136.224.244

May 12 21:24:53 gentooTEST dhcpcd[27847]: enp1s0: DHCP lease expired

May 12 21:24:53 gentooTEST dhcpcd[27847]: enp1s0: soliciting a DHCP lease

May 12 21:25:21 gentooTEST dhcpcd[27847]: enp1s0: offered 10.136.224.244 from xxx.xxx.xxx.xxx

May 12 21:25:25 gentooTEST dhcpcd[27847]: enp1s0: leased 10.136.224.244 for 72000 seconds

May 12 21:25:25 gentooTEST dhcpcd[27847]: enp1s0: adding route to 10.136.0.0/16

May 12 21:25:25 gentooTEST dhcpcd[27847]: enp1s0: adding default route via 10.136.254.254

May 12 21:25:32 gentooTEST dhcpcd[28813]: dhcpcd already running on pid 27847 (/run/dhcpcd.pid)

May 12 21:25:32 gentooTEST /etc/init.d/net.enp1s0[28678]: ERROR: net.enp1s0 failed to start

May 12 21:25:40 gentooTEST /etc/init.d/net.enp1s0[28866]: WARNING: net.enp1s0 is already stopped

May 12 21:25:43 gentooTEST dhcpcd[29018]: dhcpcd already running on pid 27847 (/run/dhcpcd.pid)

May 12 21:25:43 gentooTEST /etc/init.d/net.enp1s0[28888]: ERROR: net.enp1s0 failed to start
```

dhcpcd[27605]: 4: interface not found or invalid??????? 

Caused by "waitip 4"?

Further investigation also showed that the problem "dhcpcd already running on pid 27847" is caused by the "--waitip 4". Commenting only that option (waitip 4), causes the dhcpcd process to be killed when the service net.enp1s0 is stopped (as it should be, no?). Weird?

Regards

tiago

----------

## khayyam

 *tpereira wrote:*   

> Further investigation also showed that the problem "dhcpcd already running on pid 27847" is caused by the "--waitip 4". Commenting only that option (waitip 4), causes the dhcpcd process to be killed when the service net.enp1s0 is stopped (as it should be, no?). Weird?

 

tpereira ... yes, it's not a parameter I've used, I thought to add it as then it shouldn't hang around for the ipv6 router (which isn't available). Anyhow, just remove it.

best ... khay

----------

## tpereira

khayyam, I took away the parameter waitip 4. In fact it doesn't seem to make a difference in my case.

But... I'm left wondering... have you any idea why waitip 4 causes "dhcpcd[28813]: dhcpcd already running on pid..."?

Its weird.

I know it's a stupid question, but do you know how this configuration file is read? Is it possible a parsing bug?

More: I've arrived to the conclusion that issuing a "ifconfig enp1s0 up" before starting net.enp1s0 and then waiting ~15 seconds, it will work everytime:

If I start the net.enp1s0 service with enp1s0 down, I get:

```
gentooTEST ~ # /etc/init.d/net.enp1s0 start
```

```
May 13 12:35:51 gentooTEST kernel: [75248.402214] r8169 0000:01:00.0 enp1s0: link down

May 13 12:35:51 gentooTEST kernel: [75248.402241] r8169 0000:01:00.0 enp1s0: link down

May 13 12:35:51 gentooTEST kernel: [75248.402293] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 13 12:35:51 gentooTEST dhcpcd[27793]: version 6.2.0 starting

May 13 12:35:51 gentooTEST dhcpcd[27793]: enp1s0: waiting for carrier

May 13 12:35:53 gentooTEST kernel: [75250.921369] r8169 0000:01:00.0 enp1s0: link up

May 13 12:35:53 gentooTEST kernel: [75250.921390] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 13 12:35:53 gentooTEST dhcpcd[27793]: enp1s0: carrier acquired

May 13 12:35:53 gentooTEST dhcpcd[27793]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 13 12:35:53 gentooTEST dhcpcd[27793]: enp1s0: IAID 85:98:70:65

May 13 12:35:53 gentooTEST dhcpcd[27793]: enp1s0: soliciting a DHCP lease

May 13 12:36:21 gentooTEST dhcpcd[27793]: timed out

May 13 12:36:21 gentooTEST dhcpcd[27793]: exited

May 13 12:36:21 gentooTEST /etc/init.d/net.enp1s0[27513]: ERROR: net.enp1s0 failed to start
```

Starting the enp1s0 if, before starting the actual services:

```
gentooTEST ~ # ifconfig enp1s0 up

gentooTEST ~ # /etc/init.d/net.enp1s0 start

 * Bringing up interface enp1s0

 *   Running preup ...

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[29702]: version 6.2.0 starting

dhcpcd[29702]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

dhcpcd[29702]: enp1s0: IAID 85:98:70:65

dhcpcd[29702]: enp1s0: rebinding lease of 10.136.224.244

dhcpcd[29702]: enp1s0: leased 10.136.224.244 for 72000 seconds

dhcpcd[29702]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[29702]: enp1s0: adding default route via 10.136.254.254

dhcpcd[29702]: forked to background, child pid 29793                      [ ok ]

 *     received address 10.136.224.244/16                                 [ ok ]
```

/var/log/messages:

```
May 13 12:38:34 gentooTEST kernel: [75411.699839] r8169 0000:01:00.0 enp1s0: link down

May 13 12:38:34 gentooTEST kernel: [75411.699859] r8169 0000:01:00.0 enp1s0: link down

May 13 12:38:34 gentooTEST kernel: [75411.699914] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 13 12:38:37 gentooTEST kernel: [75414.082150] r8169 0000:01:00.0 enp1s0: link up

May 13 12:38:37 gentooTEST kernel: [75414.082170] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 13 12:39:19 gentooTEST dhcpcd[29702]: version 6.2.0 starting

May 13 12:39:19 gentooTEST dhcpcd[29702]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 13 12:39:19 gentooTEST dhcpcd[29702]: enp1s0: IAID 85:98:70:65

May 13 12:39:19 gentooTEST dhcpcd[29702]: enp1s0: rebinding lease of 10.136.224.244

May 13 12:39:25 gentooTEST dhcpcd[29702]: enp1s0: leased 10.136.224.244 for 72000 seconds

May 13 12:39:25 gentooTEST dhcpcd[29702]: enp1s0: adding route to 10.136.0.0/16

May 13 12:39:25 gentooTEST dhcpcd[29702]: enp1s0: adding default route via 10.136.254.254

May 13 12:39:25 gentooTEST dhcpcd[29702]: forked to background, child pid 29793

May 13 12:40:01 gentooTEST cron[30062]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)
```

```
gentooTEST tpereira # cat /etc/conf.d/net

modules_enp1s0="dhcpcd"

config_enp1s0="dhcp"

dhcpcd_enp1s0="--noipv4ll --ipv4only"

enable_ipv6_enp1s0="false"
```

```
gentooTEST ~ # cat /etc/dhcpcd.conf

hostname

persistent

duid

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier
```

Any ideas?

----------

## khayyam

tpereira ... sorry for the delay, I seem to have overlooked the topic reply notification.

 *tpereira wrote:*   

> But... I'm left wondering... have you any idea why waitip 4 causes "dhcpcd[28813]: dhcpcd already running on pid..."?

 

This is because the option causes the process to fail, but the daemon is left running ...

As to the problem, there is similar issue with dhcp from another poster can you try the following:

/etc/dhcpcd.conf

```
hostname

persistent

clientid

#duid

option rapid_commit

#option interface_mtu

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier
```

If this fails, comment "clientid" and uncomment "option interface_mtu" and try again (or simply uncomment "option interface_mtu" ... as I'm not sure whether it is mtu or duid which fixed the other posters problem).

HTH & best ... khay

----------

## tpereira

All sets of options give basically the same result.

VERSION 1:

```
gentooTEST tpereira # cat /etc/conf.d/net

modules_enp1s0="dhcpcd"

config_enp1s0="dhcp"

dhcpcd_enp1s0="--noipv4ll --ipv4only"

enable_ipv6_enp1s0="false"

gentooTEST tpereira # cat /etc/dhcpcd.conf

hostname

persistent

clientid

#duid

option rapid_commit

#option interface_mtu

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier
```

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[1253]: version 6.2.0 starting

dhcpcd[1253]: enp1s0: soliciting a DHCP lease

dhcpcd[1253]: enp1s0: offered 10.136.225.242 from xxx.xxx.xxx.xxx

dhcpcd[1253]: enp1s0: leased 10.136.225.242 for 72000 seconds

dhcpcd[1253]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[1253]: enp1s0: adding default route via 10.136.254.254

dhcpcd[1253]: forked to background, child pid 1326                        [ ok ]

 *     received address 10.136.225.242/16                                 [ ok ]

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                        [ ok ]

 *   Removing addresses

 *     10.136.225.242/16

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[1716]: version 6.2.0 starting

dhcpcd[1716]: enp1s0: waiting for carrier

dhcpcd[1716]: enp1s0: carrier acquired

dhcpcd[1716]: enp1s0: rebinding lease of 10.136.225.242

dhcpcd[1716]: enp1s0: DHCP lease expired

dhcpcd[1716]: enp1s0: soliciting a DHCP lease

dhcpcd[1716]: timed out

dhcpcd[1716]: exited                                                      [ !! ]

 * ERROR: net.enp1s0 failed to start

```

/var/log/messages

```
May 14 13:52:24 gentooTEST dhcpcd[1253]: version 6.2.0 starting

May 14 13:52:24 gentooTEST dhcpcd[1253]: enp1s0: soliciting a DHCP lease

May 14 13:52:24 gentooTEST dhcpcd[1253]: enp1s0: offered 10.136.225.242 from 

May 14 13:52:28 gentooTEST dhcpcd[1253]: enp1s0: leased 10.136.225.242 for 72000 seconds

May 14 13:52:28 gentooTEST dhcpcd[1253]: enp1s0: adding route to 10.136.0.0/16

May 14 13:52:28 gentooTEST dhcpcd[1253]: enp1s0: adding default route via 10.136.254.254

May 14 13:52:28 gentooTEST dhcpcd[1253]: forked to background, child pid 1326

May 14 13:52:40 gentooTEST dhcpcd[1326]: received SIGTERM from PID 1523, stopping

May 14 13:52:40 gentooTEST dhcpcd[1326]: enp1s0: removing interface

May 14 13:52:40 gentooTEST dhcpcd[1326]: exited

May 14 13:52:41 gentooTEST kernel: [77859.806121] r8169 0000:01:00.0 enp1s0: link down

May 14 13:52:41 gentooTEST kernel: [77859.806147] r8169 0000:01:00.0 enp1s0: link down

May 14 13:52:41 gentooTEST kernel: [77859.806190] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 14 13:52:41 gentooTEST dhcpcd[1716]: version 6.2.0 starting

May 14 13:52:41 gentooTEST dhcpcd[1716]: enp1s0: waiting for carrier

May 14 13:52:44 gentooTEST kernel: [77862.565727] r8169 0000:01:00.0 enp1s0: link up

May 14 13:52:44 gentooTEST kernel: [77862.565749] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 14 13:52:44 gentooTEST dhcpcd[1716]: enp1s0: carrier acquired

May 14 13:52:44 gentooTEST dhcpcd[1716]: enp1s0: rebinding lease of 10.136.225.242

May 14 13:52:49 gentooTEST dhcpcd[1716]: enp1s0: DHCP lease expired

May 14 13:52:49 gentooTEST dhcpcd[1716]: enp1s0: soliciting a DHCP lease

May 14 13:53:11 gentooTEST dhcpcd[1716]: timed out

May 14 13:53:11 gentooTEST dhcpcd[1716]: exited

May 14 13:53:11 gentooTEST /etc/init.d/net.enp1s0[1443]: ERROR: net.enp1s0 failed to start
```

VERSION 2

```
gentooTEST tpereira # cat /etc/dhcpcd.conf

hostname

persistent

clientid

#duid

option rapid_commit

option interface_mtu

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier
```

```
gentooTEST tpereira # cat /etc/conf.d/net

modules_enp1s0="dhcpcd"

config_enp1s0="dhcp"

dhcpcd_enp1s0="--noipv4ll --ipv4only"

enable_ipv6_enp1s0="false"
```

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[28743]: version 6.2.0 starting

dhcpcd[28743]: enp1s0: soliciting a DHCP lease

dhcpcd[28743]: enp1s0: offered 10.136.225.242 from xxx.xxx.xxx.xxx

dhcpcd[28743]: enp1s0: leased 10.136.225.242 for 72000 seconds

dhcpcd[28743]: enp1s0: adding route to 10.136.0.0/16

dhcpcd[28743]: enp1s0: adding default route via 10.136.254.254

dhcpcd[28743]: forked to background, child pid 28823                      [ ok ]

 *     received address 10.136.225.242/16                                 [ ok ]

gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                        [ ok ]

 *   Removing addresses

 *     10.136.225.242/16

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[29145]: version 6.2.0 starting

dhcpcd[29145]: enp1s0: waiting for carrier

dhcpcd[29145]: enp1s0: carrier acquired

dhcpcd[29145]: enp1s0: rebinding lease of 10.136.225.242

dhcpcd[29145]: enp1s0: DHCP lease expired

dhcpcd[29145]: enp1s0: soliciting a DHCP lease

dhcpcd[29145]: timed out

dhcpcd[29145]: exited                                                     [ !! ]

 * ERROR: net.enp1s0 failed to start
```

/var/Log/messages

```
May 14 14:53:28 gentooTEST dhcpcd[28743]: version 6.2.0 starting

May 14 14:53:28 gentooTEST dhcpcd[28743]: enp1s0: soliciting a DHCP lease

May 14 14:53:28 gentooTEST dhcpcd[28743]: enp1s0: offered 10.136.225.242 from xxx.xxx.xxx.xxx

May 14 14:53:33 gentooTEST dhcpcd[28743]: enp1s0: leased 10.136.225.242 for 72000 seconds

May 14 14:53:33 gentooTEST dhcpcd[28743]: enp1s0: adding route to 10.136.0.0/16

May 14 14:53:33 gentooTEST dhcpcd[28743]: enp1s0: adding default route via 10.136.254.254

May 14 14:53:34 gentooTEST dhcpcd[28743]: forked to background, child pid 28823

May 14 14:53:36 gentooTEST dhcpcd[28823]: received SIGTERM from PID 28953, stopping

May 14 14:53:36 gentooTEST dhcpcd[28823]: enp1s0: removing interface

May 14 14:53:36 gentooTEST dhcpcd[28823]: exited

May 14 14:53:37 gentooTEST kernel: [81515.532631] r8169 0000:01:00.0 enp1s0: link down

May 14 14:53:37 gentooTEST kernel: [81515.532658] r8169 0000:01:00.0 enp1s0: link down

May 14 14:53:37 gentooTEST kernel: [81515.532706] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 14 14:53:37 gentooTEST dhcpcd[29145]: version 6.2.0 starting

May 14 14:53:37 gentooTEST dhcpcd[29145]: enp1s0: waiting for carrier

May 14 14:53:40 gentooTEST dhcpcd[29145]: enp1s0: carrier acquired

May 14 14:53:40 gentooTEST kernel: [81518.498230] r8169 0000:01:00.0 enp1s0: link up

May 14 14:53:40 gentooTEST kernel: [81518.498251] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 14 14:53:40 gentooTEST dhcpcd[29145]: enp1s0: rebinding lease of 10.136.225.242

May 14 14:53:45 gentooTEST dhcpcd[29145]: enp1s0: DHCP lease expired

May 14 14:53:45 gentooTEST dhcpcd[29145]: enp1s0: soliciting a DHCP lease

May 14 14:54:07 gentooTEST dhcpcd[29145]: timed out

May 14 14:54:07 gentooTEST dhcpcd[29145]: exited

May 14 14:54:07 gentooTEST /etc/init.d/net.enp1s0[28867]: ERROR: net.enp1s0 failed to start
```

Commenting clientid, results in same. 

If you dont mind, I'll be posting some dumps of the tcp traffic of dhcp packects.

I've also discovered that increasing the timeout of the dhcpcd (--timeout) to say 600 seconds will yield positive result everytime.

----------

## tpereira

Sucessful:

```
[4:58:00.702633 IP (tos 0x0, ttl 64, id 16415, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x5e72efb0, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

14:58:01.642775 IP (tos 0x10, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 341)

    xxx.xxx.xxx.xxx.bootps > 10.136.224.244.bootpc: BOOTP/DHCP, Reply, length 313, xid 0x5e72efb0, Flags [none]

          Your-IP 10.136.224.244

          Server-IP xxx.xxx.xxx.xxx

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Offer

            Server-ID Option 54, length 4: xxx.xxx.xxx.xxx

            Lease-Time Option 51, length 4: 72000

            Subnet-Mask Option 1, length 4: 255.255.0.0

            Default-Gateway Option 3, length 4: 10.136.254.254

            Domain-Name-Server Option 6, length 8: 10.136.253.253,10.136.253.2

            Domain-Name Option 15, length 15: "zzz.zzz.zzz.zz"

            BR Option 28, length 4: 10.136.255.255

            RN Option 58, length 4: 36000

            RB Option 59, length 4: 63000

14:58:01.643042 IP (tos 0x0, ttl 64, id 63951, offset 0, flags [none], proto UDP (17), length 391)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 363, xid 0x5e72efb0, secs 1, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Request

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            Requested-IP Option 50, length 4: 10.136.224.244

            Server-ID Option 54, length 4: xxx.xxx.xxx.xxx

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

14:58:01.664196 IP (tos 0x10, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 341)

    xxx.xxx.xxx.xxx.bootps > 10.136.224.244.bootpc: BOOTP/DHCP, Reply, length 313, xid 0x5e72efb0, secs 1, Flags [none]

          Your-IP 10.136.224.244

          Server-IP xxx.xxx.xxx.xxx

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: ACK

            Server-ID Option 54, length 4: xxx.xxx.xxx.xxx

            Lease-Time Option 51, length 4: 72000

            Subnet-Mask Option 1, length 4: 255.255.0.0

            Default-Gateway Option 3, length 4: 10.136.254.254

            Domain-Name-Server Option 6, length 8: 10.136.253.253,10.136.253.2

            Domain-Name Option 15, length 15: "zzz.zzz.zzz.zz"

            BR Option 28, length 4: 10.136.255.255

            RN Option 58, length 4: 36000

            RB Option 59, length 4: 63000
```

Not successful:

```
14:58:38.146767 IP (tos 0x0, ttl 64, id 15336, offset 0, flags [none], proto UDP (17), length 385)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 357, xid 0x654a518e, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Request

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            Requested-IP Option 50, length 4: 10.136.224.244

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

14:58:43.151615 IP (tos 0x0, ttl 64, id 18359, offset 0, flags [none], proto UDP (17), length 385)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 357, xid 0x654a518e, secs 5, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Request

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            Requested-IP Option 50, length 4: 10.136.224.244

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

14:58:43.200580 IP (tos 0x0, ttl 64, id 10935, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x91afdcd1, secs 5, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

14:58:47.627880 IP (tos 0x0, ttl 64, id 41984, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x91afdcd1, secs 10, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

14:58:55.789578 IP (tos 0x0, ttl 64, id 63821, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x91afdcd1, secs 18, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119
```

----------

## tpereira

I've add timeout 600 to /etc/dhcpcd.conf.

I get a offer from dhcp server after 4 discover packages (around 30 seconds)

What say you?

```
tcpdump -i enp1s0 -p udp 'port 67 or port 66' -v

17:32:53.656463 IP (tos 0x0, ttl 64, id 35582, offset 0, flags [none], proto UDP (17), length 385)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 357, xid 0xa28e2c0a, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Request

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            Requested-IP Option 50, length 4: 10.136.224.244

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:32:57.171544 IP (tos 0x0, ttl 64, id 54651, offset 0, flags [none], proto UDP (17), length 385)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 357, xid 0xa28e2c0a, secs 3, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Request

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            Requested-IP Option 50, length 4: 10.136.224.244

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:32:58.704197 IP (tos 0x0, ttl 64, id 39084, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x64aba1d7, secs 5, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:33:03.054993 IP (tos 0x0, ttl 64, id 41395, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x64aba1d7, secs 9, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:33:11.275710 IP (tos 0x0, ttl 64, id 64252, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x64aba1d7, secs 17, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:33:27.145185 IP (tos 0x0, ttl 64, id 35259, offset 0, flags [none], proto UDP (17), length 381)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 353, xid 0x64aba1d7, secs 33, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            SLP-NA Option 80, length 0""

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:33:28.038574 IP (tos 0x10, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 341)

    xxx.xxx.xxx.xxx.bootps > 10.136.224.244.bootpc: BOOTP/DHCP, Reply, length 313, xid 0x64aba1d7, secs 33, Flags [none]

          Your-IP 10.136.224.244

          Server-IP xxx.xxx.xxx.xxx

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Offer

            Server-ID Option 54, length 4: xxx.xxx.xxx.xxx

            Lease-Time Option 51, length 4: 72000

            Subnet-Mask Option 1, length 4: 255.255.0.0

            Default-Gateway Option 3, length 4: 10.136.254.254

            Domain-Name-Server Option 6, length 8: 10.136.253.253,10.136.253.2

            Domain-Name Option 15, length 15: "zzz.zzz.zzz.zz"

            BR Option 28, length 4: 10.136.255.255

            RN Option 58, length 4: 36000

            RB Option 59, length 4: 63000

17:33:28.038836 IP (tos 0x0, ttl 64, id 20982, offset 0, flags [none], proto UDP (17), length 391)

    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:21:85:98:70:65 (oui Unknown), length 363, xid 0x64aba1d7, secs 34, Flags [none]

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Request

            Client-ID Option 61, length 19: hardware-type 255, 85:98:70:65:00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

            Requested-IP Option 50, length 4: 10.136.224.244

            Server-ID Option 54, length 4: xxx.xxx.xxx.xxx

            MSZ Option 57, length 2: 1500

            Vendor-Class Option 60, length 51: "dhcpcd-6.2.0:Linux-3.12.13-gentoo:i686:GenuineIntel"

            Hostname Option 12, length 10: "gentooTEST"

            Parameter-Request Option 55, length 15: 

              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway

              Domain-Name-Server, Hostname, Domain-Name, MTU

              BR, NTP, Lease-Time, Server-ID

              RN, RB, Option 119

17:33:28.059772 IP (tos 0x10, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 341)

    xxx.xxx.xxx.xxx.bootps > 10.136.224.244.bootpc: BOOTP/DHCP, Reply, length 313, xid 0x64aba1d7, secs 34, Flags [none]

          Your-IP 10.136.224.244

          Server-IP xxx.xxx.xxx.xxx

          Client-Ethernet-Address 00:21:85:98:70:65 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: ACK

            Server-ID Option 54, length 4: xxx.xxx.xxx.xxx

            Lease-Time Option 51, length 4: 72000

            Subnet-Mask Option 1, length 4: 255.255.0.0

            Default-Gateway Option 3, length 4: 10.136.254.254

            Domain-Name-Server Option 6, length 8: 10.136.253.253,10.136.253.2

            Domain-Name Option 15, length 15: "zzz.zzz.zzz.zz"

            BR Option 28, length 4: 10.136.255.255

            RN Option 58, length 4: 36000

            RB Option 59, length 4: 63000
```

----------

## khayyam

tpereira ... firstly, why are you obfusticating the address of the dhcp server, I assume its also in the 10.136.0.0/16 network? Thats a reserved address, there is no reason to hide it. From the default gateway responce I assume its the same address: 10.136.254.254. Secondly, thats a lot of data to plow through, and having done so I don't see anything revealing in the comparison of success/failure, is there something I missed?

What I can see it this, your lease time is fine (72000 seconds == 20 hours), but that lease is shown to have "expired" on a subsequent restart (I assume this happens almost immediately). Why this happens I can only speculate, perhaps the dhcp server is misconfigured, perhaps your client is failing to communicate with it for some reason ... whatever the reason the lease should be valid, and (even if it had expired) it should have been renewed before the 20th hour.

Anyhow, I'm not sure how to go about debugging the issue, I should however ask, is this your router?

So, one thing you can try is add 'release' to dhcp_${IFACE}

/etc/conf.d/net

```
dhcp_enp1s0="release"
```

The second suggestion is a workarround, it should at least prevent dhcp trying to renew the lease on 'restart'.

/etc/conf.d/net

```
preup() {

   [ -f "/var/lib/dhcpcd/dhcpcd-${IFACE}.lease" ] && {

      rm -f /var/lib/dhcpcd/dhcpcd-${IFACE}.lease

      }

   return 0 

}
```

One or other of these should provide a solution, hopefully. If not then I'd need to have more details about the router/gateway/dhcp.

HTH & best ... khay

----------

## tpereira

/etc/conf.d/net:

```
modules_enp1s0="dhcpcd"

config_enp1s0="dhcp"

dhcpcd_enp1s0="--noipv4ll --ipv4only"

enable_ipv6_enp1s0="false"

dhcp_enp1s0="release"
```

it fails like this:

/var/log/messages:

```
May 15 12:25:21 gentooTEST dhcpcd[12548]: received SIGHUP from PID 12692, releasing

May 15 12:25:21 gentooTEST dhcpcd[12548]: enp1s0: removing interface

May 15 12:25:21 gentooTEST dhcpcd[12548]: enp1s0: releasing lease of 10.136.224.244

May 15 12:25:21 gentooTEST dhcpcd[12548]: enp1s0: deleting route to 10.136.0.0/16

May 15 12:25:21 gentooTEST dhcpcd[12548]: enp1s0: deleting default route via 10.136.254.254

May 15 12:25:21 gentooTEST dhcpcd[12548]: exited

May 15 12:25:22 gentooTEST kernel: [58077.511039] r8169 0000:01:00.0 enp1s0: link down

May 15 12:25:22 gentooTEST kernel: [58077.511060] r8169 0000:01:00.0 enp1s0: link down

May 15 12:25:22 gentooTEST kernel: [58077.511110] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 15 12:25:22 gentooTEST dhcpcd[12888]: version 6.2.0 starting

May 15 12:25:22 gentooTEST dhcpcd[12888]: enp1s0: waiting for carrier

May 15 12:25:24 gentooTEST dhcpcd[12888]: enp1s0: carrier acquired

May 15 12:25:24 gentooTEST kernel: [58080.288337] r8169 0000:01:00.0 enp1s0: link up

May 15 12:25:24 gentooTEST kernel: [58080.288358] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 15 12:25:24 gentooTEST dhcpcd[12888]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 15 12:25:24 gentooTEST dhcpcd[12888]: enp1s0: IAID 85:98:70:65

May 15 12:25:24 gentooTEST dhcpcd[12888]: enp1s0: soliciting a DHCP lease

May 15 12:25:52 gentooTEST dhcpcd[12888]: timed out

May 15 12:25:52 gentooTEST dhcpcd[12888]: exited

May 15 12:25:52 gentooTEST /etc/init.d/net.enp1s0[12606]: ERROR: net.enp1s0 failed to start
```

By deleting the lease file, in the preup, it fails also:

/var/log/messages:

```
May 15 12:30:38 gentooTEST dhcpcd[15662]: received SIGHUP from PID 16039, releasing

May 15 12:30:38 gentooTEST dhcpcd[15662]: enp1s0: removing interface

May 15 12:30:38 gentooTEST dhcpcd[15662]: enp1s0: releasing lease of 10.136.224.244

May 15 12:30:38 gentooTEST dhcpcd[15662]: enp1s0: deleting route to 10.136.0.0/16

May 15 12:30:38 gentooTEST dhcpcd[15662]: enp1s0: deleting default route via 10.136.254.254

May 15 12:30:38 gentooTEST dhcpcd[15662]: exited

May 15 12:30:38 gentooTEST kernel: [58394.246348] r8169 0000:01:00.0 enp1s0: link down

May 15 12:30:38 gentooTEST kernel: [58394.246385] r8169 0000:01:00.0 enp1s0: link down

May 15 12:30:38 gentooTEST kernel: [58394.246452] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 15 12:30:39 gentooTEST dhcpcd[16245]: version 6.2.0 starting

May 15 12:30:39 gentooTEST dhcpcd[16245]: enp1s0: waiting for carrier

May 15 12:30:41 gentooTEST dhcpcd[16245]: enp1s0: carrier acquired

May 15 12:30:41 gentooTEST kernel: [58396.506784] r8169 0000:01:00.0 enp1s0: link up

May 15 12:30:41 gentooTEST kernel: [58396.506805] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 15 12:30:41 gentooTEST dhcpcd[16245]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 15 12:30:41 gentooTEST dhcpcd[16245]: enp1s0: IAID 85:98:70:65

May 15 12:30:41 gentooTEST dhcpcd[16245]: enp1s0: soliciting a DHCP lease

May 15 12:31:09 gentooTEST dhcpcd[16245]: timed out

May 15 12:31:09 gentooTEST dhcpcd[16245]: exited

May 15 12:31:09 gentooTEST /etc/init.d/net.enp1s0[15960]: ERROR: net.enp1s0 failed to start
```

 *Quote:*   

> ...why are you obfusticating...

 

The IP address of the dhcpcd server is in fact a public IP address, but it is on our lan. I don't know why.

 *Quote:*   

> Secondly, thats a lot of data to plow through, and having done so I don't see anything revealing in the comparison of success/failure, is there something I missed? 

 

Sorry about that and thanks for going through it. The conclusions I draw from var/log/messages and tcpdumps are

1 The enp1s0 is up and running

2 You try to restart it

3 It goes down and 3 seconds later it goes up

4 At this point the first 4 discover sent by dhcpcd packets seem to get lost in the lan

5 the dhcpcd times out and we get a fail

1The enp1s0 is down

2 You try to start it

3 It goes up and the dhcpcd starts sending discover packets

3 The first or second discover packets meet with good response from dhcp server

4 Success at getting ip address

Ie, the process is only successful if it starts with the enp1s0 down. Hence the failing every other time

The only successful workaround so far is increasing the timeout in dhcpcd.conf. I suspect something in the lan is causing this. I see no point in us wasting any more time around this matter.

I thank you for all the time you spent reading my logs and tcpdumps

Best

tpereira

----------

## khayyam

 *tpereira wrote:*   

> Ie, the process is only successful if it starts with the enp1s0 down.

 

tpereira ... ok, try removing/commenting 'persistent' from /etc/dhcpcd.conf. This will cause dhcpcd to de-configure the interface on exit.

 *tpereira wrote:*   

> The only successful workaround so far is increasing the timeout in dhcpcd.conf. I suspect something in the lan is causing this. I see no point in us wasting any more time around this matter. I thank you for all the time you spent reading my logs and tcpdumps

 

You're welcome. I suspect that whats happening is there is a dhcp-repeater on the network, this forwards to the dhcp server outside the LAN, this happens transparently but when re-newing the lease it trys to contact that same dhcp server, which of course isn't seen (not being on the 10.136.0.0/16 network).

best ... khay

----------

## tpereira

 *Quote:*   

> try removing/commenting 'persistent' from /etc/dhcpcd.conf. This

 

Same deal:

```
gentooTEST tpereira # /etc/init.d/net.enp1s0 restart

 * Bringing down interface enp1s0

 *   Stopping dhcpcd on enp1s0 ...                                                                                                              [ ok ]

 *   Removing addresses

 * Bringing up interface enp1s0

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[25171]: version 6.2.0 starting

dhcpcd[25171]: enp1s0: waiting for carrier

dhcpcd[25171]: enp1s0: carrier acquired

dhcpcd[25171]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

dhcpcd[25171]: enp1s0: IAID 85:98:70:65

dhcpcd[25171]: enp1s0: soliciting a DHCP lease

dhcpcd[25171]: timed out

dhcpcd[25171]: exited                                                                                                                           [ !! ]

 * ERROR: net.enp1s0 failed to start
```

/var/log/messages:

```
May 16 15:14:39 gentooTEST dhcpcd[24551]: received SIGHUP from PID 24973, releasing

May 16 15:14:39 gentooTEST dhcpcd[24551]: enp1s0: removing interface

May 16 15:14:39 gentooTEST dhcpcd[24551]: enp1s0: releasing lease of 10.136.224.244

May 16 15:14:39 gentooTEST dhcpcd[24551]: enp1s0: deleting route to 10.136.0.0/16

May 16 15:14:39 gentooTEST dhcpcd[24551]: enp1s0: deleting default route via 10.136.254.254

May 16 15:14:39 gentooTEST dhcpcd[24551]: exited

May 16 15:14:39 gentooTEST kernel: [154635.247373] r8169 0000:01:00.0 enp1s0: link down

May 16 15:14:39 gentooTEST kernel: [154635.247395] r8169 0000:01:00.0 enp1s0: link down

May 16 15:14:39 gentooTEST kernel: [154635.247452] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

May 16 15:14:40 gentooTEST dhcpcd[25171]: version 6.2.0 starting

May 16 15:14:40 gentooTEST dhcpcd[25171]: enp1s0: waiting for carrier

May 16 15:14:42 gentooTEST dhcpcd[25171]: enp1s0: carrier acquired

May 16 15:14:42 gentooTEST kernel: [154638.263994] r8169 0000:01:00.0 enp1s0: link up

May 16 15:14:42 gentooTEST kernel: [154638.264015] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

May 16 15:14:42 gentooTEST dhcpcd[25171]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

May 16 15:14:42 gentooTEST dhcpcd[25171]: enp1s0: IAID 85:98:70:65

May 16 15:14:42 gentooTEST dhcpcd[25171]: enp1s0: soliciting a DHCP lease

May 16 15:15:10 gentooTEST dhcpcd[25171]: timed out

May 16 15:15:10 gentooTEST dhcpcd[25171]: exited

May 16 15:15:10 gentooTEST /etc/init.d/net.enp1s0[24886]: ERROR: net.enp1s0 failed to start
```

```
but when re-newing the lease it trys to contact that same dhcp server, which of course isn't seen
```

What about the 4 discover packets that seem to go into oblivion. Souldn't these packages reach the dhcp server anyway? Shouldn't it answer anyway?

tpereira

----------

## tpereira

Also discover that after configuring the net if card, it takes around 30 seconds to be able to reach any other machine:

```
gentooTEST tpereira # ifconfig enp1s0 down

gentooTEST tpereira # ifconfig enp1s0 up; ifconfig enp1s0 10.136.224.244; route add -net 0.0.0.0 gw 10.136.254.254; ping 10.136.254.254

PING 10.136.254.254 (10.136.254.254) 56(84) bytes of data.

From 10.136.224.244: icmp_seq=1 Destination Host Unreachable

From 10.136.224.244: icmp_seq=2 Destination Host Unreachable

From 10.136.224.244: icmp_seq=3 Destination Host Unreachable

From 10.136.224.244: icmp_seq=4 Destination Host Unreachable

From 10.136.224.244: icmp_seq=5 Destination Host Unreachable

From 10.136.224.244: icmp_seq=6 Destination Host Unreachable

From 10.136.224.244: icmp_seq=7 Destination Host Unreachable

From 10.136.224.244: icmp_seq=8 Destination Host Unreachable

From 10.136.224.244: icmp_seq=9 Destination Host Unreachable

From 10.136.224.244: icmp_seq=10 Destination Host Unreachable

From 10.136.224.244: icmp_seq=11 Destination Host Unreachable

From 10.136.224.244: icmp_seq=12 Destination Host Unreachable

From 10.136.224.244: icmp_seq=13 Destination Host Unreachable

From 10.136.224.244: icmp_seq=14 Destination Host Unreachable

From 10.136.224.244: icmp_seq=15 Destination Host Unreachable

From 10.136.224.244: icmp_seq=16 Destination Host Unreachable

From 10.136.224.244: icmp_seq=17 Destination Host Unreachable

From 10.136.224.244: icmp_seq=18 Destination Host Unreachable

From 10.136.224.244: icmp_seq=19 Destination Host Unreachable

From 10.136.224.244: icmp_seq=20 Destination Host Unreachable

From 10.136.224.244: icmp_seq=21 Destination Host Unreachable

From 10.136.224.244: icmp_seq=22 Destination Host Unreachable

From 10.136.224.244: icmp_seq=23 Destination Host Unreachable

From 10.136.224.244: icmp_seq=24 Destination Host Unreachable

From 10.136.224.244: icmp_seq=25 Destination Host Unreachable

From 10.136.224.244: icmp_seq=26 Destination Host Unreachable

From 10.136.224.244: icmp_seq=27 Destination Host Unreachable

From 10.136.224.244: icmp_seq=28 Destination Host Unreachable

From 10.136.224.244: icmp_seq=29 Destination Host Unreachable

From 10.136.224.244: icmp_seq=30 Destination Host Unreachable

From 10.136.224.244: icmp_seq=31 Destination Host Unreachable

From 10.136.224.244: icmp_seq=32 Destination Host Unreachable

64 bytes from 10.136.254.254: icmp_seq=33 ttl=64 time=1001 ms

64 bytes from 10.136.254.254: icmp_seq=34 ttl=64 time=1.21 ms

64 bytes from 10.136.254.254: icmp_seq=35 ttl=64 time=0.113 ms

64 bytes from 10.136.254.254: icmp_seq=36 ttl=64 time=0.121 ms

64 bytes from 10.136.254.254: icmp_seq=37 ttl=64 time=0.122 ms

64 bytes from 10.136.254.254: icmp_seq=38 ttl=64 time=0.136 ms

64 bytes from 10.136.254.254: icmp_seq=39 ttl=64 time=0.133 ms
```

(10.136.254.254 is the first machine after mine in a tracepath xxx.xxx.xxx.xxx)

----------

## khayyam

 *tpereira wrote:*   

>  *khayyam wrote:*   [...] but when re-newing the lease it trys to contact that same dhcp server, which of course isn't seen 
> 
> What about the 4 discover packets that seem to go into oblivion. Souldn't these packages reach the dhcp server anyway? Shouldn't it answer anyway?

 

tpereira ... yes, of course you're right, the discovery should reach the dhcp-relay, I was (wrongly) thinking the problem was with the network.

 *tpereira wrote:*   

> Also discover that after configuring the net if card, it takes around 30 seconds to be able to reach any other machine

 

oh my ... this hints at a problem with the driver (or card) ... what card is it, and what driver is in use. Also, is it builtin or module, and does 'modinfo <driver> | egrep "^parm"' provide anything of interest? Like pme/power settings ... you might pastebin your .config.

best ... khay

----------

## tpereira

```
gentooTEST linux-3.12.13-gentoo # uname -a

Linux gentooTEST 3.12.13-gentoo #3 SMP Mon May 12 13:38:47 WEST 2014 i686 Genuine Intel(R) CPU 230 @ 1.60GHz GenuineIntel GNU/Linux
```

```
gentooTEST linux-3.12.13-gentoo # modinfo r8169

filename:       /lib/modules/3.12.13-gentoo/kernel/drivers/net/ethernet/realtek/r8169.ko

firmware:       rtl_nic/rtl8168g-3.fw

firmware:       rtl_nic/rtl8168g-2.fw

firmware:       rtl_nic/rtl8106e-2.fw

firmware:       rtl_nic/rtl8106e-1.fw

firmware:       rtl_nic/rtl8411-2.fw

firmware:       rtl_nic/rtl8411-1.fw

firmware:       rtl_nic/rtl8402-1.fw

firmware:       rtl_nic/rtl8168f-2.fw

firmware:       rtl_nic/rtl8168f-1.fw

firmware:       rtl_nic/rtl8105e-1.fw

firmware:       rtl_nic/rtl8168e-3.fw

firmware:       rtl_nic/rtl8168e-2.fw

firmware:       rtl_nic/rtl8168e-1.fw

firmware:       rtl_nic/rtl8168d-2.fw

firmware:       rtl_nic/rtl8168d-1.fw

version:        2.3LK-NAPI

license:        GPL

description:    RealTek RTL-8169 Gigabit Ethernet driver

author:         Realtek and the Linux r8169 crew <netdev@vger.kernel.org>

srcversion:     18A7E77CB174A8A3B359D55

alias:          pci:v00000001d00008168sv*sd00002410bc*sc*i*

alias:          pci:v00001737d00001032sv*sd00000024bc*sc*i*

alias:          pci:v000016ECd00000116sv*sd*bc*sc*i*

alias:          pci:v00001259d0000C107sv*sd*bc*sc*i*

alias:          pci:v00001186d00004302sv*sd*bc*sc*i*

alias:          pci:v00001186d00004300sv*sd*bc*sc*i*

alias:          pci:v00001186d00004300sv00001186sd00004B10bc*sc*i*

alias:          pci:v000010ECd00008169sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008168sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008167sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008136sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008129sv*sd*bc*sc*i*

depends:        mii

intree:         Y

vermagic:       3.12.13-gentoo SMP mod_unload 486 

parm:           use_dac:Enable PCI DAC. Unsafe on 32 bit PCI slot. (int)

parm:           debug:Debug verbosity level (0=none, ..., 16=all) (int)
```

My .config is in http://pastebin.com/SxRG0nEh

lspci -v  gives me:

```
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 02)

        Subsystem: Micro-Star International Co., Ltd. [MSI] Wind PC MS-7418

        Flags: bus master, fast devsel, latency 0, IRQ 16

        I/O ports at e800 [size=256]

        Memory at febff000 (64-bit, non-prefetchable) [size=4K]

        Memory at fdff0000 (64-bit, prefetchable) [size=64K]

        Expansion ROM at febc0000 [disabled] [size=128K]

        Capabilities: [40] Power Management version 3

        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+

        Capabilities: [70] Express Endpoint, MSI 01

        Capabilities: [b0] MSI-X: Enable- Count=2 Masked-

        Capabilities: [d0] Vital Product Data

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [140] Virtual Channel

        Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00

        Kernel driver in use: r8169

        Kernel modules: r8169
```

----------

## khayyam

 *tpereira wrote:*   

> 
> 
> ```
>         Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
> 
> ...

 

tpereira ... the first thing I see is that you have CONFIG_PCI_MSI disabled, you should enable it ... its under Bus options (PCI etc) => Message Signaled Interrupts (MSI and MSI-X). Also I see a lot of network stuff enabled that you probably don't want or need, specifically CONFIG_IP_PNP stands out as it has some baring on the "automatic configuration of IP addresses", its only used for diskless clients and as it may have some relation to the delay you're seeing I'd disable it. There are various other stuff I don't know why you enabled (or if these were enabled by genkernel) but its probably too much a task to go through each item one by one, so I'll leave it at that ... though I'd probably go through and ask yourself why each was enabled, if its needed, etc.

best ... khay

----------

## tpereira

khayyam:

I enabled

```
CONFIG_PCI_MSI=y
```

and disabled

```
# CONFIG_IP_PNP is not set
```

but result is the same. Still around 30 seconds until if card works.

I also disabled some other stuff in Network options...

best

----------

## khayyam

 *tpereira wrote:*   

> but result is the same. Still around 30 seconds until if card works. I also disabled some other stuff in Network options...

 

tpereira ... yeah, I expected as much, those two were just the most obvious I could see. I can suggest two things, 1). boot a livecd (like the minimal install CD) and see if the behavior is the same, and 2). rebuild the kernel using a kernel-seed, or after having distclean'd the sources. I'm not sure how you currently build the kernel but its possible you have some issue by using 'make oldconfig' with a .config from a previous major kernel revision, or you used/use genkernel which tends to be a kitchen-sink solution (and so way too much is enabled). Having a somewhat paired down .config (with just those things needed enabled) will help to eliminate possible issues, and make debugging the issue easier.

best ... khay

----------

## tpereira

Hi

I booted from a recent gentoo install cd (2014 something). The same problem still. Around 30 seconds, after ifconfig up, until I can ping any machine.

```
> modinfo r8169

filename:       /lib/modules/3.10.25-gentoo/kernel/drivers/net/ethernet/realtek/r8169.ko

firmware:       rtl_nic/rtl8168g-3.fw

firmware:       rtl_nic/rtl8168g-2.fw

firmware:       rtl_nic/rtl8106e-2.fw

firmware:       rtl_nic/rtl8106e-1.fw

firmware:       rtl_nic/rtl8411-1.fw

firmware:       rtl_nic/rtl8402-1.fw

firmware:       rtl_nic/rtl8168f-2.fw

firmware:       rtl_nic/rtl8168f-1.fw

firmware:       rtl_nic/rtl8105e-1.fw

firmware:       rtl_nic/rtl8168e-3.fw

firmware:       rtl_nic/rtl8168e-2.fw

firmware:       rtl_nic/rtl8168e-1.fw

firmware:       rtl_nic/rtl8168d-2.fw

firmware:       rtl_nic/rtl8168d-1.fw

version:        2.3LK-NAPI

license:        GPL

description:    RealTek RTL-8169 Gigabit Ethernet driver

author:         Realtek and the Linux r8169 crew <netdev@vger.kernel.org>

srcversion:     BE315FA128766ABBDE9857B

alias:          pci:v00000001d00008168sv*sd00002410bc*sc*i*

alias:          pci:v00001737d00001032sv*sd00000024bc*sc*i*

alias:          pci:v000016ECd00000116sv*sd*bc*sc*i*

alias:          pci:v00001259d0000C107sv*sd*bc*sc*i*

alias:          pci:v00001186d00004302sv*sd*bc*sc*i*

alias:          pci:v00001186d00004300sv*sd*bc*sc*i*

alias:          pci:v00001186d00004300sv00001186sd00004B10bc*sc*i*

alias:          pci:v000010ECd00008169sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008168sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008167sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008136sv*sd*bc*sc*i*

alias:          pci:v000010ECd00008129sv*sd*bc*sc*i*

depends:        

intree:         Y

vermagic:       3.10.25-gentoo SMP mod_unload modversions 486 

parm:           use_dac:Enable PCI DAC. Unsafe on 32 bit PCI slot. (int)

parm:           debug:Debug verbosity level (0=none, ..., 16=all) (int)
```

```
> lsmod | grep 8169

r8169                  39714  0
```

The kernel is 3.10.25-gentoo

Kernel-seed.. I'll look into that.

I don't remember how I configured my kernel, but probably with make oldconfig.

----------

## khayyam

 *tpereira wrote:*   

> I booted from a recent gentoo install cd (2014 something). The same problem still. Around 30 seconds, after ifconfig up, until I can ping any machine.

 

tpereira ... if you have any other (older) boot CD's (doesn't matter the disribution) try testing with these also. If these also exhibit the same behavior then this points to a hardware issue. At this stage I would swap out the ethernet cable to rule that out, and (if its pci) check the pci slot (though as I remember its pcie, so it may be soldierd on the board).

 *tpereira wrote:*   

> Kernel-seed.. I'll look into that. I don't remember how I configured my kernel, but probably with make oldconfig.

 

Given that the issue can be reproduced with an older kernel using a different .config I'm leaning toward thinking its hardware rather than the kernel.

best ... khay

----------

## UberLord

 *tpereira wrote:*   

> Also discover that after configuring the net if card, it takes around 30 seconds to be able to reach any other machine:
> 
> ```
> gentooTEST tpereira # ifconfig enp1s0 down
> 
> ...

 

At a guess, you missed a subnet declaration. I don't know yours, so guessed at 255.255.0.0

```
# ifconfig enp1s0 up; ifconfig enp1s0 10.136.224.244 netmask 255.255.0.0; route add -net 0.0.0.0 gw 10.136.254.254; ping 10.136.254.254
```

----------

## tpereira

khayyam: I tried the booting another pc, with another net if card, in another room of my workplace, with another gentoo kernel.

The situation is the same. I'm starting to believe very seriously that this is a time window imposed by the router or switch.

UberLord: also declared a subnet. Doesn't seem to make any difference at all.

Below is the info.

lspci -vv

```
00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)

        Subsystem: ASUSTeK Computer Inc. Motherboard P4S800D-X

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

        Latency: 32 (13000ns min, 2750ns max)

        Interrupt: pin A routed to IRQ 19

        Region 0: I/O ports at 8800 [size=256]

        Region 1: Memory at e5800000 (32-bit, non-prefetchable) [size=4K]

        Expansion ROM at effe0000 [disabled] [size=128K]

        Capabilities: [40] Power Management version 2

                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

        Kernel driver in use: sis900

        Kernel modules: sis900
```

uname -a

```
Linux livecd 2.6.30-gentoo-r5 #1 SMP Tue Sep 1 10:41:11 UTC 2009 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
```

modinfo sis900

```
filename:       /lib/modules/2.6.30-gentoo-r5/kernel/drivers/net/sis900.ko

license:        GPL

description:    SiS 900 PCI Fast Ethernet driver

author:         Jim Huang <cmhuang@sis.com.tw>, Ollie Lho <ollie@sis.com.tw>

alias:          pci:v00001039d00007016sv*sd*bc*sc*i*

alias:          pci:v00001039d00000900sv*sd*bc*sc*i*

depends:

vermagic:       2.6.30-gentoo-r5 SMP mod_unload modversions 486

parm:           multicast_filter_limit:SiS 900/7016 maximum number of filtered multicast addresses (int)

parm:           max_interrupt_work:SiS 900/7016 maximum events handled per interrupt (int)

parm:           sis900_debug:SiS 900/7016 bitmapped debugging message level (int)
```

Net if card setup and ping

```
> ifconfig eth0 up; ifconfig eth0 10.136.224.244 netmask 255.255.0.0; route add -net 0.0.0.0 gw 10.136.254.254

PING 10.136.254.254 (10.136.254.254) 56(84) bytes of data.

From 10.136.224.244 icmp_seq=1 Destination Host Unreachable

From 10.136.224.244 icmp_seq=2 Destination Host Unreachable

From 10.136.224.244 icmp_seq=3 Destination Host Unreachable

From 10.136.224.244 icmp_seq=5 Destination Host Unreachable

From 10.136.224.244 icmp_seq=6 Destination Host Unreachable

From 10.136.224.244 icmp_seq=9 Destination Host Unreachable

From 10.136.224.244 icmp_seq=10 Destination Host Unreachable

From 10.136.224.244 icmp_seq=11 Destination Host Unreachable

From 10.136.224.244 icmp_seq=12 Destination Host Unreachable

From 10.136.224.244 icmp_seq=13 Destination Host Unreachable

From 10.136.224.244 icmp_seq=14 Destination Host Unreachable

From 10.136.224.244 icmp_seq=15 Destination Host Unreachable

From 10.136.224.244 icmp_seq=16 Destination Host Unreachable

From 10.136.224.244 icmp_seq=17 Destination Host Unreachable

From 10.136.224.244 icmp_seq=18 Destination Host Unreachable

From 10.136.224.244 icmp_seq=19 Destination Host Unreachable

From 10.136.224.244 icmp_seq=20 Destination Host Unreachable

From 10.136.224.244 icmp_seq=21 Destination Host Unreachable

From 10.136.224.244 icmp_seq=22 Destination Host Unreachable

From 10.136.224.244 icmp_seq=23 Destination Host Unreachable

From 10.136.224.244 icmp_seq=24 Destination Host Unreachable

From 10.136.224.244 icmp_seq=25 Destination Host Unreachable

From 10.136.224.244 icmp_seq=26 Destination Host Unreachable

From 10.136.224.244 icmp_seq=27 Destination Host Unreachable

From 10.136.224.244 icmp_seq=28 Destination Host Unreachable

From 10.136.224.244 icmp_seq=29 Destination Host Unreachable

From 10.136.224.244 icmp_seq=30 Destination Host Unreachable

64 bytes from 10.136.254.254: icmp_seq=31 ttl=64 time=2001 ms

64 bytes from 10.136.254.254: icmp_seq=32 ttl=64 time=990 ms

64 bytes from 10.136.254.254: icmp_seq=33 ttl=64 time=0.088 ms

64 bytes from 10.136.254.254: icmp_seq=34 ttl=64 time=0.099 ms

64 bytes from 10.136.254.254: icmp_seq=35 ttl=64 time=0.108 ms

64 bytes from 10.136.254.254: icmp_seq=36 ttl=64 time=0.119 ms

64 bytes from 10.136.254.254: icmp_seq=37 ttl=64 time=0.126 ms

64 bytes from 10.136.254.254: icmp_seq=38 ttl=64 time=0.135 ms

64 bytes from 10.136.254.254: icmp_seq=39 ttl=64 time=0.096 ms

--- 10.136.254.254 ping statistics ---

39 packets transmitted, 9 received, +27 errors, 76% packet loss, time 38111ms

rtt min/avg/max/mdev = 0.088/332.557/2001.811/666.071 ms, pipe 3
```

At the risk of sounding a prick: maybe, if this situation is frequent, roy marples should increase the default timeout on dhcpcd.conf It's in if-options.h and pretty simple to avoid this problem.

Sheers

tpereira

----------

## khayyam

 *tpereira wrote:*   

> khayyam: I tried the booting another pc, with another net if card, in another room of my workplace, with another gentoo kernel. The situation is the same. I'm starting to believe very seriously that this is a time window imposed by the router or switch.

 

tpereira ... the topology of your network seems odd/broken, you have a dhcp server outside the subnet with the gateway within the network probably acting as a dhcp-repeater, some communication between the client, the repeater, and the dhcp server seems to break down as the lease you're provided for 20 hours is seen as invalid shortly thereafter. That could be the result of no traffic being routed for this "30 seconds" window, but if this is imposed by some mechanism on the router then its broken, because such a delay does nothing but interfere with the normal operation of dhcp. I've seen network setups that disable a port if the card goes into promiscuous mode, or if a switch is connected to the port, but I haven't seen anything like the above, and I can't think why there is a need for it (or what exactly its intended to prevent). Also, its extremely odd that the issue hits you on a restart, but not on start, when the 30 second delay is obviously encountered for both.   

 *tpereira wrote:*   

> At the risk of sounding a prick: maybe, if this situation is frequent, roy marples should increase the default timeout on dhcpcd.conf It's in if-options.h and pretty simple to avoid this problem.

 

The current 30 second timeout seems a perfectly reasonable default, I don't think it takes any more than a second or two for a negotiation to happen here, in fact I lower the timeout to '-t 10' and have yet to have any issues on any of the networks I access (including networks I *know* have some crappy wireless setups). I think yours is an exception, not the rule.

best ... khay

----------

## UberLord

 *tpereira wrote:*   

> UberLord: also declared a subnet. Doesn't seem to make any difference at all.
> 
> ...
> 
> At the risk of sounding a prick: maybe, if this situation is frequent, roy marples should increase the default timeout on dhcpcd.conf It's in if-options.h and pretty simple to avoid this problem.
> ...

 

I am the same person  :Smile: 

You can set the default timeout in dhcpcd.conf yourself 

```
timeout 60
```

It's not a frequent situation at all.

Out of curiosity, can you try just adding dhcpcd to the default runlevel and removing net.* (aside from net.lo)?

You could also try other DHCP clients. If you find that another one works then it's probably one of the DHCP options causing the issue.

Let me know!

----------

## tpereira

Uberlord, sorry for delay in reply. It has only been 9 months

For the time being, I have added background to my dhcpcd.conf and it seems to "solve the problem"

As you requested, I have removed all net.* except net.lo from all runlevels and added dhcpcd to default runlevel.

My dhcpcd.conf is:

```

hostname

duid

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name

option classless_static_routes

option ntp_servers

require dhcp_server_identifier

slaac private

nohook lookup-hostname

timeout 30

```

This is /var/log/messages while I stop and start dhcpcd service:

```

>/etc/runlevels/default/dhcpcd stop

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: received signal TERM from PID 2707, stopping

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: enp1s0: removing interface

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: enp1s0: deleting route to 10.136.0.0/16

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: enp1s0: deleting default route via 10.136.254.254

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: enp1s0: deleting IP address 10.136.250.248/16

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' STOP

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' STOPPED

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: dev: unloaded udev

Feb 16 15:47:25 gentooTEST dhcpcd[2359]: exited

>/etc/runlevels/default/dhcpcd start

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: version 6.4.7 starting

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: udev: starting

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: dev: loaded udev

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: if_disable_autolinklocal: Invalid argument

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: adding address fe80::6c8:e318:6519:7368

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: if_addaddress6: Permission denied

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: DUID 00:01:00:01:1b:03:65:eb:00:21:85:98:70:65

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: IAID 85:98:70:65

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: delaying IPv6 router solictation for 0.2 seconds

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: delaying IPv4 for 0.5 seconds

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: soliciting an IPv6 router

Feb 16 15:48:36 gentooTEST dhcpcd[2739]: enp1s0: delaying Router Solicitation for LL address

Feb 16 15:48:37 gentooTEST dhcpcd[2739]: enp1s0: reading lease `/var/lib/dhcpcd/dhcpcd-enp1s0.lease'

Feb 16 15:48:37 gentooTEST dhcpcd[2739]: enp1s0: rebinding lease of 10.136.250.248

Feb 16 15:48:37 gentooTEST dhcpcd[2739]: enp1s0: sending REQUEST (xid 0x2a6d88c1), next in 3.3 seconds

Feb 16 15:48:37 gentooTEST dhcpcd[2739]: enp1s0: acknowledged 10.136.250.248 from xxx.xxx.xxx.xxx

Feb 16 15:48:37 gentooTEST dhcpcd[2739]: enp1s0: checking for 10.136.250.248

Feb 16 15:48:37 gentooTEST dhcpcd[2739]: enp1s0: sending ARP probe (1 of 3), next in 1.9 seconds

Feb 16 15:48:39 gentooTEST dhcpcd[2739]: enp1s0: sending ARP probe (2 of 3), next in 1.2 seconds

Feb 16 15:48:40 gentooTEST dhcpcd[2739]: enp1s0: sending ARP probe (3 of 3), next in 2.0 seconds

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: leased 10.136.250.248 for 72000 seconds

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: renew in 36000 seconds, rebind in 63000 seconds

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: adding IP address 10.136.250.248/16

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: adding route to 10.136.0.0/16

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: adding default route via 10.136.254.254

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: writing lease `/var/lib/dhcpcd/dhcpcd-enp1s0.lease'

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' REBOOT

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: forking to background

Feb 16 15:48:42 gentooTEST dhcpcd[2739]: forked to background, child pid 2781

Feb 16 15:48:42 gentooTEST dhcpcd[2781]: enp1s0: sending ARP announce (1 of 2), next in 2.0 seconds

Feb 16 15:48:44 gentooTEST dhcpcd[2781]: enp1s0: sending ARP announce (2 of 2)

```

I have restarted dhcpcd service several times and results are the same as the log above.

Net is reachable within 4 or 5 seconds.

I do not wish to use another dhcp client. I get the idea this one is the simplest one.

Cheers

----------

## UberLord

Well, that looks good.

If you want it to go faster, disable ARP checking if you're sure there will never be an IP conflict.

----------

## Fog_Watch

 *UberLord wrote:*   

> try just adding dhcpcd to the default runlevel and removing net.* (aside from net.lo)?

 

My experience is that this is correct.  Does that mean that the handbook wrong?

----------

## charles17

 *Fog_Watch wrote:*   

> My experience is that this is correct.  Does that mean that the handbook wrong?

 

Not wrong, but recommending for default a high sophisticated tool which is needed only for very advanced requirements. See bug 534752

----------

