Giter Site home page Giter Site logo

Comments (9)

niccokunzmann avatar niccokunzmann commented on August 24, 2024

from python_dhcp_server.

dbrb2 avatar dbrb2 commented on August 24, 2024

Sorry for the confusion:

I have the python script running on a raspberryPi
I have a laptop connected to the wired interface of the pi

The laptop is making DHCP DISCOVER messages, which I can see using tshark on the pi
in response to these messages, the pi is sending a DHCP OFFER message to the broadcast IP, which I can see arriving at the laptop using wireshark

However, for some reason that incoming DHCP OFFER is never accepted by the laptop - no REQUEST message is sent from the laptop to the pi in response to the OFFER, and instead a new DISCOVERY is sent

I can't see any obvious problem with the offer message. The only thing that I noticed is that the OFFER is broadcast, rather than unicast. As far as I can see, either should work - though unicast offers (with the destination set to the mac of the client) seem to be a little more common.

from python_dhcp_server.

niccokunzmann avatar niccokunzmann commented on August 24, 2024

from python_dhcp_server.

dbrb2 avatar dbrb2 commented on August 24, 2024

from python_dhcp_server.

niccokunzmann avatar niccokunzmann commented on August 24, 2024

from python_dhcp_server.

SurajBhari avatar SurajBhari commented on August 24, 2024

I used multicast. It is probably not hard to use unicast.

hey, I tried to run this today with no experince in networking at all. and I had same issue as said by the OP.
but as of the time I am writing this. i can see that you have set the flag to unicast.
am I missing something ?

from python_dhcp_server.

niccokunzmann avatar niccokunzmann commented on August 24, 2024

oh, it is a while ago that I wrote this program, so if you can make it work by changing the flag, that is nice, PR welcome.

It seems to me that the MAC address should be set to send an offer. Would you like to modify the code and have a look if it solves your problem?

from python_dhcp_server.

SurajBhari avatar SurajBhari commented on August 24, 2024

hey, I have tried to set it to both ways multicast and unicast (by changing bootp_flags variable) and also setting up client_mac_address. but it was still the same.

Just to be sure we are on the same page. can you share your testbench?
I am using this on my laptop as server and a desktop running ubuntu 22 by a single LAN wire.

from python_dhcp_server.

Xenoamor avatar Xenoamor commented on August 24, 2024

I've encountered the same problem when trying to process a DHCP Discover from an embedded device running a udhcp client. It looks to be that this client does not handle broadcasted DHCP Offers and instead expects the ethernet frame address to be its MAC address

Basically my client insists on a unicast offer with the destination as it's MAC address. It will not listen to a broadcasted multicast offer

Unfortunately python does not natively support setting this low level field on Windows without using something like NpCap. Thus I don't believe this can be done in standard python alone

from python_dhcp_server.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.