Bridge WiFi and Ethernet

I’ve been playing with an Olimex ESP32-Poe-iso, mostly to provide a Poe-based gate sensor at the end of my drive. Bit overkill for a single GPIO interrupt, so I started thinking about whether I could also use it to provide a WiFi AP at my gate for a few other devices there.

  1. My goal is: bridge WiFi AP and Ethernet using mos to allow the esp32 to act as an internet connected AP
  2. My actions are: I’ve found this ESP-IDF example, but not sure how to 8mplement the same in mos when using the Ethernet and WiFi libraries.

Has anyone done similar who could give me some guidance?

“bridge” ?
What is your scenario ?
A bridge would take a frame and send it over the other interface until it knows where the destination MAC is; forwarding broadcasts in both interfaces.
If your ESP32 will behave as an AP and the Ethernet has its own address space, you need to route.
mOS is based on lwIP, it has a basic routing but AFAIK (several years ago when I was active at their forum) it did not have forwarding capabilities. I mean, it could be reached from both interfaces and would know how to reach back to the source of the request, but it would not forward other IP address unless you placed your routing code at some provided hooks. Same for a bridge.
I found this post and looks like things have improved over time.
You will also have to either run a routing protocol or place static routes at your Ethernet routing box so it knows how to reach devices on the other end of the ESP32 AP, unless you also run NAT on it… even if no one in your LAN needs to reach those devices, your ISP router will if they want to reach the Internet and get a response back.

Maybe you can just gather an old TP-Link and do what you need + the AP with openWRT/LEDE, which is Linux based

1 Like