STA Mode: Sending packets with other MAC source
Posted: Thu Nov 16, 2023 4:29 pm
Hello.
I need to build esp32-based transparent WiFi bridge like that:
Copper ETH <-> ESP32 AP <-> ESP32 STA <-> Copper ETH
So, first part Copper ETH <-> ESP32 AP works well (based on "eth2ap" example)
Second part ESP32 STA <-> Copper ETH (based on the same "eth2ap" example, but modified to STA) has a problem.
AP can send to WiFi packets with any source MAC
But STA can send only packets with the exactly same source MAC, as it was assigned in esp_wifi_set_mac()
When i try to send packet with other source MAC - looks like it just skipped by driver. Anyway, i can't recieve such packets on the other side.
Of course, i can encapsulate all ETH frames from copper into other frames with correct source MAC address (something like EoIP-tunnel by Mikrotik).
Also i can use something like raw 802.11 packets.
But what is the most correct way to do this with WiFi standart?
Maybe i can disable MAC source control in STA mode or something else?
I need to build esp32-based transparent WiFi bridge like that:
Copper ETH <-> ESP32 AP <-> ESP32 STA <-> Copper ETH
So, first part Copper ETH <-> ESP32 AP works well (based on "eth2ap" example)
Second part ESP32 STA <-> Copper ETH (based on the same "eth2ap" example, but modified to STA) has a problem.
AP can send to WiFi packets with any source MAC
But STA can send only packets with the exactly same source MAC, as it was assigned in esp_wifi_set_mac()
When i try to send packet with other source MAC - looks like it just skipped by driver. Anyway, i can't recieve such packets on the other side.
Of course, i can encapsulate all ETH frames from copper into other frames with correct source MAC address (something like EoIP-tunnel by Mikrotik).
Also i can use something like raw 802.11 packets.
But what is the most correct way to do this with WiFi standart?
Maybe i can disable MAC source control in STA mode or something else?