Community discussions

MikroTik App
 
MatrixRewriter
just joined
Topic Author
Posts: 6
Joined: Sat May 14, 2022 4:24 pm

Route with dst-address="" can be exported, but not printed or deleted [ROS 7.2.3]

Sat May 14, 2022 4:42 pm

-- Disclaimer: I'm quite new to MikroTik --

Hi all,

This is on a RB5009 running RouterOS 7.2.3.

I made the mistake of creating this route a few times:
/ip route add check-gateway=none disabled=no distance=2 dst-address="" gateway=10.69.145.161 routing-table=main suppress-hw-offload=no
But it does not appear in WinBox / WebFig / Terminal:
/ip route print
does not show it. It only shows my other routes (which are dynamic).

However, it shows up in export:
[admin@MikroTik RB5009] > /ip route export
# may/14/2022 15:27:12 by RouterOS 7.2.3
# software id = xxxxxxxxxxxx
#
# model = RB5009UG+S+
# serial number = xxxxxxxx
/ip route
add check-gateway=none disabled=no distance=2 dst-address="" gateway=10.69.145.161 routing-table=main suppress-hw-offload=no
add check-gateway=none disabled=no distance=2 dst-address="" gateway=10.69.145.161 routing-table=main suppress-hw-offload=no
...
If I create a new instance of this route through SSH while WinBox is showing its IP Routes window, then the new instance will appear right away in WinBox and can be deleted there. But if I close the WinBox window, the route won't appear again! At that point, these routes only appear in export, and I found no way to delete them!

Again:
/ip route print
does not show them, and the removal command that I tried (
/ip route remove [find where gateway=10.69.145.161]
) did not help.
I also tried rebooting the RB5009 but the routes stay there.

So please help me to delete these routes... Thanks in advance!
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Sun May 15, 2022 12:49 am

You're right, it happens, I now have semi-invisible undeletable route too. :D
 
MatrixRewriter
just joined
Topic Author
Posts: 6
Joined: Sat May 14, 2022 4:24 pm

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Sun May 15, 2022 11:27 am

You're right, it happens, I now have semi-invisible undeletable route too. :D
Thank you for the confirmation!
On which RouterOS version/device did you reproduce it? Should we add someone from MikroTik in the loop at this point?
I wonder if this issue is related to the empty dst-address, and whether it also happens on the latest 7.3 betas.
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Sun May 15, 2022 6:40 pm

CHR, same version as yours. The rule survives even upgrade to latest 7.3beta and downgrade back. I'm almost sure that resetting system config would get rid of it, but it also gets rid of everything else, so it's not ideal. It's certainly a bug, system either shouldn't accept such rule at all, or it should replace empty dst-address with 0.0.0.0/0, same way it does in WinBox. You can report it to support, see https://mikrotik.com/support.
 
kevinds
Long time Member
Long time Member
Posts: 575
Joined: Wed Jan 14, 2015 8:41 am

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Mon May 16, 2022 1:35 am

Removed
Last edited by kevinds on Mon May 16, 2022 2:24 am, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Mon May 16, 2022 2:18 am

But it does not appear in WinBox / WebFig / Terminal:
/ip route print
does not show it. It only shows my other routes (which are dynamic).
 
kevinds
Long time Member
Long time Member
Posts: 575
Joined: Wed Jan 14, 2015 8:41 am

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Mon May 16, 2022 2:24 am

Sorry,

Interesting.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Mon May 16, 2022 2:25 am

Internal bug for sure, if the dst is not an IP address...
 
MatrixRewriter
just joined
Topic Author
Posts: 6
Joined: Sat May 14, 2022 4:24 pm

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Mon May 16, 2022 1:09 pm

Thanks everyone! FYI ticket created at MikroTik support:
SUP-82277
 
MatrixRewriter
just joined
Topic Author
Posts: 6
Joined: Sat May 14, 2022 4:24 pm

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Fri May 20, 2022 3:36 pm

I successfully got rid of the route through a config reset, and (as a ticket was opened at MikroTik) I think we can probably close this topic :-)
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Fri May 20, 2022 3:45 pm

Thanks for the help.
But can not be "SOLVED" if the soluction is reset configuration...
We waiting next RouterOS release...
 
MatrixRewriter
just joined
Topic Author
Posts: 6
Joined: Sat May 14, 2022 4:24 pm

Re: Please help: IP route cannot be printed/deleted? [RouterOS 7.2.3]

Fri May 20, 2022 4:51 pm

Thanks for the help.
But can not be "SOLVED" if the soluction is reset configuration...
We waiting next RouterOS release...
Sure! I marked it as "not solved" then :-)
Thank you
 
dsent
just joined
Posts: 2
Joined: Sat Feb 03, 2024 3:16 pm

Re: Route with dst-address="" can be exported, but not printed or deleted [ROS 7.2.3]

Sat Feb 03, 2024 10:02 pm

I have exactly the same problem with hAP ax3/Router OS 7.13.3!
Boy, was it hard to figure out what the problem was!
 
dsent
just joined
Posts: 2
Joined: Sat Feb 03, 2024 3:16 pm

Re: Route with dst-address="" can be exported, but not printed or deleted [ROS 7.2.3]

Sun Feb 04, 2024 1:30 am

I've made a script to find those “lost” routes and remove them. The thing is, they can't be printed or found by
find
, but they can be queried by ID with
get
. So if we iterate over all possible IDs and see which one can be queried with
get
, but can't be queried with
find
, then we've found our guys.
Here is the script:
:global num2hex do={
  :local number  [:tonum $1]
  :local hexadec "0"
  :local remainder 0
  :local hexChars "0123456789ABCDEF"
  :if ($number > 0) do={:set hexadec ""}
  :while ( $number > 0 ) do={
        :set remainder ($number % 16)
        :set number (($number-$remainder) / 16)
        :set hexadec ([:pick $hexChars $remainder].$hexadec)
  } 
  :if ([:len $hexadec] = 1) do={:set hexadec "0$hexadec"}
  :return "$hexadec"
}
:local minId 0x80000000;
:local maxId 0x80000070;  # add a new dummy route, find out its ID, and put it here; all the existing routes necessarily have lower ids.
:local cid
:for i from=$minId to=$maxId do={
	:set cid ("*" . [$num2hex $i]);
	:if ( [:len [/ip/route/find .id=$cid]] = 0 && \  # nothing is found with find
		  [:len [/ip/route/get $cid]] > 1 ) do={  # but there's data from get
		  :put "found a bad one: $cid"
		  :ip/route/remove $cid
	}
}
 
strehi
just joined
Posts: 5
Joined: Wed Sep 05, 2012 7:04 pm

Re: Route with dst-address="" can be exported, but not printed or deleted [ROS 7.2.3]

Wed Feb 21, 2024 7:59 pm

The script works like a charm

Thanks
Bernd
 
MatrixRewriter
just joined
Topic Author
Posts: 6
Joined: Sat May 14, 2022 4:24 pm

Re: Route with dst-address="" can be exported, but not printed or deleted [ROS 7.2.3]

Wed Feb 21, 2024 10:13 pm

Impressive script, well done! 👍

Who is online

Users browsing this forum: BinaryTB, Bing [Bot], Google [Bot], GoogleOther [Bot], rplant and 74 guests