-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide instructions and demo how to successfully run dhcp server on Linux Ubuntu #21
Comments
Hi, This could be a source for information: |
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. |
@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.. |
Here's the issue: dotnet/runtime#83525. |
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. |
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. |
Did you get any update for the issue on Linux? |
No description provided.
The text was updated successfully, but these errors were encountered: