Page 1 of 1

Two NetIf with one DHCP server instance

Posted: Sun May 30, 2021 9:45 am
by htw8866
Hi,

I'm looking for a solution to run two network interfaces on a esp32-s2 with DHCP server support.

Scenario:
- interface 1 is usb cdc-ecm (could be ethernet as well) - subnet 192.168.1.x
- interface 2 is WiFi - subnet 192.168.2.x

Both shall support a DHCP server.
Hence I enabled DHCP server inside esp-idf.

However as I checked the dhcp_server_start function, I found no option to start it for both interfaces.
Furthermore there is no multi instance support inside of the DHCP server module - at least to my understanding.

Question:
Can anyone give me some pointers how to do that?
Is there an already available solution for this?
Do I need to extend the DHCP server module?

Many thanks in advance,
Torsten

Re: Two NetIf with one DHCP server instance

Posted: Sun Mar 19, 2023 8:54 pm
by BenSuffolk
Did you find a solution?

I’m wanting to run a dhcp server on an Ethernet interface and have the softAP WiFi enabled. I have found that when I do this the Ethernet interface no longer issues dhcp addresses. When you connect to the soft ap I see the logs issue 2 identical ip addresses. So clearly the server is still running twice, but they are then both bound to the soft ap.

Re: Two NetIf with one DHCP server instance

Posted: Mon Mar 20, 2023 10:06 am
by htw8866
Hi,

unfortunately no solution yet.

As far as I know the dhcp server - currently available - can not handle different sub-networks yet.

Hence somebody need to improve the dhcp server.

Regards Torsten