Hello @CGCXANNXCGCXANNX,
Thanks very much for your patience and help!
Regarding your last comments I have this:
- I did disconnect the HOME router from the CORE because initially it seems that works, but after sometime the HOME router shows a msg informing that is unable to reach the gateway (190.100.85.9) then I’m unable to ping the gateway from this HOME router and I don’t know why. This HOME routers is a Synology RT2600ac where I connect the public IP 190.100.85.12 to his WAN2 (Lan1) to use as backup connection and I suspect that some kind of special config is required to make it works. I’m going to see if Synology support can help or if u by any chance knows this router pls let me know. Otherwise no issue I will keep this as it whitout this connection.
- On the LAB router, as suggested, I changed to: address=190.100.85.11/29 comment=C&W_Modem-L2_StaticIP interface="ether2[WAN1]" network=190.100.85.8
- Whit the HOME router disconnected, I can access the LAB router WG peers and also can access a NAS behind the LAB. Anyway I’m going to create a WG interface for each subnet as suggested by you because it seems better to me.
- I’m WORRIED whit your comments regarding the firewall on the LAB router. Would you please give me any hint to make it better? I would like to access this router and its services by WG and also access a Synology NAS where I have some services using port 443, then close everything else; by the way on this NAS I have SSL certificate and also 2FA active.
Sorry if asking a lot, but I’m trying to understand the logic behind MK OS.
Anyway if I can compensate your time pls let me know.
At this moment this are the config of the routers:
CORE router
……….
/interface ethernet
set [ find default-name=ether1 ] name="ether1[CORE]"
set [ find default-name=ether2 ] name="ether2[LAB]"
set [ find default-name=ether3 ] name="ether3[HOME]"
/interface list
add comment="C&W WAN TRUNK /29" name=WAN_C&W
add comment="CORE ROUTER LAN" name=LAN
/ip pool
add name=dhcp_pool1 ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=dhcp_pool1 interface=ether5 name=dhcp1
/disk settings
set auto-media-interface=*8 auto-media-sharing=yes auto-smb-sharing=yes
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment="CORE ROUTER LAN" interface=ether5 list=LAN
add comment="Cable and Wireless Trunk WAN" interface="ether1[CORE]" list=
WAN_C&W
/ip address
add address=192.168.88.1/24 comment="LAN CORE" interface=ether5 network=
192.168.88.0
add address=190.100.85.10 comment="WAN-1 CORE" interface="ether1[CORE]"
network=190.100.85.9
add address=190.100.85.10 comment="WAN-2 LAB" interface="ether2[LAB]"
network=190.100.85.11
add address=190.100.85.10 comment="WAN-3 HOME" interface="ether3[HOME]"
network=190.100.85.12
/ip arp
add address=190.100.85.11 interface="ether1[CORE]" published=yes
add address=190.100.85.12 interface="ether1[CORE]" published=yes
add address=190.100.85.9 interface="ether2[LAB]" published=yes
add address=190.100.85.12 interface="ether2[LAB]" published=yes
add address=190.100.85.9 interface="ether3[HOME]" published=yes
add address=190.100.85.11 interface="ether3[HOME]" published=yes
/ip dhcp-client
add comment=defcon default-route-tables=main disabled=yes interface=
"ether1[CORE]"
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=
192.168.88.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan type=A
/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=accept chain=forward comment=
"regla indicada en solucion multiples IPs" dst-address=190.100.85.8/29
in-interface-list=WAN_C&W
add action=drop chain=forward comment=
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat
connection-state=new in-interface-list=WAN_C&W
/ip firewall nat
add action=masquerade chain=srcnat comment=masquerade ipsec-policy=out,none
out-interface="ether1[CORE]" src-address=!190.100.85.8/29 to-addresses=
190.100.85.10
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=190.100.85.9 routing-table=main
suppress-hw-offload=no
/ip service
set ftp disabled=yes
set ssh disabled=yes
set telnet disabled=yes
set www port=81
set api disabled=yes
set api-ssl disabled=yes
/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"
dst-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=fasttrack-connection chain=forward comment="defconf: fasttrack6"
connection-state=established,related
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=America/Panama
/system identity
set name=CORE_ROUTER
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
…………………………………………..
LAB router
/interface bridge
add admin-mac=F4:1E:57:DC:37:C9 auto-mac=no comment=defconf name=local
/interface ethernet
set [ find default-name=ether2 ] comment=C&W_Modem-L2l_Jeseni name=
"ether2[WAN1]"
set [ find default-name=sfp-sfpplus1 ] disabled=yes
/interface wireguard
add listen-port=35001 mtu=1420 name=WG_ALL
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=default-dhcp ranges=192.168.88.2-192.168.88.254
add name=dhcp_pool1 ranges=192.168.88.2-192.168.88.254
add name=dhcp_pool2 ranges=192.168.88.11-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=local name=dhcp1
/certificate settings
set builtin-trust-anchors=not-trusted
/disk settings
set auto-media-interface=local auto-media-sharing=yes auto-smb-sharing=yes
/interface bridge port
add bridge=local interface=ether1
add bridge=local comment=defconf interface=ether3
add bridge=local comment=defconf interface=ether4
add bridge=local comment=defconf interface=ether5
add bridge=local comment=defconf interface=ether6
add bridge=local comment=defconf interface=ether7
add bridge=local comment=defconf interface=ether8
add bridge=local comment=defconf interface=sfp-sfpplus1
/ip neighbor discovery-settings
set discover-interface-list=none
/interface list member
add comment=defcon interface="ether2[WAN1]" list=WAN
add comment=defcon interface=local list=LAN
/interface ovpn-server server
add mac-address=FE:29:BF:6D:56:78 name=ovpn-server1
/interface wireguard peers
/ip address
add address=192.168.88.1/24 comment=LAN interface=local network=192.168.88.0
add address=190.100.85.11/29 comment=C&W_Modem-L2_StaticIP interface=
"ether2[WAN1]" network=190.100.85.8
add address=192.168.100.1/24 comment="Wireguard full lan access" interface=
WG_ALL network=192.168.100.0
add address=192.168.101.1/24 comment="Wireguard G24A1" interface=WG_ALL
network=192.168.101.0
add address=192.168.102.1/24 comment="Wireguard G24A02" interface=WG_ALL
network=192.168.102.0
/ip dhcp-server lease
add address=192.168.88.2 address-lists=192.168.88.0/24 client-id=
2:90:09:D0:2C:10:6D comment="NAS OfidataLab" mac-address=
90:09:D0:2C:10:6D server=dhcp1 use-src-mac=yes
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=
192.168.88.1
/ip dns
set allow-remote-requests=yes use-doh-server=https://1.1.1.1/dns-query
verify-doh-cert=yes
/ip dns static
add address=104.16.248.249 name=cloudflare-dns.com type=A
add address=104.16.249.249 name=cloudflare-dns.com type=A
add address=192.168.88.2 comment="Ofidatalab local domain" match-subdomain=
yes name=local.ofidatalab.com type=A
add address=192.168.88.1 comment="router MK RB5009 2025" name=
routerofidatalab.lan type=A
/ip firewall filter
add action=accept chain=forward comment=
"accept established,related, untracked (MK Forum 2023-04-12 ANAV)"
connection-state=established,related,untracked
add action=drop chain=input comment="Block Port Scanners" src-address-list=
PORT-SCANNERS
add action=drop chain=input comment="defconf: drop invalid" connection-state=
invalid
add action=add-src-to-address-list address-list=PORT-SCANNERS
address-list-timeout=3d chain=input comment="Port Scanner Detector" log=
yes protocol=tcp psd=21,3s,3,1
add action=drop chain=input comment="Bloqueo consulta DNS desde afuera - TCP"
dst-port=53 in-interface="ether2[WAN1]" protocol=tcp
add action=drop chain=input comment=
"Bloqueo consultas DNS desde afuera - UDP" dst-port=53 in-interface=
"ether2[WAN1]" protocol=udp
add action=drop chain=forward comment=
"drop invalid (MK Forum 2023-04-12 ANAV)" connection-state=invalid
add action=fasttrack-connection chain=forward comment=
"fasttrack (MK Forum 2023-04-12 ANAV)" connection-state=
established,related hw-offload=yes
add action=accept chain=forward comment=
"allow internet traffic (MK Forum 2023-04-12 ANAV)" in-interface-list=
LAN out-interface-list=WAN
add action=accept chain=forward comment=
"allow port forwarding dstnat (ANAV 2023-11-17)" connection-nat-state=
dstnat
add action=accept chain=forward comment=
"WG Administracion (MK Forum 2024-04-12 ANAV)" in-interface=WG_ALL
out-interface-list=LAN src-address=192.168.100.0/24
add action=accept chain=forward comment="WG-U24AA (MK Forum 2024-04-12 ANAV)"
dst-address=192.168.88.2 in-interface=WG_ALL src-address=192.168.101.0/24
add action=accept chain=forward comment="WG-U24AB (MK Forum 2024-04-12 ANAV)"
dst-address=192.168.88.2 in-interface=WG_ALL src-address=192.168.102.0/24
add action=drop chain=forward comment=
"drop all else (MK Forum 2024-11-17 ANAV)"
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 (MK Forum 2023-04-12 ANAV)" ipsec-policy=out,none
out-interface-list=WAN
add action=dst-nat chain=dstnat comment="DstNat DS723+ https" dst-address=
190.100.85.11 dst-address-list="" dst-address-type=local dst-port=443
protocol=tcp src-address-list="" to-addresses=192.168.88.2 to-ports=443
add action=redirect chain=dstnat comment=
"from YouTube (Mikrotik channel) Encrypt your DNS request with MikroTik "
dst-port=53 protocol=tcp
add action=redirect chain=dstnat comment=
"from YouTube (Mikrotik channel) Encrypt your DNS request with MikroTik "
dst-port=53 protocol=udp
/ip ipsec profile
set [ find default=yes ] dpd-interval=2m dpd-maximum-failures=5
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=190.100.85.9 routing-table=main
suppress-hw-offload=no
/ip service
set ftp disabled=yes
set telnet disabled=yes
set www address= port=99
set ssh address= port=9999
set winbox address=192.168.88.0/24,192.168.100.0/24 max-sessions=3
set api disabled=yes
set api-ssl disabled=yes
/ip ssh
set strong-crypto=yes
/ipv6 firewall address-list
/ipv6 firewall filter
/system clock
set time-zone-name=America/Panama
/system identity
set name=MK_RB5009_OfidataLab
/system note
set note=enricosm@jeseni.com show-at-cli-login=yes
/system ntp client
set enabled=yes
/system ntp server
set enabled=yes manycast=yes multicast=yes
/system ntp client servers
add address=0.pool.ntp.org
add address=1.pool.ntp.org
add address=2.pool.ntp.org
/tool bandwidth-server
set enabled=no
/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
/user settings
set minimum-password-length=12