# Trying to understand the drop filters from the default configuration

**URL:** <https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240>\
**Category:** Beginner Basics\
**Created:** [August 26, 2025, 6:24am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240 "2025-08-26T06:24:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfilipe](https://forum.mikrotik.com/letter_avatar/mfilipe/32/6_449c533f586939b6e5f246632a46421f.png) [@mfilipe](https://forum.mikrotik.com/u/mfilipe)\
**Post date:** [August 26, 2025, 6:24am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/1 "2025-08-26T06:24:01Z")

</div>

There are two filters:

```auto
/ip firewall {
    ...
    filter add chain=input action=drop in-interface-list=!LAN comment="defconf: drop all not coming from LAN" 
    ...
    filter add chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface-list=WAN comment="defconf: drop all from WAN not DSTNATed"
}

```

It seems like the FORWARD filter won't be called once the INPUT drops everything that is not from LAN. Makes sense? I misunderstood this somehow.

Is it not better to just create a `filter add chain=input action=drop connection-state=new connection-nat-state=!dstnat in-interface-list=WAN`? Every new packet that isn't DSTNATed will be dropped, DST-NAT will work as expected, and you don't need two filters.

---

<div class="post-metadata">

**Author:** ![erlinden](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/erlinden/32/59042_2.png) [@erlinden](https://forum.mikrotik.com/u/erlinden)\
**Post date:** [August 26, 2025, 6:25am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/2 "2025-08-26T06:25:45Z")

</div>

Input is for connecting to the router, forward is for connnecting through the router.  
In case of a service running on a server behind the router, the first rule is not hit but the second is.

---

<div class="post-metadata">

**Author:** ![CGGXANNX](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/cggxannx/32/55490_2.png) [@CGGXANNX](https://forum.mikrotik.com/u/CGGXANNX)\
**Post date:** [August 26, 2025, 6:28am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/3 "2025-08-26T06:28:06Z")

</div>

The `input` chain and the `forward` chain are separate. A packet that goes to the `input` chain "branch" will never match the rules in the `forward` chain. See the flowchart in this thread:

[The ultimate Mikrotik iptables flowchart - RouterOS / Useful user articles - MikroTik community forum](https://forum.mikrotik.com/t/the-ultimate-mikrotik-iptables-flowchart/184101)

 ![image](https://data-discourse.cdn.mikrotik.com/original/3X/c/6/c615186350149fa726ef21754a9516b5e09b9609.png)

---

<div class="post-metadata">

**Author:** ![mfilipe](https://forum.mikrotik.com/letter_avatar/mfilipe/32/6_449c533f586939b6e5f246632a46421f.png) [@mfilipe](https://forum.mikrotik.com/u/mfilipe)\
**Post date:** [August 26, 2025, 6:32am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/4 "2025-08-26T06:32:46Z")

</div>

> [@erlinden](#):
>
> Input is for connecting to the router, forward is for connnecting through the router.  
> In case of a service running on a server behind the router, the first rule is not hit but the second is.

For example, a service is running behind the router with a port forwarding, so if an external connection tries to access this service, the new connection will go directly to the FORWARD chain?

---

<div class="post-metadata">

**Author:** ![CGGXANNX](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/cggxannx/32/55490_2.png) [@CGGXANNX](https://forum.mikrotik.com/u/CGGXANNX)\
**Post date:** [August 26, 2025, 6:40am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/5 "2025-08-26T06:40:26Z")

</div>

> [@mfilipe](#):
>
> a service is running behind the router with a port forwarding, so if an external connection tries to access this service

Look at the flowchart above, the initial packet of this incoming connection arrives at #1, goes through #2 -\> #3 -\> #4 -\> #5 (branch _N_ is taken) -\> #10.

At this point #10 you have the DSTNAT rule that does the port forwarding. This NAT rule changes the destination address and/or port to the one of the devices behind the router.

Next is #11 where the routing table is consulted and the route & `out-interface` is determined. Then we have #12 (branch _N_ is taken because the `dst-address` has been changed by DSTNAT is no longer of the router) -\> #13 -\> #14 (here is your filter rule in the `forward` chain) -\> #23 -\> #24 (branch _N_) -\> #25 (here are SRCNAT rules such as `masquerade`) -\> #27 (sent to `out-interface`).

As you can see, in this case the filter `input` rule at #7 is not reached.

---

<div class="post-metadata">

**Author:** ![mfilipe](https://forum.mikrotik.com/letter_avatar/mfilipe/32/6_449c533f586939b6e5f246632a46421f.png) [@mfilipe](https://forum.mikrotik.com/u/mfilipe)\
**Post date:** [August 26, 2025, 6:52am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/6 "2025-08-26T06:52:45Z")

</div>

> [@CGGXANNX](#):
>
> Look at the flowchart above, the initial packet of this incoming connection arrives at #1, goes through #2 -\> #3 -\> #4 -\> #5 (branch _N_ is taken) -\> #10.
> 
> At this point #10 you have the DSTNAT rule that does the port forwarding. This NAT rule changes the destination address and/or port to the one of the devices behind the router.
> 
> Next is #11 where the routing table is consulted and the route & `out-interface` is determined. Then we have #12 (branch _N_ is taken because the `dst-address` has been changed by DSTNAT is no longer of the router) -\> #13 -\> #14 (here is your filter rule in the `forward` chain) -\> #23 -\> #24 (branch _N_) -\> #25 (here are SRCNAT rules such as `masquerade`) -\> #27 (sent to `out-interface`).
> 
> As you can see, in this case the filter `input` rule at #7 is not reached.

Awesome! I got it! Thank you very much for explaining.

---

<div class="post-metadata">

**Author:** ![anav](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/anav/32/2112_2.png) [@anav](https://forum.mikrotik.com/u/anav)\
**Post date:** [August 26, 2025, 11:43am UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/7 "2025-08-26T11:43:08Z")

</div>

Readers digest version, If one had an input chain rule and a dstnat rule (port forwarding) for the same service, the traffic would never hit the input chain or the router's particular service on that port.

Second point, to allow port forwarding, aka the router allows dstnat traffic on an identified port to be redirected to a LAN server, one needs one simple and clear firewall rule in the forward chain, as the traffic is through the router (not to the router) and is heading to a LAN IP ( as in traffic flow inspection, dstnat comes first )

```auto
add action=accept chain=forward comment="port forwarding" connection-nat-state=dstnat

```

The elegance of it covers both external users and local users using the domain name or URL or static WANIP to reach the server.

---

<div class="post-metadata">

**Author:** ![mfilipe](https://forum.mikrotik.com/letter_avatar/mfilipe/32/6_449c533f586939b6e5f246632a46421f.png) [@mfilipe](https://forum.mikrotik.com/u/mfilipe)\
**Post date:** [August 26, 2025, 2:05pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/8 "2025-08-26T14:05:44Z")

</div>

These are my current filters:

```auto
 0 D ;;; special dummy rule to show fasttrack counters
      chain=forward action=passthrough 

 1 ;;; fasttrack
      chain=input action=accept connection-state=established,related,untracked log=no log-prefix="" 

 2 ;;; invalid connection
      chain=input action=drop connection-state=invalid log=no log-prefix="" 

 3 ;;; only lan connection
      chain=input action=drop in-interface-list=!LAN log=no log-prefix="" 

 4 ;;; fasttrack
      chain=forward action=fasttrack-connection hw-offload=yes connection-state=established,related log=no log-prefix="" 

 5 ;;; fasttrack
      chain=forward action=accept connection-state=established,related,untracked log=no log-prefix="" 

 6 ;;; invalid connection
      chain=forward action=drop connection-state=invalid log=no log-prefix="" 

 7 ;;; new connection and not in dstnat
      chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface-list=WAN log=no log-prefix=""

```

The 7th filter is never being hit by the firewall (I'm testing in the real world). Basically, all DSTNATed packets are naturally `connection-nat-state=dstnat` when they come to the FORWARD chain. It seems dumb that this drop filter in the FORWARD chain is a default configuration.

> [@anav](#):
>
> ```auto
> add action=accept chain=forward comment="port forwarding" connection-nat-state=dstnat
> 
> ```
> 
> The elegance of it covers both external users and local users using the domain name or URL or static WANIP to reach the server.

The filter that you are suggesting makes much more sense in my opinion except for one detail: set `connection-state=new` to make the filter work in an isolated way without giving a chance to interfere with other FORWARD filters like FastTrack.

---

<div class="post-metadata">

**Author:** ![anav](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/anav/32/2112_2.png) [@anav](https://forum.mikrotik.com/u/anav)\
**Post date:** [August 26, 2025, 2:36pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/9 "2025-08-26T14:36:58Z")

</div>

Understandable viewpoint, however in reality, a rule is only new the first hit, and after that the new is irrelevant for that connection, as the following traffic is captured by established,related !!

Thus there really is rarely any point to stating new connection. I vaguely remember it could have some application in mangle rules when trying to differentiate traffic to be mangled from other traffic.

---

<div class="post-metadata">

**Author:** ![mkx](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/mkx/32/1611_2.png) [@mkx](https://forum.mikrotik.com/u/mkx)\
**Post date:** [August 26, 2025, 3:18pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/10 "2025-08-26T15:18:51Z")

</div>

> [@anav](#):
>
> Thus there really is rarely any point to stating new connection.

You're right, most of times it's not needed.

One has to remember that order of rules (within same chain) is important, rules get evaluated from top to bottom and first one matching executes. In default config one of early (if not the first) rule is the one accepting established,related. So rules below will be only hit by packets that have other connection state (either invalid, untracked or new). If one then keeps also rule which drops everything invalid (and keeps setting of default rule, which already accepts untracked along with established,related), then remaining packets are only those with state=new .

Now, if one starts to get creative with rules and their order, it might be necessary to set _connection-state=new_ property not to trigger on other packets.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 26, 2025, 3:21pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/11 "2025-08-26T15:21:48Z")

</div>

Default:

> [@Buying - RB1100AHx4 Dude Edition - Questions about Firewall](https://forum.mikrotik.com/t/buying-rb1100ahx4-dude-edition-questions-about-firewall/148996/4):
>
> search tag # rextended default firewall rules WARNING: default WAN and LAN interface list must be defined WARNING: if you do not know what you are doing, you probably lose control of your device MikroTik RouterOS 6.49.22 default firewall rules (fixed for reflect new 7.x rules change) for IPv4 must be also created interface lists, remember to correct assign interfaces inside lists and bridge. /interface list add name=WAN comment=defconf add name=LAN comment=defconf /interface list member ad…

Input:

```auto
accept established,related,untracked
drop invalid
accept ICMP
accept 127.0.0.1
drop not LAN <mean: drop all from interfaces that not are LAN, included interfaces not in WAN!!!>
<remain only new from LAN>

```

Forward:

```auto
fastpath established,related
accept established,related,untracked
drop invalid
<remain all new on forward from any source>
drop new not NATted from WAN
<remain from WAN all new that is NATted>
<remain all new from LAN>
<but also remain all new forward on interfaces that do not are on interface group WAN or LAN>

```

Output:

```auto
<allow all>

```

---

<div class="post-metadata">

**Author:** ![mfilipe](https://forum.mikrotik.com/letter_avatar/mfilipe/32/6_449c533f586939b6e5f246632a46421f.png) [@mfilipe](https://forum.mikrotik.com/u/mfilipe)\
**Post date:** [August 26, 2025, 3:37pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/12 "2025-08-26T15:37:54Z")

</div>

> [@rextended](#):
>
> Forward:
> 
> ```auto
> fastpath established,related
> accept established,related,untracked
> drop invalid
> <remain all new on forward from any source>
> drop new not NATted from WAN
> <remain from WAN all new that is NATted>
> <remain all new from LAN>
> <but also remain all new forward on interfaces that do not are on interface group WAN or LAN>
> 
> ```

For example, the router (firewall) has the `chain=input action=drop in-interface-list=!LAN` filter. Do you have any case in which a new WAN connection in the FORWARD chain is not NATed?

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 26, 2025, 3:39pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/13 "2025-08-26T15:39:13Z")

</div>

spoofing, internal public IPs, malfunctioning, misconfiguration, subnetting, etc. etc. etc.

The generic firewall is multipurpose, it is meant to work on most configurations, it is not meant only for a specific case.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 26, 2025, 3:44pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/14 "2025-08-26T15:44:34Z")

</div>

> [@mfilipe](#):
>
> For example, the router has the `chain=input action=drop in-interface-list=!LAN` filter.

This is the default rule that protects the router's CPU.  
I said router. Yes, router. The router and the internal network are two different things.

If you feel smart about removing the default ICMP and 127.0.0.1 rules, you're not.  
It's been explained so many times, I don't feel like rewriting or pasting the link.

---

<div class="post-metadata">

**Author:** ![Amm0](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/amm0/32/1630_2.png) [@Amm0](https://forum.mikrotik.com/u/Amm0)\
**Post date:** [August 26, 2025, 4:36pm UTC](https://forum.mikrotik.com/t/trying-to-understand-the-drop-filters-from-the-default-configuration/264240/15 "2025-08-26T16:36:59Z")

</div>

Agree with @rextended point:

> [@rextended](#):
>
> The generic firewall is multipurpose, it is meant to work on most configurations, it is not meant only for a specific case.

So for learning "how to build your own firewall"... the default configuration may not be entirely the best example since some of the more complex rules allow some add-on features to "just work" if enabled. For example, IPSec VPN can be enabled in QuickSet on many profiles, so that has to work... and so the default firewall needs to support that (and firewall path for IPSec is get tricky, so it has use more complex matchers for that).

Also keep in mind, the MikroTik defaults embrace a "less rules is better" approach, so yeah some of the firewall filters kinda pull multiple duties. Which also makes it a bit tricky to unwind what's going on.
