Page 1 of 1

DHCP problems

Posted: Thu Aug 20, 2020 1:53 pm
by vladstamate
Hey folks,

I am having trouble with DHCP (and Qemu), as in I am not getting any response back to my DHCP discover. What I have tried/verified:

- dumped the package I am sending and verified it with Wireshark that is a correct DHCP package
- tried both Virtio and RTL8139 (the 2 network cards I have drivers for in my OS)

Both cards say message sent correctly (I get an interrupt back) but I never get a response back. What I do is very simple:

- (from kernel, no sockets, all very simple) build a DHCP discover message (with multicast)
- wrap it in a UDP package
- wrap that in a IPV4 package
- wrap that in an Ethernet package
- then send it out into the ether.

....and...nothing back....total silence.

At a high level am I approaching this correctly? Do I need to send something else? I run qemu like this:

-netdev user,id=net0 -device virtio-net-pci,netdev=net0

Re: DHCP problems

Posted: Thu Aug 20, 2020 10:42 pm
by Octocontrabass
vladstamate wrote:- dumped the package I am sending and verified it with Wireshark that is a correct DHCP package
Did you capture traffic with the filter-dump object?

Re: DHCP problems

Posted: Thu Aug 20, 2020 11:45 pm
by iansjack
Can you post a dump of the outgoing packet. There must be something wrong with it if you get no response. Did you remember to translate the endianness where necessary? Is the checksum correct?

Re: DHCP problems

Posted: Fri Aug 21, 2020 7:39 am
by vladstamate
Octocontrabass wrote:
vladstamate wrote:- dumped the package I am sending and verified it with Wireshark that is a correct DHCP package
Did you capture traffic with the filter-dump object?
Hey thank you very much for that. I dumped the package, loaded it in Wireshark and guess what? QEMU is actually answering back with an Offer! So it must mean I have some issues in both my VIRTIO and RTL8139 drivers! Thank you again for pointing that out!