---
title: "W7500P, DHCP not working"
url: "https://maker.wiznet.io/forum/13657"
markdown_url: "https://maker.wiznet.io/forum/13657/md"
type: "Forum topic"
category: "MCU & Boards"
author: "rajovic"
created: "2020-01-18T09:44:23+09:00"
last_activity: "2020-07-15T08:27:23+09:00"
language: "en"
views: 2057
replies: 21
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W7500P, DHCP not working

## Question

Asked by rajovic on 2020-01-18 in MCU & Boards.

I cannot get my W7500P to acquire IP address from DHCP server.
I am running DHCP example as is, and there is no DHCPOFFER received after sending DHCPDISCOVER message.
Also, there is a strange behaviour when running loopback.
I will describe my setup first:
The board is powered through 1-in 1-out PoE switch. The PoE switch is connected to LAN port of an access point.
In Loopback example (static IP), the MCU links OK. But it is not visible on the network (same subnet). I can connect to the MCU ONLY if connecting directly (through PoE switch) my laptop and the MCU board and the loopback example works fine.

As I said, DHCP example does not work at all.

Does it have to do with a particular router? I have a bit complex wireless infrastructure in my office:

1. there is a wireless router 1 with SSID “network” with the address 192.168.0.1

2. there is another wireless router 2 with the same SSID connected wirelessly to the router 1, with the address 192.168.0.10.

3. the MCU is connected by cable to the router 2 (through PoE switch)

4. DHCP server runs on the router 1

5. The both routers are the same tenda model.

So, the connection of the MCU board is: PoE switch → router 2 with no DHCP server → router 1 with DHCP server.
Please note that if I connect my laptop in the same way it works fine (acquires IP address). However, through wireshark I can see that the laptop first sends DHCPREQUEST instead of DHCPDISCOVER message.
Please help, I have no idea what the problem is.

## Replies

### Reply 1 by rajovic, 2020-01-19

I tried several different routers and the behaviour is the same, DHCP server does not respond to DHCP_DISCOVER from W7500p. I caught DHCP_DISCOVER message from the MCU by Wireshark, so the MCU sends the message.
Please advise

### Reply 2 by becky, 2020-01-20 (in reply to reply 1)

Can you connect to the router 1 ?
If you can that, please check the difference and debug message of W7500P.
The SSID is not relevant with W7500P because W7500P is using Ethernet and SSID used to WiFi.
Is it right laptop is assigned ip via ethernet?

### Reply 3 by rajovic, 2020-01-20

hello.
I cannot connect to any router via DHCP, I have tried three so far (one Tenda, one TP-LINK, and a direct cable connection to my company ethernet infrastructure). Also, I cannot connect statically, that is W7500P is not visible on the subnet. If I connect a laptop on the same cable instead of W7500P it gets IP address (through DHCP) fine and is visible on the subnet.
If I directly connect W7500P and a laptop only then I can communicate with the W7500P (the both are assigned IP address manually).
Here is the Wireshark capture of DHCP_DISCOVER message from W7500P:

---

Dynamic Host Configuration Protocol (Discover)
Message type: Boot Request (1)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x1234567e
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
1… … … … = Broadcast flag: Broadcast
.000 0000 0000 0000 = Reserved flags: 0x0000
Client IP address: 0.0.0.0
Your (client) IP address: 0.0.0.0
Next server IP address: 0.0.0.0
Relay agent IP address: 0.0.0.0
Client MAC address: Wiznet_01:02:03 (00:08:dc:01:02:03)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Discover)
Option: (61) Client identifier
Option: (12) Host Name
Option: (55) Parameter Request List
Option: (255) End
Padding: 000000000000000000000000000000000000000000000000…

---

I hope this helps you to better understand my issue.
Thank you for you interest

### Reply 4 by irina, 2020-01-21 (in reply to reply 3)

First, If you have several DHCP server, I think you should add the delay of 200ms between call of like DHCP_run() in main loop.
Could you please add the delay and try again?

### Reply 5 by becky, 2020-01-21 (in reply to reply 3)

Your Wire shark capture has not problem.

![](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/48.png) rajovic:

> However, through wireshark I can see that the laptop first sends DHCPREQUEST instead of DHCPDISCOVER message.

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/0/0a1b5dfc1703ff789717d9694898a7ef117e0598.png)
It is normal work that W7500 first sends DISCOVER message.

### Reply 6 by rajovic, 2020-01-21

I have added the delay in the main loop between calls to DHCP_run(), but no change.

Can you confirm/check that the DHCP example works as is on the GitHub? Or anyone else who tried it?

### Reply 7 by rajovic, 2020-01-22

I downloaded DHCP server application onto my laptop ([http://tftpd32.jounin.net](http://tftpd32.jounin.net/)), and now this server assigns IP address to W7500P correctly if I connect laptop and W7500P through cable.

But still I could not obtain IP from any of four routers I tried (TP-Link and Tenda), and W7500P is not visible on subnet even in Loopback example (with manual IP).

The good experiment would be if somebody tries the DHCP example with a router and confirm it works as is. Sounds lame, but maybe DHCP servers on routers need more information in Discover message?

### Reply 8 by irina, 2020-01-22

![](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/48.png) rajovic:

> Can you confirm/check that the DHCP example works as is on the GitHub?

Do you use a board made by yourself using the W7500P? or use WIZ750SR?
If you use like WIZ750Sr module, you can use the DHCP code on the Github.
WIZ750SR Github : <https://github.com/Wiznet/WIZ750SR>
When I use the WIZ750SR, I could check the DHCP packet like below figure.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/4/4d6e93e8c594c5a4345613967efcf195767633e7.png) image1131×315 24.3 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/4/4d6e93e8c594c5a4345613967efcf195767633e7.png)

### Reply 9 by rajovic, 2020-01-22

irina_kim:

> Do you use a board made by yourself using the W7500P? or use WIZ750SR?

I use a board made by myself after WIZwiki-W7500P.

Could you expand Wireshark so I could see the content of Discover packet?

### Reply 10 by irina, 2020-01-23 (in reply to reply 9)

![](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/48.png) rajovic:

> Could you expand Wireshark so I could see the content of Discover packet?

You can see the DHCP discover packet as below figure.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/5/5102544a1e6d19381da3ff1f7cad5f45739f528a.png) image988×556 158 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/5/5102544a1e6d19381da3ff1f7cad5f45739f528a.png)

Have you ever succeeded in connecting DHCP when you use the WIZwiki-W7500P?
There is a DHCP-related example that we provide and first, I think you test the DHCP protocol using WIZwiki-W7500P.

### Reply 11 by rajovic, 2020-01-23

Dear Irina,
Can you expand Parameter request list in wireshark, so I can check against my design?
Yes, I have tried the example with WizWiki-7500P board.
Thank you

### Reply 12 by irina, 2020-01-28

![](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/48.png) rajovic:

> I use a board made by myself after WIZwiki-W7500P.
>
> Could you expand Wireshark so I could see the content of Discover packet?

The first thing I’d like to do is check your schematic.
Because the example of DHCP is hardcoding and if you didn’t change the source code, it would be no problem.
Also, As @mc said, it would be good to compare the discover packets when PC get an address assigned using DHCP.

### Reply 13 by rajovic, 2020-01-28

[Schematic Prints1.pdf](https://maker.wiznet.io/forum/legacyFile.asp?path=xVmyzKc6TflmESc6hccYT4Drvsq.pdf) (79.2 KB) [Schematic Prints2.pdf](https://maker.wiznet.io/forum/legacyFile.asp?path=kc7nLUXmJc6yEPhfyyYyNXs6qyU.pdf) (57.1 KB) [Schematic Prints3.pdf](https://maker.wiznet.io/forum/legacyFile.asp?path=ds4qTJr7pMpYOpasutfbKb73PmZ.pdf) (66.0 KB)

Here are the schematics of my project.

And here are screenshots from a PC discovery packet

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/7df01a37273cb239a782bd48e0425e0194bc01d8.png)

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/6/61541ef1bc5a9e65b0a122ac539b100ccfed2256.png)

Please note that if I connect directly PC and W7500P, and run a DHCP server application on the PC, W7500P gets an IP address from the DHCP server

### Reply 14 by irina, 2020-01-29 (in reply to reply 13)

![](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/48.png) rajovic:

> Please note that if I connect directly PC and W7500P, and run a DHCP server application on the PC, W7500P gets an IP address from the DHCP server

The first thing you do is check the packet of between PC and Router as shown in figure.
![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/5/5697c01dbc4f4d3be6de454629e106f956ab9d96.png)

Could you please let me tell the DHCP tool on the PC?
I want to test as same environment.

### Reply 15 by rajovic, 2020-01-29

The above screenshots are of the discover packet sent from PC to router, after which the PC gets IP address from the router.

Do you want to see some other packet?

As for DHCP tool for PC, I try three different tools, all work the same, for example
<http://www.dhcpserver.de/cms/>

### Reply 16 by irina, 2020-01-30 (in reply to reply 15)

I will request to hardware engineer([@Scott](https://maker.wiznet.io/u/scott)) your schematic.
If you can access admin account in router, you can see to manager the assigned IP in DHCP Server.Could you check if W7500P is assigned IP.
Isn’t it a problem with the router?

### Reply 17 by scott, 2020-01-30

Dear [@rajovic](https://maker.wiznet.io/u/rajovic)

I think your schematic is wrong.

You do not use the MCU clock and PHY clock on W7500P.

So W7500P can’t work.

You can check the reference schematic for W7500P at the URL below.

![](https://github.githubassets.com/favicons/favicon.svg) [github.com](https://github.com/Wiznet/Hardware-Files-of-WIZnet/tree/master/01_iMCU/W7500P/Reference%20Schematic)

### [Hardware-Files-of-WIZnet/01_iMCU/W7500P/Reference Schematic at master ·...](https://github.com/Wiznet/Hardware-Files-of-WIZnet/tree/master/01_iMCU/W7500P/Reference%20Schematic)

[master/01_iMCU/W7500P/Reference%20Schematic](https://github.com/Wiznet/Hardware-Files-of-WIZnet/tree/master/01_iMCU/W7500P/Reference%20Schematic)

This repository is a place to manage hardware-related data created by WIZnet. - Hardware-Files-of-WIZnet/01_iMCU/W7500P/Reference Schematic at master · Wiznet/Hardware-Files-of-WIZnet

Thank you.

### Reply 18 by rajovic, 2020-01-30

Dear [@Scott](https://maker.wiznet.io/u/scott)

Sorry, I forgot to mention that the board has been reworked so we added PHY clock. AS for MCU clock, we use internal RC oscillator as a clock source.
Anyway, many examples work (loopback for example), but not DHCP.

### Reply 19 by rajovic, 2020-01-30

Dear [@irina_kim](https://maker.wiznet.io/u/irina_kim)

I tried several different routers, always the same.

Anyway, I decided not to use DHCP, but this issue still makes me restless, so I am keen to find out what is going on.

### Reply 20 by rajovic, 2020-01-30

This topic has become so long, so I’ll try to summarize the problem as concisely as possible.

- I run DHCP example with several different routers, I see Discover packets are sent by the MCU, but no DHCP offer from router.

- I connect a PC running DHCP server application and W7500P directly, and the MCU receives DHCP offer from the DHCP server running on the PC.

- I run loopback example (with static IP address for MCU in the same subnet), but the MCU is not visible on the subnet by other devices (ping fails)

- If I run loopback example with direct connection of a PC and the MCU, the MCU answers on ping request

### Reply 21 by linuxfans, 2020-07-15

[@rajovic](https://maker.wiznet.io/u/rajovic)
Hi Rajovic,

I encountered the same problem today and finally found that it was caused by the “multicast bit” in the MAC address. And in your previous post:

![](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/48.png) rajovic:

> Bootp flags: 0x8000, Broadcast flag (Broadcast)
> 1… … … … = Broadcast flag: Broadcast

Maybe the same reason leads to your problem.

---

Source: https://maker.wiznet.io/forum/13657
