# Networkmanager & dhcpcd: no dhcpcd hooks?

## aceFruchtsaft

Hello,

I am trying to write a script which does something *after* an IP address is obtained and *before* it is released by dhcpcd.

I guess this could be accomplished using dhcpcd hooks in /lib/dhcpcd/dhcpcd-hooks, however it seems that when dhcpcd is run by NetworkManager, those hooks are not run at all. Can anyone confirm this, and why is this the case? I haven't been able to find anything via Google.

I've also considered placing the scripts into /etc/NetworkManager/dispatcher.d/ but NM seems to be very inflexible as those scripts are only run *after* the interface was brought up and down. Is there a way to have NM execute a script *before* an interface is shut down?

TIA

----------

## UberLord

The NetworkManager crew decided that all dhclient and dhcpcd scripts should never be called - you have to write NetworkManager foo.

----------

## Dagger

NM runs scripts from /etc/NetworkManager/dispatcher.d/ on all interface changes. It's up to you to tailor it to your needs. I don't think it currently provides functionality you're asking, but there was a thread on NM mailing list about something similar. You can always visit #nm and ask if there's a way around it.

----------

