How to release/renew DHCP
-
I'll give that other client a try later. However, the commands to release and rebind should just work, as they do in Linux and Windows. It shouldn't be necessary to touch any files. I don't understand why it doesn't seem to work properly with pfSense out of the box. If the other client is what it takes, why isn't it used?
On this site, there are occasionally problems with connecting to the Internet. I often tell people to capture the full DHCP sequence, but that apparently won't work with the current DHCP client.
-
That other client seems to have done the trick. One curious thing though is I didn't see a release as I do with Linux and Windows.
This begs the question of why that client is not used, if the default one is so old.
-
Hello!
There seems to be a relationship between the release option and dhclient running in daemon mode. Pfsense is running dhclient as a daemon and windows/linux might not be.
I dont know anything about the dhclient packages or how/why they are ordered in the path.
John
-
I just did some more testing. It seems that if I release with that other client, I have to use the default client to renew, for it to show on the interface status.
This looks like something the developers should look into, as it can produce confusing situations, in addition to not being able to do a proper release with the default dhclient.
-
Hello!
It looks like the /sbin/dhclient is used to run/control the daemon, while the /usr/local/sbin/dhclient is just used to send the courtesy "relinquish" message to the dhcp server.
There appears to be many things that happen in pfsense when you release/renew dhcp leases on the wan, probably more than on a workstation client. I dont know what effect going straight at the dhclient interface could have on the rest of the system. It might be better to use the higher level apis that are provided to do the release/renew, if possible. YMMV.
John
-
I wanted a simple way to release/renew it for testing. It's easy enough with Linux & Windows, but not pfSense. Why should there be 2 versions of dhclient, which provide different results?
Many years ago, I worked on the team that developed standard desktops (OS/2, NT & W95) for IBM Canada. Part of my work involved testing to make sure things worked properly and consistently. Such a thing wouldn't have been tolerated.
-
-
tl;dr to renew DHCP lease run
/sbin/dhclient -c /var/etc/dhclient_wan.conf $INTERFACE
How I find that command
- From the Admin Web UI, I clicked Release WAN
- From a shell terminal,
I "scraped" the command-line by first running as userroot
while true; do ps -A | grep dhclient; echo; done
- from the Admin Web UI, I clicked Renew WAN
- in the shell terminal, the particular renewal command was briefly listed
Command output
For me, I see
$ /sbin/dhclient -c /var/etc/dhclient_wan.conf em0 Cannot open or create pidfile: No such file or directory dhclient 68253 - - PREINIT DHCPREQUEST on em0 to 255.255.255.255 port 67 DHCPACK from 11.22.33.44 bound to 55.66.77.88 -- renewal in 91710 seconds.
(run as user
root
)Thanks @serbus for sharing your research!
-
@jknott I wonder if this has been “cleaned up” and simplified with 23.01 as that is a wastly never OS release and has required netgate to refactor a lot of the UI and services tooling.
-
@keyser said in How to release/renew DHCP:
I wonder if this has been “cleaned up” and simplified with 23.01
No idea.
-
Please help. How to automatically remove reserved MAC addresses from DHCP Static Mappings, for example, not active for 2 months?