Port NAT to ESP32?
Posted: Thu Jun 15, 2017 5:15 am
Hi,
I understand that esp32 is not planned to be a router. But I really want some router features so that the stations connected to esp32's AP can browse the internet via esp32's STA. I have looked into this project https://github.com/martin-ger/esp_wifi_repeater which brings NAT to esp8688(by using his own NAT enabled lwip https://github.com/martin-ger/esp-open-lwip).
I'm stuck when I try to port that project to esp32. The issue is all dns queries get no response, but ICMP type3 code3(port unreachable). It seems that the udp port that sent the request, was shut down before received the response. I guess esp32-wifi-lib has something to do with it however it is closed source project. Any idea? Walkaround?
I'm thinking to capture DNS packet received from esp32's AP netif and use esp32's STA netif to resend it. then capture the DNS response and forward.
I'm a newbie in this felid. If I get something wrong, just correct me:)
There is another lwip_nat projecthttps://github.com/ajaybhargav/lwip_nat. tried, cannot get it work. but it has a really good code style.
my repo(merge martin-ger's lwip)https://github.com/Derek-X-Wang/esp-idf
I understand that esp32 is not planned to be a router. But I really want some router features so that the stations connected to esp32's AP can browse the internet via esp32's STA. I have looked into this project https://github.com/martin-ger/esp_wifi_repeater which brings NAT to esp8688(by using his own NAT enabled lwip https://github.com/martin-ger/esp-open-lwip).
I'm stuck when I try to port that project to esp32. The issue is all dns queries get no response, but ICMP type3 code3(port unreachable). It seems that the udp port that sent the request, was shut down before received the response. I guess esp32-wifi-lib has something to do with it however it is closed source project. Any idea? Walkaround?
I'm thinking to capture DNS packet received from esp32's AP netif and use esp32's STA netif to resend it. then capture the DNS response and forward.
I'm a newbie in this felid. If I get something wrong, just correct me:)
There is another lwip_nat projecthttps://github.com/ajaybhargav/lwip_nat. tried, cannot get it work. but it has a really good code style.
my repo(merge martin-ger's lwip)https://github.com/Derek-X-Wang/esp-idf