sample code in readme.md could not run in my computer
I copy sample code in readme.md which function at DHCP client, my env is centos7 and python3.8.2, my code is: import dhcppython client = dhcppython.client.DHCPClient(interface="wlp3s0") lease = client.get_lease(mac_addr="fa:b3:9e:89:86:32", broadcast=True, relay=None, server="255.255.255.255", options_list=None)
why it comes :
Traceback (most recent call last):
File "dhcp_clients.py", line 8, in
Hello, you almost certainly have a DHCP client service already bound to port 68. You can check this by running something like sudo netstat -tulpn.
I suspect its probably systemd-networkd, in which case you can disable and stop it using sudo systemctl disable systemd-networkd && sudo systemctl stop systemd-networkd. I would advise re-enabling the service once you are done.