trombik / esp_wireguard

WireGuard Implementation for ESP-IDF.
Other
193 stars 34 forks source link

[RFC] Pick underlying UDP egress interface based on routing priority #46

Open TobleMiner opened 9 months ago

TobleMiner commented 9 months ago

By now there are many ways available in which an ESP can be connected to IP networks. Notably wired Ethernet and PPP as used for cellular connections are quite popular. Adjust UDP egress interface selection to pick from all available netifs based on their routing priority. This ensures all types of IP interfaces can be used.

Possibly the logic here can still be improved quite a bit. I.e. when there is a remote endpoint in a network locally attached to one of the netifs. Possibly it would even make sense to react to interface up/down (STA/Ethernet connect) and IP address change (GOT_IP/LOST_OP) event and reevaluate the choice of interface then. I think I would also like to see a config option to override the lower layer interface used in the config struct. esp-idf provides a great deal of options for traffic steering and seeing those reflected here would be awesome.

If anyone is interested I might look into those options :)