ESP8266 lwip IP_FORWARD/routing
-
- Posts: 11
- Joined: Fri Jul 17, 2015 7:13 pm
ESP8266 lwip IP_FORWARD/routing
Postby ajay.bhargav » Tue Aug 18, 2015 5:39 am
Now my setup is like this:
pc<->router<->(sta)esp(ap)<->esp2(sta)
I want to ping esp2 from my pc. I enabled IP_FORWARD in lwipopts.h and rebuild sdk. esp2 connects to esp (also connected to router). But I am not able to ping esp2 from PC. So my question is it possible for esp8266 to forward ip packets between station and AP interfaces? Has anyone tried it? It will be a really helpful thing to implement if we want to use esp as a gateway to internet or something similar.
Please let me know if anyone else is trying something similar.
Regards,
Ricky
Re: ESP8266 lwip IP_FORWARD/routing
Postby eriksl » Tue Aug 18, 2015 4:09 pm
-
- Posts: 11
- Joined: Fri Jul 17, 2015 7:13 pm
Re: ESP8266 lwip IP_FORWARD/routing
Postby ajay.bhargav » Tue Aug 18, 2015 6:27 pm
Open source LWIP for esp_iot_sdk_v1.3.0
and enabled IP_FORWARD which as per lwip suppose to make stack to route packet between networks.
Code: Select all
/**
* IP_FORWARD==1: Enables the ability to forward IP packets across network
* interfaces. If you are going to run lwIP on a device with only one network
* interface, define this to 0.
*/
I am assuming we are having two different interfaces STATION_IF and SOFTAP_IF. I am not sure if thats true... It would be really great if espressif can have a simple routing feature. Has anyone else tried doing this?
Re: ESP8266 lwip IP_FORWARD/routing
Postby eriksl » Tue Aug 18, 2015 7:43 pm
Aren't you confusing routing with bridging? An access point usually can be configured to enable or disable it ("client isolation").
-
- Posts: 11
- Joined: Fri Jul 17, 2015 7:13 pm
Re: ESP8266 lwip IP_FORWARD/routing
Postby ajay.bhargav » Wed Aug 19, 2015 12:24 am
eriksl wrote:I don't understand what you're trying to do with routing. For routing you need two LAYER 3 interfaces. The esp8266 has only one. Out of the box it can't use multiple SSIDs nor VLAN tags, so???
Aren't you confusing routing with bridging? An access point usually can be configured to enable or disable it ("client isolation").
You're right I am confused. I actually do not want routing it is a wrong word to use here.
PC (192.168.0.2) <-> (192.168.0.3) ESP1 in STA+AP (192.168.4.1) <> (192.168.4.2)ESP2
So basically I just my pc to see device (ESP2) on the other end of ESP1. I should be able to ping 192.168.4.2 from 192.168.0.2 .. something...
So I should say NAT or Bridge? NAT seems more appropriate here? I have a doubts can SOFTAP and STATION be considered as two wifi interfaces?
Sorry for asking too many questions...

Re: ESP8266 lwip IP_FORWARD/routing
Postby tve » Thu Aug 20, 2015 1:05 am
- route packets between a STA connected to the ESP's SOFT-AP and the internet (or some other box) connected via the ESP's STA and your standard AP then you're looking for routing and the ESP does have two interfaces with separate IPs for the two functions (SOFT-AP and STA)
- route packets between multiple STAs connected to the ESP's SOFT-AP then you're looking neither for routing nor bridging but layer-2 forwarding of packets at the SOFT-AP level
-
- Posts: 11
- Joined: Fri Jul 17, 2015 7:13 pm
Re: ESP8266 lwip IP_FORWARD/routing
Postby ajay.bhargav » Thu Aug 20, 2015 3:16 pm


Re: ESP8266 lwip IP_FORWARD/routing
Postby neocat » Wed Oct 12, 2016 9:33 pm
Network outline:

The patch:
https://github.com/NeoCat/esp8266-Ardui ... d3f178bcbe
Who is online
Users browsing this forum: No registered users and 289 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.