I have searched and read through several different posts in this forum about the same issue, but none of them seem to apply in my case?
Background: Lightning took out my router, which I had a working wireguard config on, but (silly me!) I didn’t have a recent backup of my config which included the wireguard config. So I have had to rebuild it from scratch. In other words. I’m reasonably confident this is something I have done wrong, and would love some help spotting it!
Currently, either peer will work, but whichever peer connects first is the ONLY peer that will ever work, until I disable/reenable one of the peers or otherwise make some config change. At that point, again, whichever peer connects first will work, any additional peers will show a successful handshake, but no additional traffic will pass.
At this point, I have stripped it down to two peers, a phone and a laptop. Full config can be posted if needed, but for now will stick to relevant pieces.
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguard
then
/ip address
add address=172.16.10.1/24 interface=wireguard network=172.16.10.0
Now peers (Full disclosure, there is a preshared key also. I have verified it is correct on all peers and in the mikrotik):
/interface wireguard peers
add allowed-address=172.16.10.101/24 comment="Joel Laptop" interface=wireguard public-key="JLlbaJuKwJpCZrkjSyz6TU9AHHiQolE5MhNettC0ISI="
add allowed-address=172.16.10.100/24 comment="Joel iPhone" interface=wireguard public-key="QzMlYHGmpiHlS4ol44rPkhxYsm5uO8WWwTOIsTylKyE="
And a print detail for the peers (redacted sensitive info):
[jjoelc@JJC-Router] > interface/wireguard/peers/print detail
Flags: X - disabled
0 ;;; Joel Laptop
interface=wireguard public-key="JLlbaJuKwJpCZrkjSyz6TU9AHHiQolE5MhNettC0ISI=" endpoint-address="" endpoint-port=0 current-endpoint-address=166.137.106.252
current-endpoint-port=1551 allowed-address=172.16.10.101/24 preshared-key="<snip>" rx=296 tx=824 last-handshake=1h57m3s
1 ;;; Joel's iPhone
interface=wireguard public-key="QzMlYHGmpiHlS4ol44rPkhxYsm5uO8WWwTOIsTylKyE=" endpoint-address="" endpoint-port=0 current-endpoint-address="" current-endpoint-port=0
allowed-address=172.16.10.100/24 preshared-key="<snip>" rx=0 tx=34.0KiB
and Firewall:
/ip firewall filter
add action=accept chain=input comment="Allow Wireguard" dst-address=76.255.235.9 dst-port=13231 protocol=udp
add action=accept chain=forward dst-address-list=local in-interface=wireguard
add action=accept chain=forward out-interface=wireguard src-address-list=local
Route is in place:
[jjoelc@JJC-Router] > ip/route/print
Flags: D - DYNAMIC; A - ACTIVE; c, s, y - BGP-MPLS-VPN; + - ECMP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
0 As 0.0.0.0/0 76.255.235.14 1
<snip>
DAc 172.16.10.0/24 wireguard 0
<snip>
Based on other posts, I have tried seen the issues with endpointaddress=“” listings in the config. As seen above the listing does not appear in an export, but does show when you do a print. If one of the peers is connected when you do the print, the peer’s public IP is listed in that field. Once the peer is disconnected the print shows the empty field again, so I kind of have to assume this is the expected behavior.
As stated, If both peers are disconnected, I can just disable/reenable either of the peers, or make any other config change to either peer. And whichever peer connects first works, the other does not. I really need more than one per at a time connected though!
Thanks in advance for any and all advice!