DHCP problems

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
vladstamate
Posts: 2
Joined: Thu Aug 20, 2020 1:45 pm

DHCP problems

Post 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
Octocontrabass
Member
Member
Posts: 5572
Joined: Mon Mar 25, 2013 7:01 pm

Re: DHCP problems

Post 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?
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: DHCP problems

Post 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?
vladstamate
Posts: 2
Joined: Thu Aug 20, 2020 1:45 pm

Re: DHCP problems

Post 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!
Post Reply