Score:0

Make WireGuard server accessible via multiple interfaces

sh flag

I have a Raspberry Pi running WireGuard listening on port 51820. The Pi is connected to the my router via eth0 (192.168.1.51) and wlan0 (192.168.1.50), with the eth0 route having higher priority. My router forwards port 8880 to 192.168.1.51:51820 and port 8881 to 192.168.1.50:51820.

I can connect to WireGuard via port 8880, but when trying to connect via 8881 the handshake doesn't complete. I can see from WireGuard's debug logs that it attempts to respond to the incoming connection, the problem is that it responds via eth0, and the datagram doesn't get delivered (I assume due to NAT assigning a different src port to the outgoing datagram).

If I add a static route (on the server) for my client's IP address via wlan0 then I can connect without a problem, but is there any way to make WireGuard respond using the interface on which the connection is initiated, instead of the default route?

If not, can I create a new WireGuard interface that only uses wlan0?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.