It would be nice to have an option in /etc/conf.d/net that prevents the chosen DHCP client from requesting the previously assigned IP address upon startup. My /etc/conf.d/net is configured to use dhcpcd. Unfortunately, dhcpcd does not have a command-line option for this; the file /var/lib/dhcpc/dhcpcd-eth0.cache must be deleted before starting dhcpcd. I tried deleting the cache file using the following /etc/dhcpc/dhcpcd.exe script, but it does not appear to work (perhaps the DHCP server is remembering my MAC address?): #!/bin/bash if [[ "$2" == "down" ]] ; then CACHEFILE="$(echo "$1"|sed 's/\.info$/\.cache/')" if [[ -f "${CACHEFILE}" ]] ; then rm -rf "${CACHEFILE}" fi fi I have not yet investigated the other DHCP clients to see if they can be configured to not request the previously assigned IP address, but for privacy reasons I figured it would be good to put in a request to support all DHCP clients in a generic way via /etc/conf.d/net. Thanks!
1. The server may be configured to hand out a specific IP per MAC address 2. If you do not specifically DHCP_RELEASE your IP, and re-request it even without having the cache file, the server may give you the same one again. 2.1. The server may be configured to IGNORE DHCP_RELEASE messages. 3. The cache file only really has an effect where (your IP was released or expired from the server) AND (the IP in question is presently free) AND (the server honours specific requests). It's possible best to delete the cache file using a preup block. Test with the dhcpcd client manually with debugging on, and you can figure out which of the behaviors 1-3 are applicable to your DHCP server.
i dont see any change required in our net scripts ...
dhcpcd-3.0.0 doesn't use .cache files any more, which fixes this