Just starting with WireGuard, to replace ages-old, rock-solid reliable, but slow-as-**** SSTP.
Two MikroTik RouteROS 7.23 devices, "MikroTik4" (WireGuard responder), and "MikroTik3B" (WireGuard client).
On MikroTik4:
[admin@MikroTik4.felines.org] > /interface/wireguard/print detail
Flags: X - DISABLED; R - RUNNING
0 R name="wg1" mtu=1420 listen-port=56106 public-key="....."[admin@MikroTik4.felines.org] > /interface/wireguard/peers/print detail
Flags: X - DISABLED; D - DYNAMIC
0 interface=wg1 name="MikroTik3BWG" public-key="....." endpoint-address="" endpoint-port=0 current-endpoint-address=95.33.x.x current-endpoint-port=59366
allowed-address=192.168.251.0/24 persistent-keepalive=30s client-endpoint="" client-allowed-address=::/0 responder=yes rx=44.4MiB tx=81.1MiB last-handshake=57s[admin@MikroTik4.felines.org] > /ip addr print
Flags: D - DYNAMIC; S - SLAVE
Columns: ADDRESS, NETWORK, INTERFACE, VRF
;;; defconf
0 S 192.168.255.5/26 192.168.255.0 ether2 main
1 192.168.255.124/26 192.168.255.64 bridge main
2 D 192.168.255.54/32 192.168.255.55 <sstp-mikrotik3.local> main
3 D 192.168.255.52/32 192.168.255.53 <sstp-mikrotik2.local> main
;;; MikroTik4WG-MikroTik3B
4 192.168.255.140/26 192.168.255.128 wg1 main[admin@MikroTik4.felines.org] > /ip route/print
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, s - STATIC, v - VPN
Columns: DST-ADDRESS, GATEWAY, ROUTING-TABLE, DISTANCE0 As 0.0.0.0/0 192.168.255.7 main 1
DAv 10.0.0.0/24 192.168.255.55 main 3
1 As 192.168.251.0/24 wg1 main 1
DAv 192.168.253.0/24 192.168.255.55 main 2
DAv 192.168.254.0/24 192.168.255.53 main 3
DAc 192.168.255.0/26 bridge main 0
DAc 192.168.255.53/32 <sstp-mikrotik2.local> main 0
DAc 192.168.255.55/32 <sstp-mikrotik3.local> main 0
DAc 192.168.255.64/26 bridge main 0
DAc 192.168.255.128/26 wg1 main 0
On MikroTik3B:
[admin@MikroTik3B] > /interface/wireguard/print detail
Flags: X - DISABLED; R - RUNNING
0 R name="wg1" mtu=1420 listen-port=59366 public-key="....."[admin@MikroTik3B] > /interface/wireguard/peers/print detail
Flags: X - DISABLED; D - DYNAMIC
0 interface=wg1 name="MikroTik4WG" public-key="....."
endpoint-address=something.felines.org endpoint-port=56106 current-endpoint-address=33.40.90.106
current-endpoint-port=56106 allowed-address=0.0.0.0/0 persistent-keepalive=30s client-endpoint=""
client-allowed-address=::/0 rx=26.1MiB tx=2381.9KiB last-handshake=1m42sadmin@MikroTik3B] > /ip address/print
Flags: X - DISABLED; S - SLAVE
Columns: ADDRESS, NETWORK, INTERFACE, VRF
;;; defconf
0 X 192.168.88.1/24 192.168.88.0 bridge main
1 S 192.168.251.3/24 192.168.251.0 WiFi2 main
2 192.168.178.201/24 192.168.178.0 ether1 main
;;; MikroTik3BWG-MikroTik4
3 192.168.255.141/26 192.168.255.128 wg1 main[admin@MikroTik3B.felines.org] > /ip route/print
Flags: D - DYNAMIC; X - DISABLED, I - INACTIVE, A - ACTIVE; c - CONNECT, s - STATIC
Columns: DST-ADDRESS, GATEWAY, ROUTING-TABLE, DISTANCE0 Xs 192.168.255.0/26 sstp-out1 2
1 As 0.0.0.0/0 192.168.178.1 main 1
DAc 192.168.178.0/24 ether1 main 0
DAc 192.168.251.0/24 bridge main 0
2 Is 192.168.254.0/24 sstp-out1 main 3
3 As 192.168.255.0/26 192.168.255.140 main 1
DAc 192.168.255.128/26 wg1 main 0
A client on MikroTik3B's wireless network, with an IP address provided by MikroTik3B's DHCP server, 192.168.251.139/24, with default route via MikroTik3B (192.168.251.3), can traceroute through MikroTik3B, over the MikroTik3B-MikroTik4 WireGuard VPN, to a hote on MikroTik4's local 192.168.255.0/26 LAN:
C:>tracert -d 192.168.255.37
Tracing route to 192.168.255.37 over a maximum of 30 hops
1 3 ms 1 ms 1 ms 192.168.251.3
2 52 ms 51 ms 52 ms 192.168.255.140
3 52 ms 51 ms 51 ms 192.168.255.37Trace complete.
And, while the above trace is going on, sniffer output on MikroTik4 shows the traffic going through:
77.796 wg1 192.168.251.139 192.168.255.37 icmp 92 0
77.796 wg1 192.168.255.140 192.168.251.139 icmp 120 0
77.849 wg1 192.168.251.139 192.168.255.37 icmp 92 0
77.849 wg1 192.168.255.140 192.168.251.139 icmp 120 0
77.905 wg1 192.168.251.139 192.168.255.37 icmp 92 0
77.905 wg1 192.168.255.140 192.168.251.139 icmp 120 0
78.912 wg1 192.168.251.139 192.168.255.37 icmp 92 0
78.912 wg1 192.168.255.37 192.168.251.139 icmp 92 1
78.965 wg1 192.168.251.139 192.168.255.37 icmp 92 0
78.966 wg1 192.168.255.37 192.168.251.139 icmp 92 1
79.02 wg1 192.168.251.139 192.168.255.37 icmp 92 0
79.02 wg1 192.168.255.37 192.168.251.139 icmp 92 1
So, we know that the WireGuard tunnel is working, and that MikroTik4 can see MikroTik3B's WireGuard IP address.
But MikroTik3B cannot ping MikroTik4, neither on its LAN IP 192.168.255.5 nor its WireGuard IP 192.168.255.140, nor can MikroTik3B ping the same host on the LAN on the other side of MikroTik4 that we successfully tracerouted just above:
[admin@MikroTik3B] /tool/sniffer> /ping 192.168.255.5
SEQ HOST SIZE TTL TIME STATUS
0 192.168.255.5 timeout
sent=1 received=0 packet-loss=100%[admin@MikroTik3B] /tool/sniffer> /ping 192.168.255.37
SEQ HOST SIZE TTL TIME STATUS
0 192.168.255.37 timeout
sent=1 received=0 packet-loss=100%[admin@MikroTik3B] /tool/sniffer> /ping 192.168.255.140
SEQ HOST SIZE TTL TIME STATUS
0 192.168.255.140 timeout
sent=1 received=0 packet-loss=100%
.. even though we do see the ping packets going out the wg1 interface on MikroTik3B (from sniffer):
[admin@MikroTik3B] /tool/sniffer> pack print
Columns: TIME, INTERFACE, SRC-ADDRESS, DST-ADDRESS, IP-PROTOCOL, SIZE, CPU
0 2.946 wg1 192.168.255.141 192.168.255.140 icmp 56 1
1 3.949 wg1 192.168.255.141 192.168.255.140 icmp 56 0
2 4.952 wg1 192.168.255.141 192.168.255.140 icmp 56 0
On MikroTik4, sniffing, we do NOT see packets coming in:
[admin@MikroTik4.felines.org] /tool/sniffer> print
only-headers: no
memory-limit: 100KiB
memory-scroll: yes
file-name:
file-limit: 1000KiB
streaming-enabled: no
streaming-server: 0.0.0.0:37008
max-packet-size: 2048
filter-stream: no
filter-interface: wg1
filter-mac-address:
filter-src-mac-address:
filter-dst-mac-address:
filter-mac-protocol:
filter-ip-address:
filter-src-ip-address:
filter-dst-ip-address:
filter-ipv6-address:
filter-src-ipv6-address:
filter-dst-ipv6-address:
filter-ip-protocol:
filter-port: !winbox
filter-src-port:
filter-dst-port:
filter-vlan:
filter-cpu:
filter-size:
filter-direction: any
filter-operator-between-entries: and
quick-rows: 20
quick-show-frame: no
running: yes[admin@MikroTik4.felines.org] /tool/sniffer> pack print follow
TIME INTERFACE SRC-ADDRESS DST-ADDRESS IP-PROTOCOL SIZE CPU[ no output ] ^C
(I've tried a wide variety of sniffer configurations, "anything on wg1", "anything from ", and others; nothing ever appears in the sniffer output on MikroTik4).
I don't think it's firewall filter or NAT rules:
[admin@MikroTik4.felines.org] /ip/firewall/filter> print
Flags: X - DISABLED, I - INVALID; D - DYNAMIC
0 D ;;; special dummy rule to show fasttrack counters
chain=forward action=passthrough1 ;;; defconf: accept established,related,untracked
chain=input action=accept connection-state=established,related,untracked2 ;;; defconf: accept to local loopback (for CAPsMAN)
chain=input action=accept dst-address=127.0.0.13 ;;; Allow Felines internal networks to access this MikroTik
chain=input action=accept src-address-list=FelinesVPNnets log=no log-prefix=""7 ;;; Accept WireGuard
chain=input action=accept protocol=udp dst-address=192.168.255.5 in-interface=bridge dst-port=56106 log=yes log-prefix="wg1"12 ;;; Drop all other attempts to talk directly to this MikroTik itself
chain=input action=drop log=no log-prefix=""13 ;;; defconf: drop invalid
chain=input action=drop connection-state=invalid14 ;;; defconf: accept ICMP
chain=input action=accept protocol=icmp15 ;;; defconf: drop all not coming from LAN
chain=input action=drop in-interface-list=!LAN18 ;;; defconf: fasttrack
chain=forward action=fasttrack-connection connection-state=established,related19 ;;; defconf: accept established,related, untracked
chain=forward action=accept connection-state=established,related,untracked20 ;;; defconf: drop invalid
chain=forward action=drop connection-state=invalid21 ;;; defconf: drop all from WAN not DSTNATed
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface-list=WAN
The chain=input action=accept rule #3 allowing src-address-list=FelinesVPNnets includes both MikroTik3B's LAN 192.168.251.0/24 and all of MikroTik4's 192.168.255.0, .64, and .128 /26 nets.
Is there some limitation of the RouterOS WireGuard implementation that makes the participating MikroTiks themselves unable to ping or traceroute each other via WireGuard tunnels? Or have I got the configuration mostly right, but some small part is wrong which allows the networks on both sides of the two MikroTiks to communicate successfully over the WireGuard tunnel, but blocks the MikroTiks themselves from talking with each other?
thank you,