Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Strange behaviour of dhcpcd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Charlz_Klug
n00b
n00b


Joined: 16 Jul 2017
Posts: 12

PostPosted: Sat Sep 22, 2018 10:09 am    Post subject: Strange behaviour of dhcpcd Reply with quote

I'm trying to use dhcpcd on installed to hard disk Gentoo operating system, but get this:
Code:
Sep 22 12:26:35 Scarlett dhcpcd[4400]: enp2s0: carrier acquired
Sep 22 12:26:35 Scarlett dhcpcd[4400]: enp2s0: IAID 72:b3:24:1f
Sep 22 12:26:35 Scarlett dhcpcd[4400]: enp2s0: adding address fe80::d15b:18b6:bbd6:72de
Sep 22 12:26:35 Scarlett dhcpcd[4400]: enp2s0: soliciting a DHCP lease
Sep 22 12:26:36 Scarlett dhcpcd[4400]: enp2s0: soliciting an IPv6 router
Sep 22 12:26:40 Scarlett dhcpcd[4400]: enp2s0: probing for an IPv4LL address
Sep 22 12:26:45 Scarlett dhcpcd[4400]: enp2s0: using IPv4LL address 169.254.242.160
Sep 22 12:26:45 Scarlett dhcpcd[4400]: enp2s0: adding route to 169.254.0.0/16
Sep 22 12:26:45 Scarlett dhcpcd[4400]: enp2s0: adding default route
Sep 22 12:26:49 Scarlett dhcpcd[4400]: enp2s0: no IPv6 Routers available

Internet isn't working with 169.254.242.160 IP-address. Then I download and booted with SystemRescueCD and got
Code:
root@sysresccd /mnt/var/log % ifconfig enp2s0
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 217.171.157.198  netmask 255.255.252.0  broadcast 217.171.159.255
        inet6 fe80::7a88:6abb:bf6b:1663  prefixlen 64  scopeid 0x20<link>
        ether b8:2a:72:b3:24:1f  txqueuelen 1000  (Ethernet)
        RX packets 51259  bytes 16917500 (16.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10811  bytes 1703044 (1.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
With this IP-address internet is working. How can I fix that? Thank you for your answers.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5715

PostPosted: Sat Sep 22, 2018 10:21 am    Post subject: Reply with quote

Can we see /etc/conf.d/net and /etc/dhcpcd.conf ?
_________________
overlay | patches
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 304
Location: Finland

PostPosted: Sat Sep 22, 2018 11:20 am    Post subject: Reply with quote

Driver is propably ok because enp2s0 name, but maybe it lacks firmware and network is not working, "sys-kernel/linux-firmware" package missing?
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3485
Location: Dallas area

PostPosted: Sat Sep 22, 2018 11:43 am    Post subject: Reply with quote

Look at the difference between what works (your installation) and sysrescuecd, ie kernel config, modules, how dhcpd is configured, etc.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 7.3.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Charlz_Klug
n00b
n00b


Joined: 16 Jul 2017
Posts: 12

PostPosted: Sat Sep 22, 2018 2:48 pm    Post subject: Reply with quote

bunder wrote:
Can we see /etc/conf.d/net and /etc/dhcpcd.conf ?
Yes, of course:
Code:
root@sysresccd /mnt/etc/conf.d % cat net
config_enp2s0="dhcp"
config_wlp3s0="dhcp"
#dns_domain_lo="local"
Code:
root@sysresccd /mnt/etc % cat dhcpcd.conf                   
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
Back to top
View user's profile Send private message
Charlz_Klug
n00b
n00b


Joined: 16 Jul 2017
Posts: 12

PostPosted: Sat Sep 22, 2018 2:53 pm    Post subject: Reply with quote

P.Kosunen wrote:
Driver is propably ok because enp2s0 name, but maybe it lacks firmware and network is not working, "sys-kernel/linux-firmware" package missing?
For test I tried to get an IP-address from my TP-LINK router and I had got an address from router. I cannot just get address from provider's patch cord.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 12937

PostPosted: Sat Sep 22, 2018 3:54 pm    Post subject: Reply with quote

In the failing case, you are getting an IPv4 link-local address because the DHCP server does not respond within the time allotted. You do not say how long systemrescuecd requires to obtain an address. I would use this decision tree:
  • Is the DHCP server too slow to respond to the failed system, or does the DHCP server never respond at all?
    • If it is too slow, determine whether systemrescuecd is more patient or if systemrescuecd receives a faster response.
      • If systemrescuecd is more patient, try making the installed dhcp client more patient.
    • If the DHCP server never responds at all, determine why it ignores the failed system and responds to systemrescuecd.
One bit you quoted from the configuration file offers a possibility, though this might be irrelevant.
Charlz_Klug wrote:
Code:
root@sysresccd /mnt/etc % cat dhcpcd.conf                   
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
Check that systemrescuecd also uses DUID, or check whether the failed system works better when you disable DUID. Since the comment specifically says broken DHCP servers do not reply, and your problem is consistent with not receiving a response, this seems to me to be a good place to start.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5715

PostPosted: Sat Sep 22, 2018 7:00 pm    Post subject: Reply with quote

Is this a cable modem? Some modems hold a MAC table and are limited to a small handful of devices (somewhere in the range of 1-3). If you've used all your MACs you won't be able to get a new IP until you reboot the modem to flush the table.
_________________
overlay | patches
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1344
Location: Montréal

PostPosted: Sat Sep 22, 2018 7:42 pm    Post subject: Reply with quote

In principle if, on the same machine with the same Ethernet wired card, you get an IP address from SystemRescueCD and not from Gentoo, the problem is not the modem who deny you to connect because of non authorised MAC address. It have been already registrated by SystemRescueCD and/or Gentoo. You can even reset the modem if you want before booting Gentoo, it should not change the result.

I see that in /etc/conf.d/net you ask for a dhcp request on both enp2s0 and wlp3s0 interfaces. If your Internet connexion pass through enp2s0 you should not ask for a dhcp request on wlp3s0, unless you need a specific configuration for wlp3s0. I would try to get only enp2s0 well configure by Dhcpcd for test.

Anyway to get a dynamic IP address with Dhcpcd managing alone a wireless interface without Wpa_supplicant started by an other mean, you need to tell to Dhcpcd to start Wpa_supplicant what need to copy or link /usr/share/dhcpcd/hooks/10-wpa_supplicant to /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant. In plus you may need to configure /etc/dhcpcd.conf as well for the wireless interface.
_________________
Paul
Back to top
View user's profile Send private message
Charlz_Klug
n00b
n00b


Joined: 16 Jul 2017
Posts: 12

PostPosted: Sun Sep 23, 2018 11:32 am    Post subject: Reply with quote

Hu wrote:
Check that systemrescuecd also uses DUID, or check whether the failed system works better when you disable DUID. Since the comment specifically says broken DHCP servers do not reply, and your problem is consistent with not receiving a response, this seems to me to be a good place to start.
I disabled DUID and enabled CLIENTID. And got IP-address successfully. My dhcpcd.conf:
Code:
charlzk@Scarlett ~ $ cat /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
Problem solved. Thank you for advices!
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6721
Location: Blighty

PostPosted: Mon Sep 24, 2018 3:08 pm    Post subject: Reply with quote

Whilst the problem is solved, be sure to email the responsible party for the DHCPv6 server that their setup is not RFC compliant so they can fix it.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
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
Page 1 of 1

 
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