iiOTESP32 Brasil
Contingency mode: public pages and downloads remain available; login, community, and server data may be unavailable.
Back to project list
AdvancedFeatured projectCompleted

ESP32 Wi-Fi NAT repeater

An original project that turns the ESP32-S3 into an access point, Wi-Fi client and NAT gateway, with an embedded configuration portal and DNS propagation for clients.

#ESP32-S3#ESP-IDF#lwIP NAPT#esp_netif#esp_http_server#NVS Flash

Communication and architecture flow

Main Wi-Fi routerESP32-S3 (Wi-Fi STA)NAPT in lwIP (esp_netif_napt_enable)ESP32-S3 (Access Point + DHCP with DNS)Phones / laptops / IoT modules

Industrial challenge / problem:

Factory floors and technical offices can have Wi-Fi blind spots. Commercial routers are bulky and require dedicated power infrastructure.

Technical solution developed:

ESP-IDF firmware with NAPT enabled in lwIP. The device connects to the main network through the Station interface, creates its own network through the Access Point interface and forwards traffic between both, propagating the router DNS through DHCP—the step often missing when a client connects but cannot browse. Arduino Core is not suitable here because its lwIP build does not include IP forwarding.

Project component list:

  • ESP32-S3 N16R8 module board (16 MB flash, 8 MB octal PSRAM)
  • Internal PCB antenna or external 2.4 GHz IPEX antenna
  • 5 V 1 A USB supply or 24 V → 5 V DIN-rail regulator
  • Adjustable protective enclosure

Expected result in operation:

Bench-validated: NAPT active on the AP interface with ESP_OK, DHCP propagating the router DNS, a connected client browsing for more than 8 minutes without reassociation, -39 dBm signal and 3 hours 48 minutes of continuous operation without a restart.

Open the tutorial

Open the tutorial

Install the environment, assemble the circuit, compile and validate it—with the complete firmware and PDF manual available to download.

Open the tutorial