Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dhcpcd doesn't work with service net.eth0 [solved]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
x0fis
n00b
n00b


Joined: 30 May 2013
Posts: 10

PostPosted: Mon Apr 28, 2014 5:14 pm    Post subject: Dhcpcd doesn't work with service net.eth0 [solved] Reply with quote

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"
Code:
/etc/init.d/net.eth0 start

Result

What can by wrong?
Thank you


Last edited by x0fis on Mon May 12, 2014 11:03 am; edited 1 time in total
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3095

PostPosted: Mon Apr 28, 2014 8:48 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Apr 28, 2014 9:07 pm    Post subject: Reply with quote

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').

Code:
rc_dhcpcd_provide="!net"

best ... khay
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Thu May 08, 2014 4:37 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu May 08, 2014 6:42 pm    Post subject: Reply with quote

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 ...

Code:
# rc-update del net.eth0 boot
# rc-update add net.eth0 default
# rc-update del dhcpcd default

/etc/conf.d/net
Code:
config_eth0="dhcp"
modules_eth0="dhcpcd"

/etc/rc.conf
Code:
rc_dhcpcd_provide="!net"

HTH & best ... khay
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Fri May 09, 2014 12:39 pm    Post subject: Reply with quote

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:

Code:
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:

Code:
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:
Code:
net-misc/dhcpcd-6.2.0-r1 was built with the following:
USE="ipv6 udev"


kernel is 3.10.25-gentoo
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri May 09, 2014 1:25 pm    Post subject: Reply with quote

tpereira ...

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

/etc/conf.d/net
Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Fri May 09, 2014 5:14 pm    Post subject: Reply with quote

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

But I have more info. After making /etc/conf.d/net
Code:
config_enp1s0="noop"


and starting enp.1s0
Code:
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:

Code:
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
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat May 10, 2014 10:12 am    Post subject: Reply with quote

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:
Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Sat May 10, 2014 12:38 pm    Post subject: Reply with quote

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:
Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Mon May 12, 2014 10:57 am    Post subject: Reply with quote

/etc/conf.d/net:
Code:
config_enp1s0="dhcp"
dhcp_enp1s0="release"
dhcpcd_enp1s0="-t 20 --noipv4ll"
enable_ipv6_enp1s0="false"


Code:
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:
Code:
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
Code:
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
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 12, 2014 12:11 pm    Post subject: Reply with quote

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
Code:
#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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Mon May 12, 2014 12:25 pm    Post subject: Reply with quote

khayyam, I get the same deal:

Code:
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


Code:
gentooTEST tpereira # cat /etc/conf.d/net
config_enp1s0="dhcp"
dhcp_enp1s0="release"
dhcpcd_enp1s0="-t 20 --noipv4ll"
enable_ipv6_enp1s0="false"


Code:
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:
Code:
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
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 12, 2014 7:54 pm    Post subject: Reply with quote

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
Code:
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
Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Mon May 12, 2014 8:47 pm    Post subject: Reply with quote

I rechecked:

Code:
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


Code:
gentooTEST tpereira # cat /etc/conf.d/net
modules_enp1s0="dhcpcd"
config_enp1s0="dhcp"
dhcpcd_enp1s0="--noipv4ll --ipv4only --waitip 4"
enable_ipv6_enp1s0="false"


Code:
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:
Code:
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
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 12, 2014 9:09 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Tue May 13, 2014 11:44 am    Post subject: Reply with quote

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:
Code:
gentooTEST ~ # /etc/init.d/net.enp1s0 start


Code:
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:
Code:
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:
Code:
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)



Code:
gentooTEST tpereira # cat /etc/conf.d/net
modules_enp1s0="dhcpcd"
config_enp1s0="dhcp"
dhcpcd_enp1s0="--noipv4ll --ipv4only"
enable_ipv6_enp1s0="false"


Code:
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?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed May 14, 2014 12:27 pm    Post subject: Reply with quote

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
Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Wed May 14, 2014 2:05 pm    Post subject: Reply with quote

All sets of options give basically the same result.

VERSION 1:

Code:
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


Code:
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
Code:
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
Code:
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


Code:
gentooTEST tpereira # cat /etc/conf.d/net
modules_enp1s0="dhcpcd"
config_enp1s0="dhcp"
dhcpcd_enp1s0="--noipv4ll --ipv4only"
enable_ipv6_enp1s0="false"


Code:
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
Code:
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.
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Wed May 14, 2014 2:18 pm    Post subject: Reply with quote

Sucessful:
Code:
[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:

Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Wed May 14, 2014 4:39 pm    Post subject: Reply with quote

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?

Code:
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
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed May 14, 2014 8:57 pm    Post subject: Reply with quote

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
Code:
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
Code:
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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Thu May 15, 2014 11:50 am    Post subject: Reply with quote

/etc/conf.d/net:
Code:
modules_enp1s0="dhcpcd"
config_enp1s0="dhcp"
dhcpcd_enp1s0="--noipv4ll --ipv4only"
enable_ipv6_enp1s0="false"
dhcp_enp1s0="release"


it fails like this:

/var/log/messages:
Code:
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:
Code:
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
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri May 16, 2014 1:19 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
tpereira
n00b
n00b


Joined: 21 Feb 2013
Posts: 23

PostPosted: Fri May 16, 2014 2:20 pm    Post subject: Reply with quote

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


Same deal:
Code:
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:
Code:
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


Code:
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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum