Community discussions

MikroTik App
 
User avatar
markhimsley
just joined
Topic Author
Posts: 18
Joined: Sat May 20, 2017 4:45 pm
Location: London UK

Dynamic route disappears every 14 seconds

Wed Jun 09, 2021 11:36 am

I've got this hEXs running v6.48.3.
It's doing masquerading NAT from the bridge to eth0, and the eth0 IP address is dynamically supplied by DHCP.
It's also an OpenVPN server and is routing a set of subnets to that VPN.
The route to the default gateway is dynamically created from the DHCP client.
The problem is that every 14 seconds the default route disappears and is re-created (it is route #1 below).
To alleviate the issue I have had to create a static default route which exactly replicates the dynamic one (it is route #0 below).

I can tell that the dynamic route is disappearing and being re-created every 14 seconds by watching in winbox and in webfig, I don't know a way of seeing the change happen in logs - but honestly, it is happening.

Any ideas why this is happening, and how I can stop it? I'd prefer the route to be dynamically created.
[admin@rb04] > 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                          10.11.1.250               1
 1  DS  0.0.0.0/0                          10.11.1.250               1
 2 X S  0.0.0.0/0                          10.64.0.254               1
 3 A S  10.0.0.0/13                        192.168.99.10             1
 4 A S  10.8.0.0/15                        192.168.99.10             1
 5 A S  10.10.0.0/16                       192.168.99.10             1
...
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Dynamic route disappears every 14 seconds

Wed Jun 09, 2021 12:32 pm

on dhcp server of the other device (probably 10.11.1.250) increase lease time from 14 min to max

if you can't act on other router:
on your mikrotik routerboard go on dhcp-client and remove "add default route" (but do not remove the one you have created!)
 
User avatar
markhimsley
just joined
Topic Author
Posts: 18
Joined: Sat May 20, 2017 4:45 pm
Location: London UK

Re: Dynamic route disappears every 14 seconds

Fri Jun 11, 2021 11:05 am

Thanks for your interest.
on dhcp server of the other device (probably 10.11.1.250) increase lease time from 14 min to max
I said 14 seconds not 14 minutes ;-)

The lease time listed in the DHCP client on the hEXs says the lease lasts for over 5 days. The length of the lease does not appear to affect the dynamic route disappearing and being re-created every 14 seconds.

But, even so, the route should not disappear when it's being refreshed.
on your mikrotik routerboard go on dhcp-client and remove "add default route" (but do not remove the one you have created!)
I've already worked around the problem be adding a static route, and I know I could stop the automatic adding of the rough.
I'd prefer the route to be dynamically created. It makes it easier for me to move this router between sites.
 
User avatar
dlynes
newbie
Posts: 32
Joined: Tue Apr 12, 2016 9:08 pm
Location: Hamilton, Canada
Contact:

Re: Dynamic route disappears every 14 seconds

Fri Jun 11, 2021 1:26 pm

Hello Mark,

I see that you have a static route that duplicates that dynamic route. I'm assuming the dynamic route is automatically added when a dhcp client renews its IP address.

If that's the case, check to see if that ethernet port keeps losing its link. If that's not the case, but you have a check gateway for that route, try changing it to using 'arp' instead of 'ping' to see if that'll help it stabilize. I've noticed something recently when check gateway is set to ping that a dynamic route goes up and down like a yo-yo about every 10 to 15 seconds. When it's set to 'arp', it no longer happens. It appears to be a problem with recent firmware, but I haven't completely narrowed it down yet. It's only happening to me on one particular client that's using a cable-based ISP.
I've got this hEXs running v6.48.3.
It's doing masquerading NAT from the bridge to eth0, and the eth0 IP address is dynamically supplied by DHCP.
It's also an OpenVPN server and is routing a set of subnets to that VPN.
The route to the default gateway is dynamically created from the DHCP client.
The problem is that every 14 seconds the default route disappears and is re-created (it is route #1 below).
To alleviate the issue I have had to create a static default route which exactly replicates the dynamic one (it is route #0 below).

I can tell that the dynamic route is disappearing and being re-created every 14 seconds by watching in winbox and in webfig, I don't know a way of seeing the change happen in logs - but honestly, it is happening.

Any ideas why this is happening, and how I can stop it? I'd prefer the route to be dynamically created.
[admin@rb04] > 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                          10.11.1.250               1
 1  DS  0.0.0.0/0                          10.11.1.250               1
 2 X S  0.0.0.0/0                          10.64.0.254               1
 3 A S  10.0.0.0/13                        192.168.99.10             1
 4 A S  10.8.0.0/15                        192.168.99.10             1
 5 A S  10.10.0.0/16                       192.168.99.10             1
...
 
User avatar
markhimsley
just joined
Topic Author
Posts: 18
Joined: Sat May 20, 2017 4:45 pm
Location: London UK

Re: Dynamic route disappears every 14 seconds

Sun Jun 13, 2021 11:51 am

Narrowing this down a bit more... I can see that the DHCP client is in an error status, and 'searches' every ~ 14 seconds - which is what takes away the default route.
/ip dhcp-client export terse 
# jun/13/2021 09:33:26 by RouterOS 6.48.3
# software id = 772X-DCNI
#
# model = RB760iGS
# serial number = ********
/ip dhcp-client add disabled=no interface=ether1
The thing that confuses me - it's getting a lease with a DNS server and creating the default route.
/ip dhcp-client print 
Flags: X - disabled, I - invalid, D - dynamic 
 #   INTERFACE                  USE-PEER-DNS ADD-DEFAULT-ROUTE STATUS        ADDRESS           
 0   ether1                     yes          yes               error         10.11.1.249/24    
These are the logs from one poll of the DHCP - repeat this once every ~14 seconds.
09:43:58 dhcp,debug,state dhcp: dhcp-client on ether1 entering <selecting...> state 
09:43:58 route,debug,calc dhcp: Begin calculation 
09:43:58 route,debug,event dhcp: Removed route 
09:43:58 route,debug,event dhcp:     state=CANDIDATE 
09:43:58 route,debug,event dhcp:     dst-prefix=0.0.0.0/0 
09:43:58 route,debug,event dhcp:     attributes 
09:43:58 route,debug,event dhcp:         protocol=DYNAMIC 
09:43:58 route,debug,event dhcp:         distance=1 
09:43:58 route,debug,event dhcp:         scope=30 
09:43:58 route,debug,event dhcp:         target-scope=10 
09:43:58 route,debug,event dhcp:         next-hop= address=10.11.1.250 
09:43:58 route,debug,event dhcp:         vrf-iface (1)=ether1 
09:43:58 route,debug,event dhcp:         origin-type=DYNAMIC 
09:43:58 route,debug,calc dhcp: Select route 
09:43:58 route,debug,calc dhcp:     dst-address=0.0.0.0/0 
09:43:58 route,debug,calc dhcp:     attributes 
09:43:58 route,debug,calc dhcp:         protocol=STATIC 
09:43:58 route,debug,calc dhcp:         distance=1 
09:43:58 route,debug,calc dhcp:         scope=30 
09:43:58 route,debug,calc dhcp:         target-scope=10 
09:43:58 route,debug,calc dhcp:         next-hop= address=10.11.1.250 
09:43:58 route,debug,calc dhcp:         comment= 
09:43:58 route,debug,calc dhcp:         origin-type=STATIC 
09:43:58 route,debug,calc dhcp: End calculation 
09:43:58 route,debug dhcp: Begin redistribution 
09:43:58 route,debug dhcp: Skip update 0.0.0.0/0 
09:43:58 route,debug dhcp: End redistribution 
09:43:58 dhcp,debug,packet dhcp: dhcp-client on ether1 sending discover with id 524268713 to 255.255.255.255 
09:43:58 dhcp,debug,packet dhcp:     flags = broadcast 
09:43:58 dhcp,debug,packet dhcp:     ciaddr = 0.0.0.0 
09:43:58 dhcp,debug,packet dhcp:     chaddr = 74:4D:28:78:32:ED 
09:43:58 dhcp,debug,packet dhcp:     Msg-Type = discover 
09:43:58 dhcp,debug,packet dhcp:     Parameter-List = Subnet-Mask,Classless-Route,Router,Static-Route,Domain-Server,NTP-Server,CAPWAP-Server,Vendor-Specific 
09:43:58 dhcp,debug,packet dhcp:     Host-Name = "rb04" 
09:43:58 dhcp,debug,packet dhcp:     Client-Id = 01-74-4D-28-78-32-ED 
09:43:58 dhcp,debug,packet dhcp: dhcp-client on ether1 received offer with id 524268713 from 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     flags = broadcast 
09:43:58 dhcp,debug,packet dhcp:     ciaddr = 0.0.0.0 
09:43:58 dhcp,debug,packet dhcp:     yiaddr = 10.11.1.249 
09:43:58 dhcp,debug,packet dhcp:     siaddr = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     chaddr = 74:4D:28:78:32:ED 
09:43:58 dhcp,debug,packet dhcp:     Msg-Type = offer 
09:43:58 dhcp,debug,packet dhcp:     Server-Id = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     Address-Time = 86400 
09:43:58 dhcp,debug,packet dhcp:     Renewal-Time = 43200 
09:43:58 dhcp,debug,packet dhcp:     Rebinding-Time = 75600 
09:43:58 dhcp,debug,packet dhcp:     Subnet-Mask = 255.255.255.0 
09:43:58 dhcp,debug,packet dhcp:     Broadcast-Address = 10.11.1.255 
09:43:58 dhcp,debug,packet dhcp:     Domain-Server = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     Router = 10.11.1.250 
09:43:58 dhcp,debug,state dhcp: dhcp-client on ether1 entering <requesting...> state 
09:43:58 dhcp,debug,packet dhcp: dhcp-client on ether1 sending request with id 524268713 to 255.255.255.255 
09:43:58 dhcp,debug,packet dhcp:     flags = broadcast 
09:43:58 dhcp,debug,packet dhcp:     ciaddr = 0.0.0.0 
09:43:58 dhcp,debug,packet dhcp:     chaddr = 74:4D:28:78:32:ED 
09:43:58 dhcp,debug,packet dhcp:     Msg-Type = request 
09:43:58 dhcp,debug,packet dhcp:     Server-Id = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     Address-Request = 10.11.1.249 
09:43:58 dhcp,debug,packet dhcp:     Parameter-List = Subnet-Mask,Classless-Route,Router,Static-Route,Domain-Server,NTP-Server,CAPWAP-Server,Vendor-Specific 
09:43:58 dhcp,debug,packet dhcp:     Host-Name = "rb04" 
09:43:58 dhcp,debug,packet dhcp:     Client-Id = 01-74-4D-28-78-32-ED 
09:43:58 dhcp,debug,packet dhcp: dhcp-client on ether1 received ack with id 524268713 from 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     flags = broadcast 
09:43:58 dhcp,debug,packet dhcp:     ciaddr = 0.0.0.0 
09:43:58 dhcp,debug,packet dhcp:     yiaddr = 10.11.1.249 
09:43:58 dhcp,debug,packet dhcp:     siaddr = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     chaddr = 74:4D:28:78:32:ED 
09:43:58 dhcp,debug,packet dhcp:     Msg-Type = ack 
09:43:58 dhcp,debug,packet dhcp:     Server-Id = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     Address-Time = 86400 
09:43:58 dhcp,debug,packet dhcp:     Renewal-Time = 43200 
09:43:58 dhcp,debug,packet dhcp:     Rebinding-Time = 75600 
09:43:58 dhcp,debug,packet dhcp:     Subnet-Mask = 255.255.255.0 
09:43:58 dhcp,debug,packet dhcp:     Broadcast-Address = 10.11.1.255 
09:43:58 dhcp,debug,packet dhcp:     Domain-Server = 10.11.1.250 
09:43:58 dhcp,debug,packet dhcp:     Router = 10.11.1.250 
09:43:58 dhcp,debug,state dhcp: dhcp-client on ether1 entering <error> state 
09:43:58 route,debug,calc dhcp: Begin calculation 
09:43:58 route,debug,event dhcp: Added candidate route 
09:43:58 route,debug,event dhcp:     dst-prefix=0.0.0.0/0 
09:43:58 route,debug,event dhcp:     attributes 
09:43:58 route,debug,event dhcp:         protocol=DYNAMIC 
09:43:58 route,debug,event dhcp:         distance=1 
09:43:58 route,debug,event dhcp:         scope=30 
09:43:58 route,debug,event dhcp:         target-scope=10 
09:43:58 route,debug,event dhcp:         next-hop= address=10.11.1.250 
09:43:58 route,debug,event dhcp:         vrf-iface (1)=ether1 
09:43:58 route,debug,event dhcp:         origin-type=DYNAMIC 
09:43:58 route,debug,calc dhcp: Select route 
09:43:58 route,debug,calc dhcp:     dst-address=0.0.0.0/0 
09:43:58 route,debug,calc dhcp:     attributes 
09:43:58 route,debug,calc dhcp:         protocol=STATIC 
09:43:58 route,debug,calc dhcp:         distance=1 
09:43:58 route,debug,calc dhcp:         scope=30 
09:43:58 route,debug,calc dhcp:         target-scope=10 
09:43:58 route,debug,calc dhcp:         next-hop= address=10.11.1.250 
09:43:58 route,debug,calc dhcp:         comment= 
09:43:58 route,debug,calc dhcp:         origin-type=STATIC 
09:43:58 route,debug,calc dhcp: End calculation 
09:43:58 route,debug dhcp: Begin redistribution 
09:43:58 route,debug dhcp: Skip update 0.0.0.0/0 
09:43:58 route,debug dhcp: End redistribution 
So, why the error status?

Screenshot from 2021-06-13 09-23-21.png
You do not have the required permissions to view the files attached to this post.
 
carldavis
just joined
Posts: 3
Joined: Thu Dec 16, 2021 3:59 pm

Re: Dynamic route disappears every 14 seconds

Thu Dec 16, 2021 4:00 pm

I too am experiencing this same exact issue. Was a solution ever discovered?
 
User avatar
markhimsley
just joined
Topic Author
Posts: 18
Joined: Sat May 20, 2017 4:45 pm
Location: London UK

Re: Dynamic route disappears every 14 seconds

Fri Dec 31, 2021 7:33 pm

Was a solution ever discovered?
It's hard to tell, because I added the static route (as described above) and ignored the issue.

But I think upgrading to RouterBoard v7 has fixed it.

Who is online

Users browsing this forum: adimihaix, Google [Bot], Qalderu and 72 guests