I have a working MikroTik environment with two WireGuard interfaces: one for users to access internal resources and one for the router to connect to a remote VPS with its own WireGuard server. The use case for the second interface is to route all traffic from the LAN bound for specific IP addresses, which are defined in an address list. The problem is no traffic past the handshake is being routed to the remote host.
This is the WireGuard setup in the MikroTik router:
/interface wireguard
add disabled=no listen-port=55667 mtu=1420 name=linode private-key="privateKey"
/interface wireguard peers
add allowed-address=0.0.0.0/0,::/0 disabled=no endpoint-address=addressOfVPS endpoint-port=51001 interface=linode persistent-keepalive=30s preshared-key="presharedKey" public-key="publicKey"
I have a routing table and route configured for it:
/ip route
add dst-address=0.0.0.0/0 gateway=linode routing-table=to_vpn
/ipv6 route
add dst-address=::/0 gateway=linode routing-table=to_vpn
/routing table
add fib name=to_vpn
I also have IP addresses assigned:
/ip address
add address=10.0.0.2/30 disabled=no interface=linode network=10.0.0.0
/ipv6 address
add address=fdc9:281f:4d7:9ee9::3/128 advertise=no auto-link-local=yes disabled=no eui-64=no interface=linode no-dad=no
Finally, I set up firewall rules to allow traffic and NAT:
/ip firewall filter
add action=accept chain=forward comment="For Linode VPN" in-interface-list=VLAN out-interface=linode
/ip firewall mangle
add action=mark-connection chain=prerouting connection-state=new dst-address-list=route_to_vpn in-interface-list=VLAN new-connection-mark=to_vpn passthrough=yes
add action=mark-routing chain=prerouting connection-mark=to_vpn in-interface-list=VLAN new-routing-mark=to_vpn passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat connection-mark=to_vpn disabled=no out-interface=linode
/ipv6 firewall filter
add action=accept chain=forward comment="For Linode VPN" in-interface-list=VLAN out-interface=linode
/ipv6 firewall nat
add action=masquerade chain=srcnat connection-mark=to_vpn out-interface=linode !to-address !to-ports
However, I can’t get any traffic to pass over this connection. I have an address list named route_to_vpn under /ipv6 firewall and /ip firewall, and each has a domain name that was auto-resolved to two IP addresses. Even using ping, I couldn’t get traffic to pass over this connection:
/ping target.invalid%linode count=4
SEQ HOST SIZE TTL TIME STATUS
0 ipAddress timeout
1 ipAddress timeout
2 ipAddress timeout
3 ipAddress timeout
sent=4 received=0 packet-loss=100%
However, using /ping with the WAN interface works just fine. WireGuard on the VPS side shows the handshake is complete and that the keepalive messages are being received. However, I used netcat to listen on the VPN port and saw absolutely no traffic when I ran ping.
I’m certain I’ve overlooked something silly, and I would appreciate help finding it. If I need to post my full config, then please let me know. Also, if you know a simpler way to do this task, then I would appreciate any insight.