Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using IP DHCP server from gateway #173

Open
karnasw opened this issue Sep 10, 2024 · 2 comments
Open

Using IP DHCP server from gateway #173

karnasw opened this issue Sep 10, 2024 · 2 comments

Comments

@karnasw
Copy link

karnasw commented Sep 10, 2024

Hi, are there any way to use DHCP server from main router (gateway)? Actually devices connected to esp32 nat have nat 's IP subnet.

@vks007
Copy link

vks007 commented Jan 12, 2025

I am also looking for this solution. My purpose is to use this extender for IOT devices but they have to communicate back to the server on the main router's network. ESP32 NAT creates its own subnet and clients connected to it arent accessible from the main router's network. Am I missing something here?

@georgepapas123
Copy link

@karnasw To achieve this you have to use the portmap command from a serial terminal (MobaXterm is one of the best).
The following is an excerpt from README.md:

Access devices behind the router

If you want to access a device behind the esp32 NAT router? PC -> local router -> esp32NAT -> server

Lets say "server" is exposing a webserver on port 80 and you want to access that from your PC.
For that you need to configure a portmap (e.g. by connecting via the arduino IDE uart monitor through USB)

portmap add TCP 8080 192.168.4.2 80
                                 ↑ port of the webserver
                            ↑ server's ip in esp32NAT network
                  ↑ exposed port in the local router's network

Assuming the esp32NAT's ip address in your local router is 192.168.0.57 you can access the server 
by typing 192.168.0.57:8080 into your browser

In other words, if you typed 192.168.0.57:80 (or just 192.168.0.57) you would be accessing the Web Config Interface page (same as 192.168.4.1 from esp32NAT's network), but now traffic to port 8080 goes to your device so it is now also accessible as 192.168.0.57:8080 (same as 192.168.4.2)
If it helps think of it as
192.168.4.1 = 192.168.0.57
192.168.4.2 = 192.168.0.57:8080

@vks007 If your device (192.168.4.2) serves a web page, the above will allow you to access it, but you won't be able to access the rest of 192.168.0.x network from your device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants