Trying to set up Wireguard access from my phone, and followed the instructions here: https://help.mikrotik.com/docs/display/ROS/WireGuard
iOS wg client stuck in loop sending handshake. On the router side, I can see packets hitting input accept firewall rule, but nothing else happens. Wireguard peers show 0 trafic, and no handshake time.
As a first step I'd like to see just handshake completing, will worry about local access or going out to the internet next.
Logs show (where y.y.y.y is external IP)
Code: Select all
wgfw input: in:pppoe-out1 out:(unknown 0), connection-state:new src-mac xx:xx:xx:xx:xx:xx, proto UDP, x.x.x.x:3095->y.y.y.y:13231, len 176
Code: Select all
# oct/16/2022 07:36:16 by RouterOS 7.5
# software id = VC32-0YFP
#
# model = RB5009UG+S+
# serial number = XXX
/interface bridge
add admin-mac=xx:xx:xx:xx:xx:xx auto-mac=no igmp-snooping=yes \
multicast-querier=yes name=bridge protocol-mode=mstp vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] comment="PPP uplink"
set [ find default-name=ether2 ] comment=wired
set [ find default-name=ether3 ] comment=wifi
set [ find default-name=ether4 ] comment=services
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 keepalive-timeout=\
disabled name=pppoe-out1 use-peer-dns=yes user=xxx
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguard1
/interface vlan
add comment="wired - clients" interface=bridge name=vlan10 vlan-id=10
add comment="wifi - clients" interface=bridge name=vlan11 vlan-id=11
add comment="wifi - guest" interface=bridge name=vlan12 vlan-id=12
add comment=jail interface=bridge name=vlan13 vlan-id=13
add comment=service interface=bridge name=vlan14 vlan-id=14
add comment="podman containers" interface=bridge name=vlan15 vlan-id=15
add comment=management interface=bridge name=vlan99 vlan-id=99
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
add name=wired-clients ranges=10.4.10.100-10.4.10.250
add name=wifi-clients ranges=10.4.11.100-10.4.11.250
add name=management ranges=10.4.99.100-10.4.99.250
add name=wifi-guest ranges=10.4.12.100-10.4.12.250
add name=services ranges=10.4.14.100-10.4.14.250
add name=podman ranges=10.4.15.10-10.4.15.30
add name=jail ranges=10.4.13.100-10.4.13.250
/ip dhcp-server
add address-pool=wired-clients interface=vlan10 lease-time=3h name=\
wired-clients
add address-pool=wifi-clients interface=vlan11 lease-time=23h59m59s name=\
wifi-clients
add address-pool=management interface=vlan99 name=management
add address-pool=wifi-guest interface=vlan12 lease-time=3h name=wifi-guest
add address-pool=services interface=vlan14 lease-time=3h name=services
add address-pool=podman interface=vlan15 lease-time=12h name=podman
add address-pool=jail interface=vlan13 lease-time=3h name=jail
/interface bridge port
add bridge=bridge comment="wired clients" frame-types=admit-only-vlan-tagged \
interface=ether2
add bridge=bridge comment=wifi frame-types=admit-only-vlan-tagged interface=\
ether3
add bridge=bridge comment=management frame-types=\
admit-only-untagged-and-priority-tagged interface=ether8 pvid=99
add bridge=bridge comment=services frame-types=admit-only-vlan-tagged \
interface=ether4
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface bridge vlan
add bridge=bridge comment="wired clients" tagged=bridge,ether2,ether3 \
vlan-ids=10
add bridge=bridge comment="wifi clients" tagged=ether3,ether2,bridge \
vlan-ids=11
add bridge=bridge comment=management tagged=ether2,bridge untagged=ether8 \
vlan-ids=99
add bridge=bridge comment="wifi guest" tagged=ether3,bridge,ether2 vlan-ids=\
12
add bridge=bridge comment=services tagged=ether4,bridge vlan-ids=14
add bridge=bridge comment="podman containers" tagged=bridge,ether4 vlan-ids=\
15
add bridge=bridge comment=jail tagged=ether4,bridge vlan-ids=13
/interface list member
add interface=bridge list=LAN
add interface=pppoe-out1 list=WAN
add interface=vlan10 list=LAN
add interface=vlan11 list=LAN
add interface=vlan99 list=LAN
add interface=vlan14 list=LAN
add disabled=yes interface=vlan12 list=LAN
add disabled=yes interface=vlan13 list=LAN
add interface=vlan15 list=LAN
add interface=wireguard1 list=LAN
/interface wireguard peers
add allowed-address=0.0.0.0/0 comment=xxx endpoint-address="" interface=\
wireguard1 public-key="bMZ<...>"
/ip address
add address=192.168.88.1/24 interface=bridge network=192.168.88.0
add address=10.4.10.1/24 comment="wired - clients" interface=vlan10 network=\
10.4.10.0
add address=10.4.11.1/24 comment="wifi - clients" interface=vlan11 network=\
10.4.11.0
add address=10.4.99.1/24 comment=management interface=vlan99 network=\
10.4.99.0
add address=10.4.12.1/24 comment="wifi - guest" interface=vlan12 network=\
10.4.12.0
add address=10.4.13.1/24 comment=jail interface=vlan13 network=10.4.13.0
add address=10.4.14.1/24 comment=services interface=vlan14 network=10.4.14.0
add address=10.4.15.1/24 comment="podman containers" interface=vlan15 \
network=10.4.15.0
add address=10.4.200.1/24 interface=wireguard1 network=10.4.200.0
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=10.4.10.0/24 dns-server=10.4.15.33 domain=some.domain gateway=\
10.4.10.1 netmask=24
add address=10.4.11.0/24 dns-server=10.4.15.33 domain=some.domain gateway=\
10.4.11.1 netmask=24
add address=10.4.12.0/24 dns-server=1.1.1.1 gateway=10.4.12.1 netmask=24
add address=10.4.13.0/24 dns-server=10.4.15.33 domain=some.domain gateway=\
10.4.13.1 netmask=24
add address=10.4.14.0/24 dns-server=1.1.1.1 gateway=10.4.14.1 netmask=24
add address=10.4.15.0/24 dns-server=1.1.1.1 gateway=10.4.15.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=wireguard dst-port=13231 log=yes \
log-prefix=wgfw protocol=udp
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 port=25565 protocol=tcp
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 log-prefix=FW_
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 dst-port=25565 protocol=tcp to-addresses=\
10.4.15.43 to-ports=25565
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 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 ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
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 packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
/system clock
set time-zone-name=Europe/London
/system logging
add prefix=wg topics=wireguard
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Code: Select all
[Interface]
PrivateKey = GKc<...>
Address = 10.4.200.2/32
DNS = 1.1.1.1
[Peer]
PublicKey = 50j<...>
AllowedIPs = 0.0.0.0/0
Endpoint = x.x.x.x:13231
PersistentKeepalive = 5