Dear MikroTik-Forum,
Since yesterday I try to get my MikroTik Router to work as a WireguardPeer.
Setup:
RaspberryPi (Wireguard Server via PiVPN) ↔ Router ISP ↔ MikroTik Router (Wireguard Peer) ↔ Local Network
|_______________ Network 1 _______| | Network 2 _________________|
Connecting from other Wireguard-Peers outside of Network 1 to the Wireguard-Server works fine.
Problem:
I configured my MikroTik Router (RouterOS 7.1.1) and the Handshake to the Wireguard-Server is successfull.
wg show
on the Wireguard-Server shows a latest Handshake which is updatet every 1-2 minutes.
But when I try to ping my Wiregurd-Server from the MikroTik Router I will get a timeout.
This is the Wiregurd-Server peer config:
[Interface]
PrivateKey = ******
Address = 10.6.0.5/24
DNS = 9.9.9.9, 149.112.112.112
[Peer]
PublicKey = ******
PresharedKey = ******
Endpoint = ******:6969
AllowedIPs = 0.0.0.0/0, ::0/0
This is my MikroTik config:
feb/01/2022 10:09:25 by RouterOS 7.1.1
[code] model = RBD53iG-5HacD2HnD
/interface bridge
add admin-mac=******* comment=defconf name=bridge
/interface wireguard
add listen-port=13231 name=Wireguard
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface lte apn
set [ find default=yes ] ip-type=ipv4
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk mode=dynamic-keys name=W-LAN_PASS \
supplicant-identity=MikroTik
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX \
distance=indoors frequency=auto installation=indoor mode=ap-bridge name=\
wifi2 security-profile=W-LAN_PASS ssid=******* \
wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=\
20/40/80mhz-eeCe distance=indoors frequency=auto installation=indoor \
mode=ap-bridge name=wifi5 security-profile=W-LAN_PASS ssid=\
******* wireless-protocol=802.11
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp disabled=yes interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf ingress-filtering=no interface=ether2
add bridge=bridge comment=defconf ingress-filtering=no interface=ether3
add bridge=bridge comment=defconf ingress-filtering=no interface=ether4
add bridge=bridge comment=defconf ingress-filtering=no interface=ether5
add bridge=bridge comment=defconf ingress-filtering=no interface=wifi2
add bridge=bridge comment=defconf ingress-filtering=no interface=wifi5
/ip firewall connection tracking
set enabled=yes
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface wireguard peers
add allowed-address=0.0.0.0/0 endpoint-address=******* endpoint-port=\
6969 interface=Wireguard persistent-keepalive=10s public-key=\
"*******"
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
192.168.88.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 gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes cache-max-ttl=1d servers=192.168.88.112
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat comment=SSH dst-port=1124 in-interface-list=\
WAN protocol=tcp to-addresses=192.168.88.112 to-ports=22
add action=dst-nat chain=dstnat comment="Webserver HTTP" dst-port=80 \
in-interface-list=WAN protocol=tcp to-addresses=192.168.88.112 to-ports=\
80
add action=dst-nat chain=dstnat comment="Webserver HTTPS" dst-port=443 \
in-interface-list=WAN protocol=tcp to-addresses=192.168.88.112 to-ports=\
443
add action=dst-nat chain=dstnat comment=OpenVPN dst-port=1126 in-interface=\
*FFFFFFFE in-interface-list=WAN protocol=udp to-addresses=192.168.88.112 \
to-ports=1126
/ip service
set www port=8080
/ip socks
set auth-method=password version=5
/system clock
set time-zone-name=Europe/Berlin
/system identity
set name=*******
/system routerboard settings
set cpu-frequency=auto
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Thanks for your help!
Cheers.