Community discussions

MikroTik App
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Topic Author
Posts: 821
Joined: Wed Mar 25, 2020 4:04 am

Routing distance not modifiable

Tue Oct 31, 2023 12:28 am

Hi,
I have these routing settings in ROS v6 (there is no bridge/switch, rather all ports are independent):
[XXXXX@YYYYY] > /ip route print 
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  0.0.0.0/0                          192.168.254.254          20
 1 ADC  192.168.0.0/17     192.168.127.254 ether2                    0
 2 ADC  192.168.128.0/24   192.168.128.254 ether3                    0
 3  DC  192.168.129.0/24   192.168.129.254 ether4                  255
 4  DC  192.168.200.0/24   192.168.200.254 ether5                  255
 5 A S  192.168.253.0/24   192.168.128.254 ether3                   10
 6 ADC  192.168.254.0/24   192.168.254.253 ether1                    0
Why is the distance of #1, #2, and #6 not modifiable in GUI (it's grayed), whereas that of #5 and #0 is very well modifiable ?
How can I set the distance of #1 higher than that of #5 ?

And: why is it saying Dynamic for #1, #2, #3, #4, #6, but not for #5?
Actually IMO all of them should be Static instead of Dynamic. How can I set them to Static?
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2998
Joined: Mon Apr 08, 2019 1:16 am

Re: Routing distance not modifiable

Tue Oct 31, 2023 1:43 am

Routes to direct connected networks (the whole subnet of the assigned IP address of the interface) have a distance of 0, because they are just there at no distance, local to the interface.
Dynamic, because that route is not defined in the config, but added because of the local IP address?

Should also print the IP addresses of the interfaces to be able to check this. This info is missing here.

Local subnet distance cannot be greater than 0, because you are there in that subnet already, unless that interface is down.
The routing will not work as expected if these subnets do overlap. However smaller subnets will precede over larger subnets
Last edited by bpwl on Tue Oct 31, 2023 11:41 am, edited 1 time in total.
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Topic Author
Posts: 821
Joined: Wed Mar 25, 2020 4:04 am

Re: Routing distance not modifiable

Tue Oct 31, 2023 2:09 am

Routes to direct connected networks (the whole subnet of the assigned IP address of the interface) have a distance of 0, because they are just there at no distance, local to the interface.
Dynamic, because that route is not defined in the config, but added because of the local IP address?

Should also print the IP addresses of the interfaces to be able to check this. This info is missing here.

Local subnet distance cannot be greater than 0, because you are there in that subnet already, unless that interface is down.
The routing will not work as expected if these subnets do overlap. However smaller subnets will precede over larger subnets with the same distance.
Thanks for the analyis.
Here's the ip addresses:
[XXXXX@YYYYY] > /ip address print
Flags: X - disabled, I - invalid, D - dynamic
 #   ADDRESS            NETWORK         INTERFACE                                                                                                                                            
 0   192.168.127.254/17 192.168.0.0     ether2
 1   192.168.254.253/24 192.168.254.0   ether1
 2   192.168.200.254/24 192.168.200.0   ether5
 3   192.168.128.254/24 192.168.128.0   ether3
 4 I 192.168.132.254/24 192.168.132.0   wlan3
 5   192.168.129.254/24 192.168.129.0   ether4
 6 I 192.168.133.254/24 192.168.133.0   wlan4
I have a net 192.168.253.0/24 behind another router. Via its WAN link (IP 192.168.128.253/24) it's attached to this above router's ether3 (IP 192.168.128.254) gateway.
In routing it should have precedence over the other routes, b/c otherwise the packets go to the default uplink, but which is the wrong route, therefore the need to modify the distances accordingly...
Last edited by mutluit on Tue Oct 31, 2023 2:40 am, edited 1 time in total.
 
tdw
Forum Guru
Forum Guru
Posts: 1874
Joined: Sat May 05, 2018 11:55 am

Re: Routing distance not modifiable  [SOLVED]

Tue Oct 31, 2023 2:34 am

Smaller subnets always have priority over larger, distance is only used when there are multiple subnets of the same size.

The static route (#5 of /ip route print) looks incorrect - the gateway should be next hop address, not the interface:
/ip route
add dst-address=192.168.253.0/24 gateway=192.168.128.253
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Topic Author
Posts: 821
Joined: Wed Mar 25, 2020 4:04 am

Re: Routing distance not modifiable

Tue Oct 31, 2023 2:48 am

Smaller subnets always have priority over larger, distance is only used when there are multiple subnets of the same size.

The static route (#5 of /ip route print) looks incorrect - the gateway should be next hop address, not the interface:
/ip route
add dst-address=192.168.253.0/24 gateway=192.168.128.253
You are right! It works! Thx!
This below now works fine:
I need the net 192.168.253.0/24 connected to the net 192.168.128.0/24.
Just imagine some dumb switch devices (8 or 16 port) are attached to these router ports for attaching PCs (as well one or more downlinks) into that particular segment (net)...

Who is online

Users browsing this forum: Danvari, globalhostingba, moorezilla, robmaltsystems, saksa911, Seekport [Bot] and 46 guests