Hardening access to device, but allowing ping from everywhere

Hi, another newbie question:
I’ve hardened access to my RouterOS device by following this wiki page:
https://wiki.mikrotik.com/wiki/Manual:Securing_Your_Router
I allow access to all services from an internal subnet only, also all users can only login from that subnet.
But now I have this problem: from outside that subnet it’s not possible to ping the device. I rather would like to have ping possible also from outside this subnet.
Is there an explicit access settings also for the ping service itself? IMHO there should be one → feature request :slight_smile: as this is important also for remote monitoring etc…

This I left enabled, but ping from outside the subnet isn’t working:
[admin2@MikroTik] > /tool mac-server ping print
enabled: yes

Thx

/export hide-sensitive file=anynameyouwish

Hi Thx, here is it:

# apr/19/2020 14:17:33 by RouterOS 7.0beta5
# software id = QXVZ-VVPX
#
# model = CRS326-24G-2S+
# serial number = 94550B3F52F5
/interface bridge
add admin-mac=C4:AD:34:78:E1:88 auto-mac=no comment=defconf name=bridge
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=ether9
add bridge=bridge comment=defconf interface=ether10
add bridge=bridge comment=defconf interface=ether11
add bridge=bridge comment=defconf interface=ether12
add bridge=bridge comment=defconf interface=ether13
add bridge=bridge comment=defconf interface=ether14
add bridge=bridge comment=defconf interface=ether15
add bridge=bridge comment=defconf interface=ether16
add bridge=bridge comment=defconf interface=ether17
add bridge=bridge comment=defconf interface=ether18
add bridge=bridge comment=defconf interface=ether19
add bridge=bridge comment=defconf interface=ether20
add bridge=bridge comment=defconf interface=ether21
add bridge=bridge comment=defconf interface=ether22
add bridge=bridge comment=defconf interface=ether23
add bridge=bridge comment=defconf interface=ether24
add bridge=bridge comment=defconf interface=sfp-sfpplus1
add bridge=bridge comment=defconf interface=sfp-sfpplus2
/ip neighbor discovery-settings
set discover-interface-list=none
/ipv6 settings
set disable-ipv6=yes
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add interface=ether6 list=LAN
add interface=ether7 list=LAN
add interface=ether8 list=LAN
add interface=ether9 list=LAN
add interface=ether10 list=LAN
add interface=ether11 list=LAN
add interface=ether12 list=LAN
add interface=ether13 list=LAN
add interface=ether14 list=LAN
add interface=ether15 list=LAN
add interface=ether16 list=LAN
add interface=ether17 list=LAN
add interface=ether18 list=LAN
add interface=ether19 list=LAN
add interface=ether20 list=LAN
add interface=ether21 list=LAN
add interface=ether22 list=LAN
add interface=ether23 list=LAN
add interface=ether24 list=LAN
add interface=sfp-sfpplus1 list=LAN
add interface=sfp-sfpplus2 list=LAN
/ip address
add address=192.168.88.1/17 comment=defconf interface=ether2 network=\
    192.168.0.0
/ip cloud
set update-time=no
/ip dns
set servers=192.168.254.254
/ip route
add dst-address=0.0.0.0/0 gateway=192.168.127.254
/ip service
set telnet address=192.168.0.0/17 disabled=yes
set ftp address=192.168.0.0/17 disabled=yes
set www address=192.168.0.0/17
set ssh address=192.168.0.0/17
set www-ssl address=192.168.0.0/17
set api address=192.168.0.0/17 disabled=yes
set winbox address=192.168.0.0/17 disabled=yes
set api-ssl address=192.168.0.0/17 disabled=yes
#error exporting /ipv6/route/rule
#error exporting /routing/policy/selection
/system clock
set time-zone-name=Europe/Berlin
/system clock manual
set time-zone=+01:00
/system ntp client
set enabled=yes
/system ntp client servers
add address=192.168.254.254
/system routerboard settings
set boot-os=router-os
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=none

I don’t understand the role of this device and its place in network layout (which I don’t understand either).

As far as I understand the setup, CRS is used as a LAN switch - all ports are bridged meaning all are member if same ethernet subnet. It also only has single IP address 192.168.88.1/17 (which spans IP addresses from 192.168.0.0 to 192.168.127.255). You also configured default router whise address is inside indicated IP network.

You’re saying that you allow services from the same subnet which is fine.

But you also write that ping doesn’t work from outside this subnet.

Use of subnet mask /17 is not wrong, but rather uncommon (a /24 is more common). Are you sure it’s the right netmask? Is the same netmask configured on other LAN hosts, including router?

BTW, you could harden security of your device by using /ip firewall config section. It is indeed less resource friendly, but as you’re only using device as a switch, it would onky deal with connection towards its own management interface. On the other hand it offers great flexibility and logging facility as well.

@mks This is my network setup

         LAN1: 192.168.254.0/24                  LAN2: 192.168.0.0/17      
WAN <--> Router1 .254 <-----------> .253 Router2 .127.254 <--------> .88.1 Switch <---> .x.y PCs

Yes, the netmask /17 is correct, and all devices in LAN2 have it.
On Router1 a static route to 192.168.0.0/17 via IP 192.168.254.253 is present.
NAT is not used anywhere (except on the WAN router of course).

LAN1 normally has no other devices attached than those shown above.
But if I attach a PC with IP 192.168.254.3/24 to LAN1 then it somehow can’t ping LAN2, funny: not even 192.168.254.253 which is the same subnet.
Now, the problem for this PC in LAN1 is that it has two gateways: one default to WAN and the second to LAN2,
but the above static route on Router1 does cover this already. I even added an extra route going to LAN2 but still not working.

So, it seems to be a routing problem, maybe a problem with Router1 (it’s not an MT device, also not Router2);
I’ll need to check this further.

But, does the posted config of my switch allow ping requests from outside LAN2? I mean: should it normally work?

Thx

Update: I think I have an idea: it could be the (minimalistic) firewall on Router2 that I had set up some time ago… :slight_smile: Sorry… :slight_smile:
Update2: yes, found & fixed: there was an iptables firewall rule with status “Established and Related”, adding “New” to it solved the problem. The rationale behind it was to prevent all connections from LAN1 (and WAN) to LAN2, ie protecting LAN2 by allowing only outgoing connections… Ok, now for this test of course I have to change that rule…
Sorry for the confusion, it was my own fault… :frowning:

Btw, I now found also a working solution whereby one allows only ping traffic (ie. protocol icmp) via a firewall rule.
(this is on a router with iptables firewall).