Page 1 of 1

ethernet and wifi bridge

Posted: Wed Apr 14, 2021 10:26 pm
by urbanze
Hello! I looked in example "eth2wifi" inside IDF, but I need to do something a little different.

Ethernet to WiFi STA and not AP. I tried some things but none worked.

I have one device with ethernet connection, but in some clients, just the wifi is present. I need ESP32 to connect in WiFi (STA) and route all trafic to ethernet and vice-versa.

I tried to enable "IP forwarding and NAT" in LwIP menuconfig options, but none worked. Someone can help me?

Re: ethernet and wifi bridge

Posted: Wed Apr 14, 2021 11:21 pm
by WiFive

Re: ethernet and wifi bridge

Posted: Thu Apr 15, 2021 6:55 pm
by urbanze
Hello WiFive! Thanks for this example. I test but fail.

ESP32 can connect in my router and get own IP Addr, however, my computer still failling to get IP Address and internet access. When DHCP (in computer) is active and ping someone, this error appears: ping: connect: Network is unreachable

When use static IP in computer, ping show this another error: From 192.168.43.155 icmp_seq=1 Destination Host Unreachable

I tried to asign static IP to computer equal from ESP32 WiFi STA and different, but none worked.

I tried to enable "IP Forwarding" and "NAT" in LwIP menuconfig, but nothing changes. (idf 4.2)

I tried normal ethernet cable and crossover, but fail again

Re: ethernet and wifi bridge

Posted: Thu Apr 15, 2021 7:49 pm
by WiFive
urbanze wrote:
Thu Apr 15, 2021 6:55 pm

ESP32 can connect in my router and get own IP Addr,
That is not how it works, esp32 will not request an IP address, it is transparent pass through interface. I don't know if that example works on esp-idf >4.0

Re: ethernet and wifi bridge

Posted: Wed May 01, 2024 7:51 am
by ndbd0611
hi,
I am new to esp32 idf. I use LAN8720 breakout board with ESP32 to allow my Raspberry Pi 2 (which don't have wifi) to connect to the internet. attached file is my config. I use esp32 as a wifi station so I have to set the ssid/pwd fields same as ssid/pwd of my home wifi router, right? hope someone can help. thanks