So, I have a WireGuard (responder?) on my VPS server that I want to use as a VPN. I want to set up my Mikrotik to wrap all traffic from/to connected devices with WireGuard.
I have created a config file on my VPS server:
[Interface]
PrivateKey = XXX
Address = 10.66.66.6/32,fd42:42:42::6/128
DNS = 8.8.8.8,8.8.4.4
[Peer]
PublicKey = XXX
PresharedKey = XXX
Endpoint = <VPS Server IP>:62785
AllowedIPs = 0.0.0.0/0,::/0
It works just fine on official WireGuard clients.
Here is my Mikrotik config:
# 2024-06-05 16:48:39 by RouterOS 7.15
# software id = P7DF-AID8
#
# model = RB952Ui-5ac2nD
# serial number = CC460E042B5D
/interface bridge
add admin-mac=2C:C8:1B:1D:E7:03 auto-mac=no comment=defconf name=bridge port-cost-mode=short
/interface wireguard
add listen-port=61712 mtu=1420 name=wireguard-interface
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge lease-time=10m name=defconf
/ip smb users
set [ find default=yes ] disabled=yes
/interface bridge port
add bridge=bridge comment=defconf interface=ether2 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether3 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether4 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether5 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=wlan1 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=wlan2 internal-path-cost=10 path-cost=10
/ip firewall connection tracking
set udp-timeout=10s
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ipv6 settings
set disable-ipv6=yes
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=wireguard-interface list=WAN
/interface wireguard peers
add allowed-address=0.0.0.0/0,::/0 endpoint-address=<VPS Server IP> endpoint-port=62785 interface=wireguard-interface name=peer1 preshared-key=XXX public-key=XXX
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
add address=10.66.66.6 comment="WireGuard Network" interface=wireguard-interface network=10.66.66.0
/ip dhcp-client
add comment=defconf interface=ether1 use-peer-dns=no
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8,8.8.4.4 use-doh-server=https://1.1.1.1/dns-query verify-doh-cert=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=passthrough chain=input disabled=yes log=yes
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/1 gateway=wireguard-interface pref-src=0.0.0.0 routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=128.0.0.0/1 gateway=wireguard-interface pref-src=0.0.0.0 routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=<VPS Server IP>/32 gateway=ether1 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
This Mikrotik device is behind another Mikrotik which hooked up directly to my ISP (static, non-NAT IP).
I can provide its config too if necessary, but there’s a lot of private info to edit out, so, by request.
This time WireGuard config was imported via “WG Import” function, so I expect it to be 100% correct.
I see this in log:
wireguard-interface: [peer1] : Handshake for peer did not complete after 5 seconds, retrying (try 2)
And also a lot of these (from firewall’s logged input chain):
input: in:bridge out:(unknown 0), connection-state:new src-mac 64:70:02:c6:f6:04, proto UDP, 192.168.88.254:51903->192.168.88.255:20561, len 50
I cant even see any packets with in firewall’s log.
What am I missing here?