I have a Mikrotik Hap2 which I’m trying to configure as a Wireguard server. My intention is to be able to access the devices connected over LAN with this router from outside of my house. The Mikrotik Hap2 is behind a public facing ISP provided router on the same subnet. The ISP facing router is port forwarded to the WG-Server with the port 51820.
The issue I’m having is that one wireguard peer can successfully connect to the wireguard server using my mobile 4G hotspot. But when connecting from a separate premise over wifi the same peer connects to wireguard but fails to ping the router/vice versa. A separate peer also has the same issue, managing to communicate to establish the wireguard connection. But unable to ping the router/vice versa from this location over ethernet.
All details/IP’s have been changed.
WG-Server
- 192.168.80.1
I have 2 Wireguard clients setup Peer 1 and Peer 2.
- Peer 1 192.168.80.2
- Peer 2 192.168.80.3
Peer 1 is connecting to the internet and Wireguard tunnel over 4G provided over hotspot from my phone. This device successfully connects to WG-Server and each can ping one another.
Peer 2 is connecting to the internet and Wireguard tunnel over ISP provided internet to the premises (separate premesis/public IP address to WG-Server). This device connects successfully to the WG-Server but neither device can ping one another.
Mikrotik Server Config in relation to Wireguard
/interface wireguard
add listen-port=51820 mtu=1300 name=wireguard1
/interface wireguard peers
add allowed-address=0.0.0.0/0 comment="Peer 2" interface=wireguard1 \
public-key=####
add allowed-address=0.0.0.0/0 comment="Peer 1" interface=wireguard1 \
public-key=####
/ip address
add address=192.168.25.1/24 interface=ether1 network=192.168.25.0
add address=192.168.80.1/24 interface=wireguard1 network=192.168.80.0
/ip firewall filter
add action=accept chain=input comment="ICMP Allow" protocol=icmp
add action=accept chain=input comment="Wireguard Port" dst-port=51820 \
in-interface=wlan1 log=yes log-prefix="WIREGUARD " protocol=udp
Peer 1 Wireguard Config
[Interface]
PrivateKey = ####
Address = 192.168.80.2/24
DNS = 1.1.1.1
MTU = 1300
[Peer]
PublicKey = ####
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = ####:51820
PersistentKeepalive = 60
Peer 2 Wireguard Config
[Interface]
PrivateKey = ####
ListenPort = 51820
Address = 192.168.80.3/24
DNS = 1.1.1.1
MTU = 1300
[Peer]
PublicKey = ####
AllowedIPs = 0.0.0.0/0
Endpoint = ####:51820
PersistentKeepalive = 60
