2

My university started using 802.1X wired authentication recently and my internet connection stops working after dhcp lease timeout on raspberry pi.

I'm using preinstalled dhcpcd and wpa_supplicant to connect to network. After boot the internet works fine, I get IP from dhcp and everything is OK, but after dhcp lease time runs out the internet simply don't work anymore. Only way to get internet working again is to disable and enable interface again (ifdown eth0 and ifup eth0).

I've tried raspbian jessie and also stretch, nothing changed, also I've tried building dhcpcd myself and also I've tried to use dhclient instead of dhcpcd.

Thanks for help.

EDIT

dhclient is not running, but dhcpcd is.

The lease expires mostly after 1 hour.

Also if I connect Pi to my home network, then the connection never drops, so it's probably some problem with re-authentication of something like that.

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
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

denyinterfaces wlan0

wpa_supplicant.conf

country=CZ
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
ap_scan=0

network={
    identity="identity@domain"
    password="password"
    eap=PEAP
    phase2="auth=MSCHAPV2"
    #auth_alg=OPEN
    #proto=WPA RSN
    #pairwise=CCMP
    key_mgmt=WPA-EAP IEEE8021X
    ca_cert="path/to/cert.pem"
}

journalctl | grep dhcpcd

Apr 02 23:12:30 raspberrypi dhcpcd[398]: eth0: waiting for carrier
Apr 02 23:12:31 raspberrypi dhcpcd[398]: eth0: carrier acquired
Apr 02 23:12:31 raspberrypi dhcpcd[398]: eth0: adding address fe80::666d:9cb2:9035:c937
Apr 02 23:12:31 raspberrypi dhcpcd[398]: DUID 00:01:00:01:20:4c:53:e2:b8:27:eb:53:ae:55
Apr 02 23:12:31 raspberrypi dhcpcd[398]: eth0: IAID eb:53:ae:55
Apr 02 23:12:32 raspberrypi dhcpcd[398]: eth0: rebinding lease of 158.196.42.184
Apr 02 23:12:32 raspberrypi dhcpcd[398]: eth0: probing address 158.196.42.184/24
Apr 02 23:12:32 raspberrypi dhcpcd[398]: eth0: soliciting an IPv6 router
Apr 02 23:12:33 raspberrypi dhcpcd[398]: eth0: Router Advertisement from fe80::215:c7ff:fe27:e100
Apr 02 23:12:33 raspberrypi dhcpcd[398]: eth0: adding address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 02 23:12:33 raspberrypi dhcpcd[398]: eth0: adding route to 2001:718:1001:693::/64
Apr 02 23:12:33 raspberrypi dhcpcd[398]: eth0: adding default route via fe80::215:c7ff:fe27:e100
Apr 02 23:12:37 raspberrypi dhcpcd[398]: eth0: leased 158.196.42.184 for 3600 seconds
Apr 02 23:12:37 raspberrypi dhcpcd[398]: eth0: adding route to 158.196.42.0/24
Apr 02 23:12:37 raspberrypi dhcpcd[398]: eth0: adding default route via 158.196.42.1
Apr 02 23:12:37 raspberrypi dhcpcd[398]: Too few arguments.
Apr 02 23:12:37 raspberrypi dhcpcd[398]: Too few arguments.
Apr 02 23:12:37 raspberrypi dhcpcd[398]: Failed to get unit file state for ntpd.service: No such file or directory
Apr 02 23:12:37 raspberrypi dhcpcd[398]: forked to background, child pid 838
Apr 03 00:15:47 raspberrypi dhcpcd[838]: eth0: fe80::215:c7ff:fe27:e100 is unreachable, expiring it
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: carrier lost
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: deleting address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: deleting default route via fe80::215:c7ff:fe27:e100
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: deleting route to 2001:718:1001:693::/64
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: deleting address fe80::666d:9cb2:9035:c937
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: deleting route to 158.196.42.0/24
Apr 03 00:29:29 raspberrypi dhcpcd[838]: eth0: deleting default route via 158.196.42.1
Apr 03 00:29:30 raspberrypi dhcpcd[838]: eth0: carrier acquired
Apr 03 00:29:30 raspberrypi dhcpcd[838]: eth0: adding address fe80::ea91:85c:bd9b:85ce
Apr 03 00:29:30 raspberrypi dhcpcd[838]: eth0: IAID eb:53:ae:55
Apr 03 00:29:30 raspberrypi dhcpcd[838]: eth0: rebinding lease of 158.196.42.184
Apr 03 00:29:30 raspberrypi dhcpcd[838]: eth0: soliciting an IPv6 router
Apr 03 00:29:32 raspberrypi dhcpcd[838]: eth0: Router Advertisement from fe80::215:c7ff:fe27:e100
Apr 03 00:29:32 raspberrypi dhcpcd[838]: eth0: adding address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 00:29:32 raspberrypi dhcpcd[838]: eth0: adding route to 2001:718:1001:693::/64
Apr 03 00:29:32 raspberrypi dhcpcd[838]: eth0: adding default route via fe80::215:c7ff:fe27:e100
Apr 03 00:29:35 raspberrypi dhcpcd[838]: eth0: probing address 158.196.42.184/24
Apr 03 00:29:40 raspberrypi dhcpcd[838]: eth0: leased 158.196.42.184 for 3600 seconds
Apr 03 00:29:40 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 00:29:40 raspberrypi dhcpcd[838]: eth0: adding default route via 158.196.42.1
Apr 03 00:29:40 raspberrypi dhcpcd[838]: eth0: removing route to 158.196.42.0/24
Apr 03 00:59:40 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 01:31:40 raspberrypi dhcpcd[838]: eth0: fe80::215:c7ff:fe27:e100 is unreachable, expiring it
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: carrier lost
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: deleting address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: deleting default route via fe80::215:c7ff:fe27:e100
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: deleting route to 2001:718:1001:693::/64
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: deleting address fe80::ea91:85c:bd9b:85ce
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: deleting route to 158.196.42.0/24
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: deleting default route via 158.196.42.1
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: carrier acquired
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: adding address fe80::ea91:85c:bd9b:85ce
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: IAID eb:53:ae:55
Apr 03 01:32:42 raspberrypi dhcpcd[838]: eth0: soliciting an IPv6 router
Apr 03 01:32:43 raspberrypi dhcpcd[838]: eth0: rebinding lease of 158.196.42.184
Apr 03 01:32:48 raspberrypi dhcpcd[838]: eth0: probing for an IPv4LL address
Apr 03 01:32:48 raspberrypi dhcpcd[838]: eth0: DHCP lease expired
Apr 03 01:32:48 raspberrypi dhcpcd[838]: eth0: soliciting a DHCP lease
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: Router Advertisement from fe80::215:c7ff:fe27:e100
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: adding address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: adding route to 2001:718:1001:693::/64
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: adding default route via fe80::215:c7ff:fe27:e100
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: using IPv4LL address 169.254.174.198
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: adding route to 169.254.0.0/16
Apr 03 01:32:52 raspberrypi dhcpcd[838]: eth0: adding default route
Apr 03 01:32:53 raspberrypi dhcpcd[838]: eth0: removing route to 169.254.0.0/16
Apr 03 01:32:54 raspberrypi dhcpcd[838]: eth0: offered 158.196.42.184 from 158.196.149.9
Apr 03 01:32:54 raspberrypi dhcpcd[838]: eth0: ignoring offer of 158.196.42.184 from 158.196.162.8
Apr 03 01:32:54 raspberrypi dhcpcd[838]: eth0: probing address 158.196.42.184/24
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: leased 158.196.42.184 for 3600 seconds
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: adding route to 169.254.0.0/16
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: changing default route via 158.196.42.1
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: deleting route to 169.254.0.0/16
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: removing route to 158.196.42.0/24
Apr 03 01:32:59 raspberrypi dhcpcd[838]: eth0: removing default route via 158.196.42.1
Apr 03 01:33:00 raspberrypi dhcpcd[838]: eth0: carrier lost
Apr 03 01:33:00 raspberrypi dhcpcd[838]: eth0: deleting address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 01:33:00 raspberrypi dhcpcd[838]: eth0: deleting default route via fe80::215:c7ff:fe27:e100
Apr 03 01:33:00 raspberrypi dhcpcd[838]: eth0: deleting route to 2001:718:1001:693::/64
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: deleting address fe80::ea91:85c:bd9b:85ce
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: carrier acquired
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: adding address fe80::ea91:85c:bd9b:85ce
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: IAID eb:53:ae:55
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: carrier lost
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: deleting address fe80::ea91:85c:bd9b:85ce
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: carrier acquired
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: adding address fe80::ea91:85c:bd9b:85ce
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: IAID eb:53:ae:55
Apr 03 01:33:01 raspberrypi dhcpcd[838]: eth0: rebinding lease of 158.196.42.184
Apr 03 01:33:02 raspberrypi dhcpcd[838]: eth0: soliciting an IPv6 router
Apr 03 01:33:06 raspberrypi dhcpcd[838]: eth0: probing address 158.196.42.184/24
Apr 03 01:33:06 raspberrypi dhcpcd[838]: eth0: Router Advertisement from fe80::215:c7ff:fe27:e100
Apr 03 01:33:06 raspberrypi dhcpcd[838]: eth0: adding address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 01:33:06 raspberrypi dhcpcd[838]: eth0: adding route to 2001:718:1001:693::/64
Apr 03 01:33:06 raspberrypi dhcpcd[838]: eth0: adding default route via fe80::215:c7ff:fe27:e100
Apr 03 01:33:11 raspberrypi dhcpcd[838]: eth0: leased 158.196.42.184 for 3600 seconds
Apr 03 01:33:11 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 01:33:11 raspberrypi dhcpcd[838]: eth0: adding default route via 158.196.42.1
Apr 03 01:33:11 raspberrypi dhcpcd[838]: eth0: removing route to 158.196.42.0/24
Apr 03 02:03:11 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 02:40:00 raspberrypi dhcpcd[838]: eth0: fe80::215:c7ff:fe27:e100 is unreachable, expiring it
Apr 03 03:25:41 raspberrypi dhcpcd[838]: eth0: failed to renew DHCP, rebinding
Apr 03 03:33:11 raspberrypi dhcpcd[838]: eth0: DHCP lease expired
Apr 03 03:33:11 raspberrypi dhcpcd[838]: eth0: deleting route to 158.196.42.0/24
Apr 03 03:33:11 raspberrypi dhcpcd[838]: eth0: deleting default route via 158.196.42.1
Apr 03 03:33:11 raspberrypi dhcpcd[838]: eth0: soliciting a DHCP lease
Apr 03 03:33:12 raspberrypi dhcpcd[838]: eth0: offered 10.5.26.243 from 10.0.0.1
Apr 03 03:33:12 raspberrypi dhcpcd[838]: eth0: probing address 10.5.26.243/24
Apr 03 03:33:17 raspberrypi dhcpcd[838]: eth0: leased 10.5.26.243 for 3600 seconds
Apr 03 03:33:17 raspberrypi dhcpcd[838]: eth0: adding route to 10.5.26.0/24
Apr 03 03:33:17 raspberrypi dhcpcd[838]: eth0: adding default route via 10.5.26.1
Apr 03 03:33:17 raspberrypi dhcpcd[838]: eth0: removing route to 10.5.26.0/24
Apr 03 04:03:17 raspberrypi dhcpcd[838]: eth0: adding route to 10.5.26.0/24
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: carrier lost
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: deleting address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: deleting default route via fe80::215:c7ff:fe27:e100
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: deleting route to 2001:718:1001:693::/64
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: deleting address fe80::ea91:85c:bd9b:85ce
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: deleting route to 10.5.26.0/24
Apr 03 11:36:30 raspberrypi dhcpcd[838]: eth0: deleting default route via 10.5.26.1
Apr 03 11:36:31 raspberrypi dhcpcd[838]: eth0: carrier acquired
Apr 03 11:36:31 raspberrypi dhcpcd[838]: eth0: adding address fe80::ea91:85c:bd9b:85ce
Apr 03 11:36:31 raspberrypi dhcpcd[838]: eth0: IAID eb:53:ae:55
Apr 03 11:36:31 raspberrypi dhcpcd[838]: eth0: soliciting an IPv6 router
Apr 03 11:36:31 raspberrypi dhcpcd[838]: eth0: rebinding lease of 10.5.26.243
Apr 03 11:36:35 raspberrypi dhcpcd[838]: eth0: NAK: requested address not available from 158.196.162.8
Apr 03 11:36:35 raspberrypi dhcpcd[838]: eth0: message: requested address not available
Apr 03 11:36:35 raspberrypi dhcpcd[838]: eth0: soliciting a DHCP lease
Apr 03 11:36:36 raspberrypi dhcpcd[838]: eth0: offered 158.196.42.184 from 158.196.149.9
Apr 03 11:36:36 raspberrypi dhcpcd[838]: eth0: probing address 158.196.42.184/24
Apr 03 11:36:36 raspberrypi dhcpcd[838]: eth0: Router Advertisement from fe80::215:c7ff:fe27:e100
Apr 03 11:36:36 raspberrypi dhcpcd[838]: eth0: adding address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 11:36:36 raspberrypi dhcpcd[838]: eth0: adding route to 2001:718:1001:693::/64
Apr 03 11:36:36 raspberrypi dhcpcd[838]: eth0: adding default route via fe80::215:c7ff:fe27:e100
Apr 03 11:36:40 raspberrypi dhcpcd[838]: eth0: leased 158.196.42.184 for 3600 seconds
Apr 03 11:36:40 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 11:36:40 raspberrypi dhcpcd[838]: eth0: adding default route via 158.196.42.1
Apr 03 11:36:41 raspberrypi dhcpcd[838]: eth0: removing route to 158.196.42.0/24
Apr 03 12:06:40 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 12:38:20 raspberrypi dhcpcd[838]: eth0: fe80::215:c7ff:fe27:e100 is unreachable, expiring it
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: carrier lost
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: deleting address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: deleting default route via fe80::215:c7ff:fe27:e100
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: deleting route to 2001:718:1001:693::/64
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: deleting address fe80::ea91:85c:bd9b:85ce
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: deleting route to 158.196.42.0/24
Apr 03 12:58:26 raspberrypi dhcpcd[838]: eth0: deleting default route via 158.196.42.1
Apr 03 12:58:27 raspberrypi dhcpcd[838]: eth0: carrier acquired
Apr 03 12:58:27 raspberrypi dhcpcd[838]: eth0: adding address fe80::ea91:85c:bd9b:85ce
Apr 03 12:58:27 raspberrypi dhcpcd[838]: eth0: IAID eb:53:ae:55
Apr 03 12:58:27 raspberrypi dhcpcd[838]: eth0: soliciting an IPv6 router
Apr 03 12:58:27 raspberrypi dhcpcd[838]: eth0: rebinding lease of 158.196.42.184
Apr 03 12:58:30 raspberrypi dhcpcd[838]: eth0: probing address 158.196.42.184/24
Apr 03 12:58:31 raspberrypi dhcpcd[838]: eth0: Router Advertisement from fe80::215:c7ff:fe27:e100
Apr 03 12:58:31 raspberrypi dhcpcd[838]: eth0: adding address 2001:718:1001:693:aab9:5e4c:7412:6fb7/64
Apr 03 12:58:31 raspberrypi dhcpcd[838]: eth0: adding route to 2001:718:1001:693::/64
Apr 03 12:58:31 raspberrypi dhcpcd[838]: eth0: adding default route via fe80::215:c7ff:fe27:e100
Apr 03 12:58:35 raspberrypi dhcpcd[838]: eth0: leased 158.196.42.184 for 3600 seconds
Apr 03 12:58:35 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
Apr 03 12:58:35 raspberrypi dhcpcd[838]: eth0: adding default route via 158.196.42.1
Apr 03 12:58:36 raspberrypi dhcpcd[838]: eth0: removing route to 158.196.42.0/24
Apr 03 13:28:35 raspberrypi dhcpcd[838]: eth0: adding route to 158.196.42.0/24
  • 1
    Please update your answer with relevant to dhcpcd logs from your system (i.e. journalctl) – ddnomad Apr 2 '17 at 21:38
  • Also please update your answer with details what your configuration looks like. How is dhcp called? Is dhclient still running (ps) when the lease expires? – dirkt Apr 3 '17 at 6:11
  • Thank for replies, I've updated the question with info you requested. – cmoud94 Apr 3 '17 at 11:52
  • Not familiar with dhcpcd, but it adds and removes a lot of routes; sometimes it seems to remove a route after it has added it (can't make out details from the message alone), and in between it's using a link-local IP 169.254.*.*. If you loose internet, check that you have the correct default route (ip addr show dev eth0, ip route). And in case dhcpcd is acting up, maybe try dhclient (Package isc-dhcp-client in Debian, no idea about Raspbian) instead. Is something else running that could set/remove routes? – dirkt Apr 3 '17 at 13:23
  • @dirkt Thanks for reply. I will wait for internet to drop and try to check default route as you're suggesting. Also I can try dhclient (package name is same as in debian) which is installed by default. I don't know about anything that can set/remove routes, but I could be wrong. AFAIK by default on raspbian only dhcpcd is supposed to control network interfaces. – cmoud94 Apr 3 '17 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.