You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
client = dhcppython.client.DHCPClient(interface="wlp3s0") # wlp3s0
File "/usr/local/Python3.8/lib/python3.8/site-packages/dhcppython/client.py", line 96, in init
self.writing_sockets = self.get_writing_sockets()
File "/usr/local/Python3.8/lib/python3.8/site-packages/dhcppython/client.py", line 329, in get_writing_sockets
client_sock = self.get_socket(host, port)
File "/usr/local/Python3.8/lib/python3.8/site-packages/dhcppython/client.py", line 320, in get_socket
sock.bind((host, port))
OSError: [Errno 98] Address already in use
The text was updated successfully, but these errors were encountered:
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.
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
client = dhcppython.client.DHCPClient(interface="wlp3s0") # wlp3s0
File "/usr/local/Python3.8/lib/python3.8/site-packages/dhcppython/client.py", line 96, in init
self.writing_sockets = self.get_writing_sockets()
File "/usr/local/Python3.8/lib/python3.8/site-packages/dhcppython/client.py", line 329, in get_writing_sockets
client_sock = self.get_socket(host, port)
File "/usr/local/Python3.8/lib/python3.8/site-packages/dhcppython/client.py", line 320, in get_socket
sock.bind((host, port))
OSError: [Errno 98] Address already in use
The text was updated successfully, but these errors were encountered: