---
title: "TCP server in DHCP mode"
url: "https://maker.wiznet.io/forum/15215"
markdown_url: "https://maker.wiznet.io/forum/15215/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "andreluizrr"
created: "2024-05-09T01:36:48+09:00"
last_activity: "2024-05-09T04:54:21+09:00"
language: "en"
views: 72
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# TCP server in DHCP mode

## Question

Asked by andreluizrr on 2024-05-09 in Ethernet Chips.

Hi!
I’m developing a project of a TCP server that can work with static IP or get the IP from DHCP.
In static IP it works fine, but in DHCP, it gets the IP but it returns error in the function listen(sn).
Since DHCP uses UDP protocol is possible to use this IP on TCP protocol?
I have already tried to use other socket on TCP protocol but it didn’t work too.
Anyone could help on how to configure the Wiznet as a DHCP client and a TCP server?
Thanks.

## Replies

### Reply 1 by Eugeny, 2024-05-09

![](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/48.png) andreluizrr:

> is possible to use this IP on TCP protocol?

Why not?

![](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/48.png) andreluizrr:

> Anyone could help on how to configure the Wiznet as a DHCP client and a TCP server?

You must give more details - IP address you get from DHCP, mask, gateway address, MAC address.

---

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