Firewall drop rule not working

Hi,
I have a Mikrotik RouterBOARD 941-2nD with subnet 192.168.1.0/24. Now I want to block traffic from specific IPs/MAC.
I added this rule:

 /ip firewall filter
add action=drop chain=forward comment=block in-interface-list=all src-address=192.168.1.194

But actually, it isn’t receiving any packets at all and therefore not filtering.
(btw I’m new, so surely i’m missing something).

This is my conf:

/interface bridge
add name=bridge1 protocol-mode=none
/interface wireless
set [ find default-name=wlan1 ] ampdu-priorities=0,1,2,3,4,5,6,7 \
    antenna-gain=2 band=2ghz-b/g/n channel-width=20/40mhz-Ce country=*COUNTRY* \
    disabled=no distance=indoors frequency=2422 frequency-mode=\
    regulatory-domain max-station-count=30 mode=ap-bridge ssid=*SSID* \
    wireless-protocol=802.11 wps-mode=disabled
/interface ethernet
set [ find default-name=ether1 ] advertise=\
    10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full mac-address=\
	*MAC*
set [ find default-name=ether2 ] advertise=\
    10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full mac-address=\
	*MAC*
set [ find default-name=ether3 ] advertise=\
    10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full mac-address=\
    	*MAC*
set [ find default-name=ether4 ] advertise=\
    10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full mac-address=\
    	*MAC*
/interface wireless nstreme
set wlan1 enable-polling=no
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk eap-methods="" \
    group-ciphers=tkip,aes-ccm mode=dynamic-keys supplicant-identity=MikroTik \
    unicast-ciphers=tkip,aes-ccm
/interface bridge port
add bridge=bridge1 hw=no interface=ether1
add bridge=bridge1 hw=no interface=ether2
add bridge=bridge1 hw=no interface=ether3
add bridge=bridge1 hw=no interface=ether4
add bridge=bridge1 interface=wlan1
/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=wlan1 list=LAN
/ip address
add address=192.168.1.1/24 interface=ether2 network=192.168.1.0
/ip dns
set servers=8.8.4.4,8.8.8.8
/ip dns static
add address=192.168.1.1 name=router.lan
/ip route
add distance=1 gateway=192.168.1.254

Can you include a network diagram as based on your config, there is no internet connection so its not clear how this device fits in a network. (besides the fact no firewall rules etc…)

Don’t use in-interface-list=all unless you explicitly constructed such interface list by yourself. There are a few implicit interface lists in ROS but using them causes problems more often than not. And if not set, default behaviour is just as one would expect when setting it the way you did.

A thing to keep in mind: firewall filter only works on packets that actually traverse firewall … so packets have to hit IP layer of router - most often this means source and destination are in different IP subnets.

And an advice: unless you have some very old wireless clients that need to connect to your wireless AP, remove wpa-psk and tkip from wireless security-profiles setup - keep only wpa2-psk and aes-ccm.

I don’t have one. Sadly I didn’t make my net conf

Yea, it was a try since the rule wasn’t receiving packets even without it.

You may be right, I’ve made some packets capture and there wasn’t any passing from 192.168.1.195 (ip i want to block) to 192.168.1.1 (the router).. So how can I fix or workaround this?

thanks for the advice.

It might be possible to do it, but entirely depends on how things are connected (end to end, including any other active equipment on the way, such as dumb ethernet switches etc.). So do provide us with betwork diagram. Hand sketched on paper and photographed with smart phone will do nicely.

BTW, when connections towards router itself is are question, one has to use firewall chain input. Doesn’t matter which router’s address is targeted (can be address not “native” to ingress interface … e.g. LAN device targeting router’s WAN IP address).

Gateway is: RBLHG-5nD https://mikrotik.com/product/RBLHG-5nD#fndtn-specifications
Router is: Mikrotik RouterBOARD 941-2nD https://mikrotik.com/product/RB941-2nD


NetDiag.jpeg

I think you’ve got deeper problem - struck me now, but it’s in the configuration you provided earlier: you have no usable WAN (a.k.a. ether1) config done. You have default route set:

/ip route
add distance=1 gateway=192.168.1.254

but that, according to IP address setting

/ip address
add address=192.168.1.1/24 interface=ether2 network=192.168.1.0

(which is wrong, but later about it) it should be available on LAN IP subnet. The chart says differently, it should be beyond ether1 which doesn’t bear any IP setup.

So what you should do:

  • move your LAN to another IP subnet, e.g. 192.168.88.0/24 (as is default configuration). Also change DHCP server settings to match
  • move LAN IP address to proper interface (in your case it’s bridge1 … not ether2 which is bridge member port)
  • either
  • remove static route you have and add DHCP client to ether1 (if upstream gateway runs DHCP server) - default route will probably come with DHCP lease
    or
    • set IP address from that subnet on ether1 interface (e.g. 192.168.1.1/24) and leave default route as it is now

Since you don’t seem to have any firewall in place, IMO best would be to reset your device to factory default and start over. Don’t remove everything, only configure WAN (as DHCP client) and wireless (SSID, PSK, …).

The above assumes your network diagram is how things should be done, i.e. completely separate gateway’s LAN (which is most probably controled by ISP) from your LAN. If you actually want router as transparent as it gets (i.e. ISP’s gateway runs DHCP server and what not) and only use your “router” as WiFi AP / ethernet switch and a device that can block certain traffic, then “router” needs to be pretty much reconfigured.

Lets be clear you want to block some users/devices on your single subnet from accessing other users/devices on the same single subnet?
I dont know of an EASY way to do this as they are both in the same L2 subnet.
Suggest you consider vlans or some way to separate users from each other and then automatically at L2, users on different vlans are blocked and one only needs firewall rules to ensure the same is true for routing L3.

thanks everyone! I’ll try these things.