setting a gateway for an access point

bob41042
Posts: 2
Joined: Thu Dec 21, 2017 4:34 am

setting a gateway for an access point

Postby bob41042 » Thu Dec 21, 2017 6:10 am

I have successfully programmed the ESP8266 to act as a hotspot or a wifi extender, where a cell phone can log into it and connect through it to the internet. In order to do that I had to install in my router (that the ESP8266 connects to) a gateway so that return data from the internet can be routed back to the AP section of the chip. This works as I said, but I seem to have seen on various videos that there is a way to add this gateway to the router through commands on the ESP8266 rather than reprogramming the router. My question is, is that possible? And what are the commands?

Now I'm not talking about the gateway command when initializing the softAP. That gateway is forward from the cell phone through the access point to the station network and on to the router. This would be a gateway returning from the router. Since the data sent will be on the AP network address, and the only thing the router knows is connected to it is the station mode network (assigned by the router). In other words the cell phone on the AP network has an AP assigned address of 192.168.4.2 and the AP on the ESP8266 is address 192.168.4.1 while the Station portion of the ESP8266 has the router assigned address of 192.168.200.25 with the router 192.168.200.1. So the data passed as 192.168.4.2 from the cell phone knows it's only wifi connection is to 192.168,4,1 so it passes the data there. The AP at 192.168,4.1 knows the connection to the router is through 192.168,200.25 by its internal gateway command and of course the station mode knows it connected to the router at 192.168,200.1 so the data is passed smoothly to the internet. But when data comes back from the internet for address 192.168,4.2 there is nothing to tell the router where to send it. Is there a command that can be sent when initializing the station that can tell the router that it (the station 192.168,200.25) is the gateway to the 192.168,4.1 network and thereby the 192.168.4.2 cell phone and any other phones that may subsequently connect?

Thanks in advance. Hope I was clear enough.
Bob

syemour
Posts: 5
Joined: Wed Dec 13, 2017 10:00 pm

Re: setting a gateway for an access point

Postby syemour » Thu Dec 21, 2017 4:50 pm

great!

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: setting a gateway for an access point

Postby Her Mary » Mon Dec 25, 2017 3:22 pm

Do you mean that you can send data as phone->ESP8266->router->internet?
That is a great work! How did you do that?

Who is online

Users browsing this forum: No registered users and 4 guests