Code Monkey home page Code Monkey logo

Comments (7)

jpmikkers avatar jpmikkers commented on June 6, 2024 2

Here's the issue: dotnet/runtime#83525.
The workaround looks clunky, will try it tomorrow.

from dhcpserver.

jpmikkers avatar jpmikkers commented on June 6, 2024 2

Update: got it working on Ubuntu , so the trick is to bind to 0.0.0.0:67 but before that do a SO_BINDTODEVICE (bind to a specific nic) so it will only act as a DHCP server on that nic's subnet.

see https://github.com/jpmikkers/DHCPServer/blob/netcore/DHCPServer/Library/UDPSocketLinux.cs

Meanwhile, in that branch I've refactored the code a lot to use async/await, still needs some work in the main app though.

from dhcpserver.

n-ice-ch avatar n-ice-ch commented on June 6, 2024 1

Hi,

This could be a source for information:
https://stackoverflow.com/questions/74940771/not-receiving-broadcast-udp-messages-when-binding-to-specific-address

from dhcpserver.

jpmikkers avatar jpmikkers commented on June 6, 2024 1

@n-ice-ch I've created a test setup with ubuntu in virtualbox, indeed it seems broadcast packets are dropped somewhere. Disabling ufw doesn't help. I suspected my router, but the broadcasts arrive fine when I send them from ubuntu to windows. .To be continued..

from dhcpserver.

jpmikkers avatar jpmikkers commented on June 6, 2024

Binding to 0.0.0.0 is a bad idea for a DHCP server, it will start handing out IP leases on all your subnets.

From here https://stackoverflow.com/questions/13666789/receiving-udp-broadcast-packets-on-linux it seems I may have to bind another socket to the subnet broadcast address (e.g. 192.168.42.255) to receive broadcast packets on Linux.

from dhcpserver.

n-ice-ch avatar n-ice-ch commented on June 6, 2024

Sounds promising.

I've worked with IPAddress.Any for meanwhile. In my case it does not matter which subnet to serve as I use it as simple PXE.

But on Linux I can serve BIOS requests only. For EFI it does not work with IPAddress.Any.

So I'm very interested on your research.

from dhcpserver.

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.