Community discussions

MikroTik App
 
pwuk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Wed Aug 01, 2012 8:51 pm

Firewall rule numbering

Thu Dec 09, 2021 7:18 pm

The firewall rule numbering behaviour is changed since v6

If I'm in say /ip/firewall/filter and do "print", it shows them in order from 0 upwards

I move rule 8 to position 2, do a print, and it behaves as before, and the rules are in order, from 0 upwards

However if I do say
print where chain='forward'

it doesn't show new numbering (0, 1, 2, 3), but instead shows the print order from the full "print", only filtering out the matching lines

 3    ;;; Allow all Established
      chain=forward action=accept connection-state=established 

 6    ;;; Allow all Related
      chain=forward action=accept connection-state=related 

 9    ;;; Allow ICMP
      chain=forward action=accept protocol=icmp 
I then do a move, to say shift rule 9 above rule 3, and do another print where chain='input', it doesn't reorder
 9    ;;; Allow ICMP
      chain=forward action=accept protocol=icmp 

 3    ;;; Allow all Established
      chain=forward action=accept connection-state=established 

 6    ;;; Allow all Related
      chain=forward action=accept connection-state=related 
Do a print without the where param, then print with where, and it's all renumbered
 3    ;;; Allow ICMP
      chain=forward action=accept protocol=icmp 

 4    ;;; Allow all Established
      chain=forward action=accept connection-state=established 

 7    ;;; Allow all Related
      chain=forward action=accept connection-state=related 
Feels inconsistent to me.
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Firewall rule numbering

Thu Dec 09, 2021 7:42 pm

After moving:

/ip firewall filter print without-paging
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19363
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Firewall rule numbering

Thu Dec 09, 2021 7:44 pm

After moving:

/ip firewall filter print without-paging
Hey msatter if you write up an all commands book for routerOS,
I would send you some $$ to get a copy. :-)
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Firewall rule numbering

Thu Dec 09, 2021 7:53 pm

This one is burned in my memory. Maybe MT can make an alias for it like print renumber

Who is online

Users browsing this forum: No registered users and 29 guests