---
title: "reset when ip update from DHCP"
url: "https://maker.wiznet.io/forum/13756"
markdown_url: "https://maker.wiznet.io/forum/13756/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Julio Beloso"
created: "2020-03-26T12:57:17+09:00"
last_activity: "2020-04-14T05:37:38+09:00"
language: "en"
views: 707
replies: 6
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# reset when ip update from DHCP

## Question

Asked by Julio Beloso on 2020-03-26 in Ethernet Chips.

Is it necessary to restart the W5500 when we obtain a different IP from the DHCP server when we do an IP renewal?

Is it not enough to update the registers with the new ip?

In an RTOS environment, it is difficult to reset the chip because that affects other threads

regards

## Replies

### Reply 1 by becky, 2020-03-27

You don’t have to reset the W5500 as you say.
Update the Network registers and If there is an open socket, close it and open it again.

### Reply 2 by Julio Beloso, 2020-03-30

ok,

I saw that the callback default_ip_update() in dhcp.c in the ioLibrary has a sw_reset. for that reason is my question.

regards

### Reply 3 by Julio Beloso, 2020-04-02

Hi, I have another question

If the socket is UDP, it is necessary close and open? It seems that DHCP socket is still working without restarting it.

Regards

### Reply 4 by becky, 2020-04-09

If you are using DHCP function of wiznet library, please do DHCP_run () after DHCP_init ().

### Reply 5 by Julio Beloso, 2020-04-13 (in reply to reply 4)

Yes, I use DHCP function of wiznet library.
Should I run DHCP_init() when the delivered ip from DHCP server has changed?

I can not see where the DHCP socket is closed. I only can see “close(DHCP_SOCKET);” in the DHCP_stop() function, and this is not executed.

regards

### Reply 6 by becky, 2020-04-14

I guess you asked this question because I told you to close and open the socket when updating ip. The DHCP socket does not need to be closed and opened. I told you to close and open the socket because it can cause confusion if you are communicating with a specific target.
For example, if the W5500 was communicating with the server as a TCP client, there may be a problem when transferring data to the server after your IP is changed. But this is not essential.

---

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