ESP8266 lwip IP_FORWARD/routing

martin_g
Posts: 4
Joined: Mon Dec 05, 2016 3:30 am

Re: ESP8266 lwip IP_FORWARD/routing

Postby martin_g » Mon Dec 05, 2016 3:46 am

Thanks neocat for the great work!

Now I have a WiFi-Repeater running on an esp8266, actually an ESP-01.
I had some issues with the IP and TCP-checksums for modified packets in the uploaded version. Finally fixed it with the orgiginal code from RFC 1631. Also updated the DHCP server to distribute DNS server addresses other than the own AP address.

Now it connects as STA with my home WiFi and offers its own SSID as AP to other devices. Works as guest-WiFi or as range extender. Throughput ist just fine even with a laptop or a smartphone as client. I am just connected via it.

If anybody ist interested, ask me. Will clean it up and post it here.

martin_g
Posts: 4
Joined: Mon Dec 05, 2016 3:30 am

Re: ESP8266 lwip IP_FORWARD/routing

Postby martin_g » Fri Dec 09, 2016 7:54 am

Published the code at https://github.com/martin-ger/esp-open-lwip/tree/nat.

Added a full functional WiFi repeater (correctly: a WiFI NAT Router) at https://github.com/martin-ger/esp_wifi_repeater.

It is a proof of concept implementation of a WiFi NAT router on the esp8266. It can be used as range extender for an existing WiFi network. The esp acts as STA and as soft-AP and transparently forwards any IP traffic through it. As it uses NAT no routing entries are required neither on the network side nor on the connected stations. Stations are configured via DHCP in the 192.168.4.0/24 net and receive their DNS responder address from the existing WiFi network.

daiyinger
Posts: 1
Joined: Wed Jan 18, 2017 2:58 pm

Re: ESP8266 lwip IP_FORWARD/routing

Postby daiyinger » Wed Jan 18, 2017 3:02 pm

Thanks martin-ger for the great work!
I tried your binaries, is very nice
Now,I want to try to port it to ESP32, can i use nat change of ip.c in "https://github.com/martin-ger/esp-open-lwip/tree/nat" to get it?

martin_g
Posts: 4
Joined: Mon Dec 05, 2016 3:30 am

Re: ESP8266 lwip IP_FORWARD/routing

Postby martin_g » Sun Jan 22, 2017 5:17 pm

Yes, thing so. There is nothing specific for the EPS8266 chip in the code, as far as the NAT patches are concerned.

Have just pushed a version of the lib to https://github.com/martin-ger/esp-open-lwip. A little bit cleaner and with a header for the NAPT API.

fabiana.ferreira
Posts: 1
Joined: Mon Sep 25, 2017 6:34 pm

Re: ESP8266 lwip IP_FORWARD/routing

Postby fabiana.ferreira » Mon Sep 25, 2017 6:41 pm

Hello!
I have a project from college that is to implement a mesh network using NodeMCU's. I was advised to look up your project, because it may help me. I have a root node, which will be connected to a sensor and I need to pass this information through all the node to reach its destination. I tried to implement it, but I'm having problems with ESP running as SoftAP and Station at the same time. Do you think it could you help me?

User avatar
DanieliCy
Posts: 2
Joined: Tue Nov 22, 2016 3:08 am

Re: ESP8266 lwip IP_FORWARD/routing

Postby DanieliCy » Mon Aug 06, 2018 8:52 pm

Hi neocat your solution seems like something I've being search for quite a while thanks!
do you have an implementation example?

Who is online

Users browsing this forum: No registered users and 10 guests