I did the tests without the wireguard client to enphasize the error does not seem related to the wireguard client configuration. It happens based on the ip packet source address. If i ping any node on subnet 172.16.0.0/20 from the RB450 terminal window they all work. Only when I specify the source address as being 192.168.32.1 attributed to the wireguard1 interface the problem occurs.
-
ping 172.16.8.1 - OK
-
ping 172.16.8.1 src-address=192.168.32.1 - TIMEOUT
Please find below both the wireguard client configuration and the RB450 export configuration.
Wireguard Windows 10 Client config
[Interface]
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXX
Address = 192.168.32.2/24
DNS = 192.168.0.100
[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 192.168.32.0/24, 192.168.0.0/24, 172.16.0.0/20
Endpoint = d4500d85ddc1.sn.mynetname.net:13231
PersistentKeepalive = 10
RB450 export configuration
oct/20/2022 16:50:59 by RouterOS 7.6
software id = JTLI-04BH
model = RB760iGS
serial number = D4500D85DDC1
/interface ethernet set [ find default-name=ether1 ] advertise=1000M-half,1000M-full comment=“adm LAN” disabled=yes loop-protect=on
/interface ethernet set [ find default-name=ether2 ] disabled=yes
/interface ethernet set [ find default-name=ether3 ] advertise=1000M-half,1000M-full comment=“wan - Oi Fiber” name=ether3-Oi
/interface ethernet set [ find default-name=ether4 ] disabled=yes
/interface ethernet set [ find default-name=ether5 ] advertise=1000M-half,1000M-full comment=“gpon LAN” name=ether5-gpon
/interface ethernet set [ find default-name=sfp1 ] disabled=yes
/interface wireguard add listen-port=13231 mtu=1420 name=wireguard1
/disk set sd1-part1 name=disk1
/interface list add comment=defconf name=WAN
/interface list add comment=defconf name=LAN
/interface list add name=“adm lan”
/interface list add name=“gpon lan”
/interface lte apn set [ find default=yes ] ip-type=ipv4 use-network-apn=no
/interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik
/port set 0 name=serial0
/routing bgp template set default disabled=no output.network=bgp-networks
/routing ospf instance add disabled=yes name=default-v2
/routing ospf area add disabled=yes instance=default-v2 name=backbone-v2
/snmp community set [ find default=yes ] name=apolom-ro
/system logging action set 0 memory-lines=2500
/system logging action set 1 disk-file-name=disk1/logs/log disk-lines-per-file=10000
/system logging action set 3 remote=172.16.0.50 src-address=172.16.15.254
/dude set data-directory=disk1/dude-data enabled=yes
/ip neighbor discovery-settings set discover-interface-list=none
/ip settings set rp-filter=strict
/ipv6 settings set max-neighbor-entries=8192
/interface detect-internet set internet-interface-list=WAN lan-interface-list=LAN wan-interface-list=WAN
/interface list member add comment=“gpon subnet” interface=ether5-gpon list=LAN
/interface list member add comment=“Oi Fibra” interface=ether3-Oi list=WAN
/interface list member add comment=“WG clients are LAN” interface=wireguard1 list=LAN
/interface wireguard peers add allowed-address=192.168.32.2/32 comment=“Lenovo PC” interface=wireguard1 public-key=“VpvXEZzZBCc3N0cXW/UcvO6v/nth0XIT/9wo4jGTTm8=”
/interface wireguard peers add allowed-address=192.168.32.3/32 interface=wireguard1 public-key=“RyzB8itPnzMiC3WEOEfsDUov2vS3Y6WPIfe1Gh9E3D4=”
/ip address add address=172.16.15.254/20 comment=“gpon subnet” interface=ether5-gpon network=172.16.0.0
/ip address add address=192.168.32.1/24 comment=“WireGuard subnet” interface=wireguard1 network=192.168.32.0
/ip cloud set ddns-enabled=yes
/ip dhcp-client add comment=“Oi Fibra” interface=ether3-Oi use-peer-dns=no use-peer-ntp=no
/ip dns set servers=192.168.0.100,192.168.0.101
/ip firewall address-list add address=192.168.0.100 comment=“Lista de servidores DNS da rede APOLOM” list=internal-DNS-Servers
/ip firewall address-list add address=192.168.0.101 comment=“Lista de servidores DNS da rede APOLOM” list=internal-DNS-Servers
/ip firewall address-list add address=192.168.0.128/28 comment=“Bloco de enderecos sem acesso \E0 Internet - rede adm - faixa de 192.168.0.128 a 192.168.0.143” list=Block-addresses
/ip firewall address-list add address=172.16.0.128/28 comment=“Bloco de enderecos sem acesso \E0 Internet - rede gpon - faixa de 172.16.0.128 a 172.16.0.143.” list=Block-addresses
/ip firewall filter add action=accept chain=input comment=“Allow Wireguard” dst-port=13231 protocol=udp
/ip firewall filter add action=drop chain=input comment=“Drop DNS requests from Internet - UDP” disabled=yes dst-port=53 in-interface-list=WAN protocol=udp
/ip firewall filter add action=drop chain=input comment=“Drop DNS requests from Internet - TCP” disabled=yes dst-port=53 in-interface-list=WAN protocol=tcp
/ip firewall filter add action=accept chain=input comment=“defconf: accept established,related,untracked” connection-state=established,related,untracked
/ip firewall filter add action=accept chain=input comment=“defconf: accept ICMP” protocol=icmp
/ip firewall filter add action=accept chain=input comment=“defconf: accept to local loopback (for CAPsMAN)” dst-address=127.0.0.1
/ip firewall filter add action=drop chain=input comment=“defconf: drop invalid” connection-state=invalid log-prefix=“INVALID - "
/ip firewall filter add action=drop chain=input comment=“defconf: drop all not coming from LAN” in-interface-list=!LAN log-prefix=“NOT LAN - "
/ip firewall filter add action=drop chain=forward comment=“Bloqueia acesso \E0 Internet para lista de enderecos bloqueados” dst-address-list=”” log-prefix=Blocked-IP-Address- out-interface-list=WAN src-address-list=Block-addresses
/ip firewall filter add action=accept chain=forward comment=“defconf: accept in ipsec policy” ipsec-policy=in,ipsec
/ip firewall filter add action=accept chain=forward comment=“defconf: accept out ipsec policy” ipsec-policy=out,ipsec
/ip firewall filter add action=accept chain=forward comment=“Allow DNS forwarder form internal DNS servers” disabled=yes dst-port=53 out-interface-list=WAN protocol=udp src-address-list=internal-DNS-servers
/ip firewall filter add action=accept chain=forward comment=“Allow DNS forwarder form internal DNS servers” disabled=yes dst-port=53 out-interface-list=WAN protocol=tcp src-address-list=internal-DNS-servers
/ip firewall filter add action=drop chain=forward comment=“Drop DNS traffic for everybody else” disabled=yes dst-port=53 out-interface-list=WAN protocol=udp
/ip firewall filter add action=drop chain=forward comment=“Drop DNS traffic for everybody else” disabled=yes dst-port=53 out-interface-list=WAN protocol=tcp
/ip firewall filter add action=fasttrack-connection chain=forward comment=“defconf: fasttrack” connection-state=established,related hw-offload=yes
/ip firewall filter add action=accept chain=forward comment=“defconf: accept established,related, untracked” connection-state=established,related,untracked
/ip firewall filter add action=drop chain=forward comment=“defconf: drop invalid” connection-state=invalid
/ip firewall filter add action=drop chain=forward comment=“defconf: drop all from WAN not DSTNATed” connection-nat-state=!dstnat connection-state=new in-interface-list=WAN log-prefix=“WAN not DSTNATed - "
/ip firewall nat add action=masquerade chain=srcnat comment=“defconf: masquerade” ipsec-policy=out,none out-interface-list=WAN
/ip firewall nat add action=dst-nat chain=dstnat comment=“Rule for SoftEther VPN Server” disabled=yes dst-address-type=local dst-port=5555 log=yes protocol=tcp to-addresses=172.16.0.20 to-ports=5555
/ip firewall nat add action=dst-nat chain=dstnat comment=“Rule for L2TP access” disabled=yes dst-port=500 log=yes protocol=udp to-addresses=172.16.0.20
/ip firewall nat add action=dst-nat chain=dstnat comment=“Rule for L2TP access” disabled=yes dst-port=4500 log=yes protocol=udp to-addresses=172.16.0.20
/ip route add disabled=no dst-address=192.168.0.0/24 gateway=172.16.0.1 routing-table=main suppress-hw-offload=no
/ip service set telnet disabled=yes
/ip service set ftp disabled=yes
/ip service set www disabled=yes
/ip service set ssh address=172.16.0.0/20,192.168.0.0/24,192.168.32.0/24
/ip service set www-ssl address=172.16.0.0/20,192.168.0.0/24,192.168.32.0/24 certificate=Webfig disabled=no
/ip service set api disabled=yes
/ip service set winbox address=172.16.0.0/20,192.168.0.0/24,192.168.32.0/24,127.0.0.1/32
/ip service set api-ssl disabled=yes
/ipv6 dhcp-client add add-default-route=yes interface=ether3-Oi pool-name=apolom-ipv6 request=address use-peer-dns=no
/ipv6 firewall address-list add address=::/128 comment=“defconf: unspecified address” list=bad_ipv6
/ipv6 firewall address-list add address=::1/128 comment=“defconf: lo” list=bad_ipv6
/ipv6 firewall address-list add address=fec0::/10 comment=“defconf: site-local” list=bad_ipv6
/ipv6 firewall address-list add address=::ffff:0.0.0.0/96 comment=“defconf: ipv4-mapped” list=bad_ipv6
/ipv6 firewall address-list add address=::/96 comment=“defconf: ipv4 compat” list=bad_ipv6
/ipv6 firewall address-list add address=100::/64 comment=“defconf: discard only " list=bad_ipv6
/ipv6 firewall address-list add address=2001:db8::/32 comment=“defconf: documentation” list=bad_ipv6
/ipv6 firewall address-list add address=2001:10::/28 comment=“defconf: ORCHID” list=bad_ipv6
/ipv6 firewall address-list 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
/ipv6 firewall filter add action=drop chain=input comment=“defconf: drop invalid” connection-state=invalid
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept ICMPv6” protocol=icmpv6
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept UDP traceroute” port=33434-33534 protocol=udp
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept DHCPv6-Client prefix delegation.” dst-port=546 protocol=udp src-address=fe80::/10
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept IKE” dst-port=500,4500 protocol=udp
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept ipsec AH” protocol=ipsec-ah
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept ipsec ESP” protocol=ipsec-esp
/ipv6 firewall filter add action=accept chain=input comment=“defconf: accept all that matches ipsec policy” ipsec-policy=in,ipsec
/ipv6 firewall filter add action=drop chain=input comment=“defconf: drop everything else not coming from LAN” in-interface-list=!LAN
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept established,related,untracked” connection-state=established,related,untracked
/ipv6 firewall filter add action=drop chain=forward comment=“defconf: drop invalid” connection-state=invalid
/ipv6 firewall filter add action=drop chain=forward comment=“defconf: drop packets with bad src ipv6” src-address-list=bad_ipv6
/ipv6 firewall filter add action=drop chain=forward comment=“defconf: drop packets with bad dst ipv6” dst-address-list=bad_ipv6
/ipv6 firewall filter add action=drop chain=forward comment=“defconf: rfc4890 drop hop-limit=1” hop-limit=equal:1 protocol=icmpv6
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept ICMPv6” protocol=icmpv6
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept HIP” protocol=139
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept IKE” dst-port=500,4500 protocol=udp
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept ipsec AH” protocol=ipsec-ah
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept ipsec ESP” protocol=ipsec-esp
/ipv6 firewall filter add action=accept chain=forward comment=“defconf: accept all that matches ipsec policy” ipsec-policy=in,ipsec
/ipv6 firewall filter add action=drop chain=forward comment=“defconf: drop everything else not coming from LAN” in-interface-list=!LAN
/snmp set contact=“Andr\E9 Muzi” enabled=yes location=“Control Room” trap-generators=interfaces trap-interfaces=all trap-version=2
/system clock set time-zone-name=America/Sao_Paulo
/system identity set name=bastion
/system logging add action=remote topics=error
/system logging add action=remote topics=critical
/system logging add action=remote topics=warning
/system logging add action=disk topics=error
/system note set note=”\r
\nThis system belongs to APOLOM and can be used by authorized users only.\r
\nIts use is monitored.\r
\n\r
\n”
/system ntp client set enabled=yes
/system ntp server set broadcast=yes enabled=yes manycast=yes
/system ntp client servers add address=0.br.pool.ntp.org
/system ntp client servers add address=1.br.pool.ntp.org
/system ntp client servers add address=2.br.pool.ntp.org
/system ntp client servers add address=3.br.pool.ntp.org
/system scheduler add comment=“Auto Restart schedule” interval=2w name=Reboot on-event=“system reboot” policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=sep/30/2022 start-time=22:30:00
/tool bandwidth-server set enabled=no
/tool e-mail set address=mail.nextin.com.br from=someone@somewhere.com port=587 tls=starttls user=someone@somewhere.com
/tool graphing interface add interface=ether1
/tool graphing interface add interface=ether3-Oi
/tool graphing interface add interface=ether5-gpon
/tool graphing queue add
/tool graphing resource add
/tool mac-server set allowed-interface-list=none
/tool mac-server mac-winbox set allowed-interface-list=none
/tool mac-server ping set enabled=no
/tool sniffer set filter-interface=ether3-Oi
/tool traffic-monitor add comment=“Alarm for Internet Port - Download” disabled=yes interface=ether3-Oi name=tmon-download-log on-event=“:log info "WAN download reached 150Mbps"” threshold=150000000 traffic=received
/tool traffic-monitor add comment=“Alarm for Internet Port - Upload” disabled=yes interface=ether3-Oi name=tmon-upload-log on-event=“:log info "WAN upload reached 30Mbps"” threshold=30000000