esp32_nat_router icon indicating copy to clipboard operation
esp32_nat_router copied to clipboard

No documentation on port forwarding

Open martinville opened this issue 5 years ago • 5 comments

Hi there. This is a very useful tool to have and absolutely love it! I'm surprised how well this works by both your code and the ESP32. Thank you.

I have a pc in my garage which I use for 3d printing/CNC and showing electronic projects on screen ect ect

It want to be able to RDP to it via TCP:3389 but seeing its on a different network 192.168.4.xxx Its not reachable from my WIFI LAN on 192.168.1.xxx. how can port forward from my network 192.168.1.xxx to 192.168.4.2 ?

Apology if this has been covered, I don't see any documentation.

martinville avatar Apr 24 '20 07:04 martinville

You want to add a route / port forward to the nat routing table. I guess you can do this by this function: https://github.com/martin-ger/esp-lwip/blob/cf4da9ef1ac82efb1128aab6d0d5dd51583d56e0/src/include/lwip/lwip_napt.h#L95

mahaupt avatar Jan 22 '21 07:01 mahaupt

@mailmartinviljoen did you get the port forwording to work?

tilman avatar Mar 09 '21 21:03 tilman

Add the call(s) to ip_portmap_add() after esp32_nat_router.c#L367

martin-ger avatar Mar 09 '21 21:03 martin-ger

Thanks a lot! Worked perfectly 👍

tilman avatar Mar 10 '21 09:03 tilman

The code has since changed, where would you add the ip_portmap_add() calls now?

geidien avatar Oct 24 '23 16:10 geidien