Hi, Actually, I've hacked the wireguard source code by myself months ago, and it's working as expected on openwrt with mwan3. See details and the last hack patch on my github issue: https://github.com/openwrt/packages/issues/9538 As I said on the issue, the problem is wireguard always reset the incoming ip and ipmark, and then select the source ip from main routing table.
Janne Johansson <icepic...@gmail.com> 于2022年10月21日周五 21:27写道: > > > "How should wireguard know which IP is the correct source IP address?" > > > > I digged into the source code but couldn't find the part where the > > source-IP is selected for outgoing connections (like a simple ping). > > I am not a developer but would like to try to understand it. Could someone > > give me a pointer? > > I think it is left to the OS and it's tcp stack to pick the ip (and > interface) based on the UDP destination ip and the current routing > table when sending udp packets. > > -- > May the most significant bit of your life be positive.