---
title: "DHCP example"
url: "https://maker.wiznet.io/forum/14528"
markdown_url: "https://maker.wiznet.io/forum/14528/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "derrick"
created: "2022-04-19T23:45:29+09:00"
last_activity: "2022-09-05T23:37:08+09:00"
language: "en"
views: 856
replies: 3
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# DHCP example

## Question

Asked by derrick on 2022-04-19 in Ethernet Chips.

Hi,

We’re evaluating the W6100 and were able to integrate the io6Library ([GitHub - Wiznet/io6Library: io6Library is the integrated library for dual TCP/IP statck contorller such as W6100.](https://github.com/Wiznet/io6Library)) and loopback example ([GitHub - WIZnet-ioLibrary/W6100EVB-Loopback: The Loopback Example for W6100 using io6Library](https://github.com/WIZnet-ioLibrary/W6100EVB-Loopback)) on a Cortex-M4-based development board. This example works using static IP addresses, but we’d like to see an example using DHCP.

We’ve implemented the auto-configuration example ([GitHub - WIZnet-ioLibrary/W6100EVB-AddressAutoConfiguration: The AddressAutoConfiguration Example for W6100 using io6Library](https://github.com/WIZnet-ioLibrary/W6100EVB-AddressAutoConfiguration)), but there is no documentation explaining how it works or how to interpret what’s happening. The example compiles and runs, and this is outputted to stdout (from printf):

Duplicate_Address_Detection
Wait RQIR…

Timeout !!! DAD SUCCESSED

flags = 0x80
Address_Auto_Configuration Start
getICMP6BLKR() = 0x4
getSn_PROTOR(7) = 0x3a
Sn_SR : 33
getSLRTR() = 0xfa0
getSLRCR() = 0x0
getSLCR() = 0x0
getSLIR() = 0x0
Wait SLIR…
getSLIR() = 0x80
getSn_RX_RSR(7) = 0x1a
size : 4
recvfrom IP : (IPv6 address from a router on our network)

## Replies

### Reply 1 by lawrence, 2022-04-26

Hello, [@derrick](https://maker.wiznet.io/u/derrick)

The example’ follows W6100 DAD commands to set W6100’ IPv6 address.
(you can get more info, what DAD is, from here, [IPv6- Duplicate Address Detection (DAD) | by Geeky much! | Networks & Security | Medium](https://medium.com/networks-security/ipv6-duplicate-address-detection-dad-f83b20cb89aa))
In datasheet, 6.6.5 DAD(Duplicated Address Detection) discribes DAD commands W6100 supports, <https://docs.wiznet.io/img/products/w6100/w6100_ds_v104k.pdf>

Could you check this docs once ? And if you get more info and work follow, please let me know explain the details.

Thank you.

### Reply 2 by derrick, 2022-04-27 (in reply to reply 1)

Hi Lawrence,

We’re looking to run an IPv4 DHCP example first. Is that available? It looks like this example sets a static IPv4 address and then tries to do the IPv6 autoconfig: [W6100EVB-AddressAutoConfiguration/main.c at f05c0cf798b4836ed892eddc731208552111dc1f · WIZnet-ioLibrary/W6100EVB-AddressAutoConfiguration · GitHub](https://github.com/WIZnet-ioLibrary/W6100EVB-AddressAutoConfiguration/blob/f05c0cf798b4836ed892eddc731208552111dc1f/TrueStudio/W6100EVB-AddressAutoConfiguration/Src/main.c#L118-L130)

Once we’ve we’ve had some time to explore IPv4 functionality, we will look into IPv6.

Edit: I took a look at this older thread ([W6100 DHCP Sample code for IPV4](https://forum.wiznet.io/t/topic/6655)) and got the W6100 to acquire an IPv4 address from our DHCP server. I’ll start looking into IPv6.

### Reply 3 by lawrence, 2022-09-05

Hi [@derrick](https://maker.wiznet.io/u/derrick)

This is basic IPv6 DHCP

![](https://github.githubassets.com/favicons/favicon.svg) [github.com](https://github.com/Wiznet/io6Library/tree/master/Internet/DHCP6)

### [io6Library/Internet/DHCP6 at master · Wiznet/io6Library](https://github.com/Wiznet/io6Library/tree/master/Internet/DHCP6)

[master/Internet/DHCP6](https://github.com/Wiznet/io6Library/tree/master/Internet/DHCP6)

io6Library is the integrated library for dual TCP/IP statck contorller such as W6100.

You can run this code on your existing project.

Thank you

---

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