Re: Addresses not deleted when cable pulled
jobhunts02
Mon Mar 05 20:38:36 2018
Here is the info you requested:
# uname -a
Linux 4550V2 3.10.87-rt80-Cavium-Octeon #152 SMP Mon Mar 5 12:02:58 PST 2018 mips64 unknown
# cat /var/log/dhcpcd.log
Mar 05 20:28:36 [6448]: dhcpcd-7.0.0 starting
Mar 05 20:28:36 [6448]: all: disabling kernel IPv6 RA support
Mar 05 20:28:36 [6448]: eth1: if_disable_autolinklocal: Operation not supported
Mar 05 20:28:36 [6448]: eth1: disabling kernel IPv6 RA support
Mar 05 20:28:36 [6448]: eth1: executing `/etc/conf/bin/dhcpcd-up' PREINIT
Mar 05 20:28:36 [6448]: eth1: executing `/etc/conf/bin/dhcpcd-up' CARRIER
Mar 05 20:28:36 [6448]: eth1: delaying IPv4 for 0.6 seconds
Mar 05 20:28:37 [6448]: eth1: using hwaddr 54:39:68:0d:4b:f3
Mar 05 20:28:37 [6448]: eth1: soliciting a DHCP lease
Mar 05 20:28:37 [6448]: eth1: sending DISCOVER (xid 0xa6b6edab), next in 4.3 seconds
Mar 05 20:28:38 [6448]: eth1: offered 192.168.2.150 from 192.168.2.1
Mar 05 20:28:38 [6448]: eth1: sending REQUEST (xid 0xa6b6edab), next in 3.4 seconds
Mar 05 20:28:38 [6448]: eth1: acknowledged 192.168.2.150 from 192.168.2.1
Mar 05 20:28:38 [6448]: eth1: probing address 192.168.2.150/24
Mar 05 20:28:38 [6448]: eth1: probing for 192.168.2.150
Mar 05 20:28:38 [6448]: eth1: ARP probing 192.168.2.150 (1 of 3), next in 1.1 seconds
Mar 05 20:28:39 [6448]: eth1: ARP probing 192.168.2.150 (2 of 3), next in 1.1 seconds
Mar 05 20:28:40 [6448]: eth1: ARP probing 192.168.2.150 (3 of 3), next in 2.0 seconds
Mar 05 20:28:42 [6448]: eth1: DAD completed for 192.168.2.150
Mar 05 20:28:42 [6448]: eth1: leased 192.168.2.150 for 604800 seconds
Mar 05 20:28:42 [6448]: eth1: renew in 302400 seconds, rebind in 529200 seconds
Mar 05 20:28:42 [6448]: eth1: writing lease `/var/db/dhcpcd/eth1.lease'
Mar 05 20:28:42 [6448]: eth1: adding IP address 192.168.2.150/24 broadcast 192.168.2.255
Mar 05 20:28:42 [6448]: eth1: adding route to 192.168.2.0/24
Mar 05 20:28:42 [6448]: eth1: adding default route via 192.168.2.1
Mar 05 20:28:42 [6448]: eth1: ARP announcing 192.168.2.150 (1 of 2), next in 2.0 seconds
Mar 05 20:28:42 [6448]: eth1: executing `/etc/conf/bin/dhcpcd-up' BOUND
Mar 05 20:29:08 [6448]: eth1: ARP announcing 192.168.2.150 (2 of 2)
Mar 05 20:29:08 [6448]: eth1: deleted IP address 192.168.2.150/24
Mar 05 20:29:08 [6448]: eth1: deleting route to 192.168.2.0/24
Mar 05 20:29:08 [6448]: eth1: deleting default route via 192.168.2.1
Mar 05 20:29:08 [6448]: eth1: executing `/etc/conf/bin/dhcpcd-up' EXPIRE
Mar 05 20:29:35 [6448]: eth1: carrier lost
Mar 05 20:29:35 [6448]: eth1: executing `/etc/conf/bin/dhcpcd-up' NOCARRIER
But 192.168.2.150 is not removed from eth1:
# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 54:39:68:0D:4B:F3
inet addr:192.168.2.150 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::5639:68ff:fe0d:4bf3/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
-----Original Message-----
From: Roy Marples <roy@xxxxxxxxxxxx>
To: jobhunts02 <jobhunts02@xxxxxxx>; dhcpcd-discuss <dhcpcd-discuss@xxxxxxxxxxxx>
Sent: Sat, Mar 3, 2018 1:42 am
Subject: Re: [dhcpcd-discuss] Addresses not deleted when cable pulled
On 03/03/18 09:30, Roy Marples wrote:
> On 03/03/2018 02:26, jobhunts02@xxxxxxx wrote:
>> When I pull the cable to the interface on which I got an IPv4 address
>> via DHCP, I would like the address to be deleted. The reason it is
>> not deleted is that state is NULL in ipv4ll_freedrop, which prevents
>> ipv4_deladdr from being called. If an interface has obtained an IPv4
>> & IPv6 address via DHCP, neither address is deleted when the cable is
>> pulled. If the interface only has an IPv6 address via DHCP, the
>> address does get deleted when the cable is pulled.
>>
>> Is there a way to ensure that addresses obtained via DHCP will be
>> deleted when the cable is pulled?
>
> Which OS are you using (please specify kernel version)?
> Which dhcpcd version are you using?
>
> I ask, because on NetBSD-8 and newer, the behaviour is to keep the
> addresses alive on carrier down as the kernel will deny their usage
> until they are revalidated by the kernel DaD's mechanism.
>
> Now, this could also be a bug in dhcpcd where this is not respected for
> other kernels and the behaviour should be as you describe - all
> addresses dhcpcd is responsible for should be removed at carrier down.
$ uname -a
Linux uberpc.marples.name 4.14.0-3-amd64 #1 SMP Debian 4.14.17-1
(2018-02-14) x86_64 GNU/Linux
Although it's reported as Debian, the OS is SparkyLinux
$ sudo ./dhcpcd -dB --nodhcp
dhcpcd-7.0.1 starting
eth0: executing `/libexec/dhcpcd-run-hooks' PREINIT
eth0: executing `/libexec/dhcpcd-run-hooks' NOCARRIER
wlan0: executing `/libexec/dhcpcd-run-hooks' PREINIT
wlan0: executing `/libexec/dhcpcd-run-hooks' CARRIER
DUID 00:01:00:01:21:66:22:a8:7c:5c:f8:59:7b:b2
wlan0: IAID f8:59:7b:b2
wlan0: adding address fe80::9497:7b15:fa4b:c108
wlan0: pltime infinity, vltime infinity
wlan0: delaying IPv6 router solicitation for 0.8 seconds
wlan0: delaying IPv4 for 0.5 seconds
eth0: waiting for carrier
wlan0: using IPv4LL address 169.254.189.240
wlan0: adding route to 169.254.0.0/16
wlan0: adding default route
wlan0: ARP announcing 169.254.189.240 (1 of 2), next in 2.0 seconds
wlan0: executing `/libexec/dhcpcd-run-hooks' IPV4LL
wlan0: soliciting an IPv6 router
wlan0: delaying Router Solicitation for LL address
wlan0: sending Router Solicitation
wlan0: Router Advertisement from fe80::1
wlan0: adding address fd73:7808:1015:0:a371:3c19:c535:9c8b/64
wlan0: pltime 120 seconds, vltime 180 seconds
wlan0: adding route to fd73:7808:1015::/64
wlan0: adding default route via fe80::1
wlan0: waiting for Router Advertisement DAD to complete
wlan0: reading lease `/var/db/dhcpcd/wlan0-UberNET.lease6'
wlan0: soliciting a DHCPv6 lease
wlan0: delaying SOLICIT6 (xid 0xce3e6f), next in 0.6 seconds
wlan0: ARP announcing 169.254.189.240 (2 of 2)
wlan0: broadcasting SOLICIT6 (xid 0xce3e6f), next in 0.9 seconds
wlan0: ADV fd73:7808:1015::1a3/128 from fe80::1
wlan0: broadcasting REQUEST6 (xid 0x4636d1), next in 1.1 seconds
wlan0: REPLY6 received from fe80::1
wlan0: adding address fd73:7808:1015::1a3/128
wlan0: pltime 75 seconds, vltime 120 seconds
wlan0: renew in 37, rebind in 60, expire in 120 seconds
wlan0: writing lease `/var/db/dhcpcd/wlan0-UberNET.lease6'
wlan0: waiting for DHCPv6 DAD to complete
wlan0: Router Advertisement DAD completed
wlan0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
wlan0: DHCPv6 DAD completed
wlan0: executing `/libexec/dhcpcd-run-hooks' BOUND6
wlan0: fe80::1 is unreachable, expiring it
wlan0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
wlan0: Router Advertisement from fe80::1
wlan0: adding address fd73:7808:1015:0:a371:3c19:c535:9c8b/64
wlan0: pltime 120 seconds, vltime 180 seconds
wlan0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
wlan0: carrier lost
wlan0: executing `/libexec/dhcpcd-run-hooks' NOCARRIER
wlan0: deleting address fd73:7808:1015::1a3/128
wlan0: executing `/libexec/dhcpcd-run-hooks' EXPIRE6
wlan0: deleting address fd73:7808:1015:0:a371:3c19:c535:9c8b/64
wlan0: deleting route to fd73:7808:1015::/64
wlan0: deleting default route via fe80::1
wlan0: executing `/libexec/dhcpcd-run-hooks' ROUTERADVERT
wlan0: deleting address fe80::9497:7b15:fa4b:c108
wlan0: deleting IP address 169.254.189.240/16
wlan0: deleting route to 169.254.0.0/16
wlan0: deleting default route
wlan0: executing `/libexec/dhcpcd-run-hooks' IPV4LL
wlan0: executing `/libexec/dhcpcd-run-hooks' EXPIRE
So I issued pkill wpa_supplicant to trigger the carrier down and as you
can see, every address dhcpcd was responsible for has been removed at
carrier down.
I need you to supply the same sort of log - add debug to dhcpcd.conf, to
show that dhcpcd assigned an address but did not remove it at carrier down.
Thanks
Roy
Archive administrator: postmaster@marples.name