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

Enable routing in lwIP config #1924

Closed
DavidXanatos opened this issue Apr 17, 2016 · 12 comments
Closed

Enable routing in lwIP config #1924

DavidXanatos opened this issue Apr 17, 2016 · 12 comments

Comments

@DavidXanatos
Copy link

DavidXanatos commented Apr 17, 2016

Two clients using a esp8266 as AP cant talk to each other,
module, etc... not relevant tried multiple.
Apparently this functionality is not implemented.

It would be great if that could be added :D

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@igrr igrr changed the title Two clients using a esp8266 as AP cant talk to each other Enable routing in lwIP config Apr 17, 2016
@igrr
Copy link
Member

igrr commented Apr 17, 2016

We can do this if we switch from Espressif-provided lwIP binary to a GCC-built one. Actually open source lwIP just became part of the SDK release (1.5.3), which is a good sign.

@miky2k
Copy link

miky2k commented Apr 17, 2016

I suppose that if you introduce switching (client-client), you can introduce routing(client-esp8266AP-esp8266STA-wifiAP)!

@devyte
Copy link
Collaborator

devyte commented Oct 17, 2017

@d-a-v I suppose this is something we would want to look at only after #3362 ?

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 17, 2017

We discussed about that in #3243.
Routing is possible with current lwip1.4 but needs to be recompiled and tested with IP_FORWARD=1 in tools/sdk/lwip/include/lwipopts.h. It is disabled by default (same in lwip2). I have not tested myself.
Two clients talking to each other (or broadcast) through their AP is not strange and should be enabled. Library size is likely to increase. But in AP+STA mode this will not enable AP's clients to talk to STA peers without NAT (on esp) or specific configuration on STA's router.

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 26, 2017

This is in fact a bug in lwip1.4. The issue's title should not be routing neither forwarding, it's the regular working way for two clients of the same AP to talk to each other.
Using WiFiAccessPoint example sketch, clients of the same network of an esp AP can talk to each other without IP_FORWARD=1 but with lwip2 #3362. I could ssh from my phone to my computer.
With lwip1.4, I could only ping my phone from my computer (but strangely not the other way).

@devyte
Copy link
Collaborator

devyte commented Jan 7, 2018

@d-a-v I think this should be fairly easy to test and close now with lwip2 merged, right?

@danielicy
Copy link

hi there I tried setting IP_FORWARD=1 both in lwip and lwip2 . I rebuilt the libs but with no succes any suggestions?

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 12, 2018

@danielicy Can you explain what you are trying to achieve with IP_FORWARD ?

To my knowledge IP_FORWARD is useful in two cases:

  • 1. multiple interfaces enabled (AP, STA),
    at least one external router (the STATION interface network router - generally your router-AP) informed that the esp8266 is a router for the other "192.168.4./24" network (the one on the SOFTAP interface)
  • 2. if lwIP is NAT-enabled (this is not the case today).

Are you in case 1 ?
If you are not, it is useless to enable this feature, it won't be used.

@d-a-v d-a-v modified the milestones: 2.5.0, 2.6.0 Nov 30, 2018
@danielicy
Copy link

danielicy commented Jan 29, 2019

@d-a-v I'm trying to build a mesh network

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 29, 2019

@danielicy

https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFiMesh/examples/HelloMesh

@danielicy
Copy link

@d-a-v G_d bless you

@d-a-v
Copy link
Collaborator

d-a-v commented Aug 29, 2019

NAT is now available in lwIP v2 w/ features. So even when not using NAT, routing is enabled.
Please open a new issue with MCVE if routing is not working the way it should.

@d-a-v d-a-v closed this as completed Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants