ethernet and wifi bridge

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

ethernet and wifi bridge

Postby urbanze » Wed Apr 14, 2021 10:26 pm

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?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ethernet and wifi bridge

Postby WiFive » Wed Apr 14, 2021 11:21 pm


User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: ethernet and wifi bridge

Postby urbanze » Thu Apr 15, 2021 6:55 pm

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ethernet and wifi bridge

Postby WiFive » Thu Apr 15, 2021 7:49 pm

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

ndbd0611
Posts: 1
Joined: Wed May 01, 2024 7:36 am

Re: ethernet and wifi bridge

Postby ndbd0611 » Wed May 01, 2024 7:51 am

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
Attachments
Screenshot 2024-05-01 at 14.41.16.png
Screenshot 2024-05-01 at 14.41.16.png (93.88 KiB) Viewed 1307 times

Who is online

Users browsing this forum: Google [Bot] and 82 guests