Community discussions

MikroTik App
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Monitor devices with dynamic IP addresses

Wed Mar 29, 2023 10:52 am

Hi,
I have been sifting through the forums but cannot find a definitive answer to my question.

Scenario:
I have a CHR running dude server. All my routers I want to monitor connect to the CHR via a L2TP/IPSEC VPN. The addresses are assigned to the vpn clients from a pool. The dude will auto discover the routers and monitor them beautifully. The only problem is some routers have flaky uplinks and the vpn can drop ever few days. When this happens the router will re-connect to the vpn but it will be assigned a different IP address from the pool. When this happens, Dude will auto-discover the new IP address but the old IP address will remain and showing offline.

Question:
How can I monitor routers with IPs that change? This VPN is purely for monitoring purposes so I don't care what the IP address is but I do care about the device name and weather it is online or not. I'm not using dynamic DNS or anything of the sorts.

I'm already pulling the router identity via SNMP which will always be unique because it includes the RB serial number. perhaps that could be useful?

TIA <3
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2978
Joined: Mon Apr 08, 2019 1:16 am

Re: Monitor devices with dynamic IP addresses

Wed Mar 29, 2023 11:48 am

Dude MAC Mapping? https://wiki.mikrotik.com/wiki/Manual:T ... C_mappings (see bottom)

Never tried that one ...MAC Lookup : "mac to ip" ???
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Monitor devices with dynamic IP addresses

Wed Mar 29, 2023 3:27 pm

Dude MAC Mapping? https://wiki.mikrotik.com/wiki/Manual:T ... C_mappings (see bottom)

Never tried that one ...MAC Lookup : "mac to ip" ???
Thanks for the info. Do you have any ideas for the best practice to implement this? The wiki is very vauge on this topic.

I have selected "mac to IP" but it does not seem to solve the problem. When I force the IP to change on the target router auto-discovery detects the new IP and adds it as a new device while the old IP remains showing offline.

Image
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2978
Joined: Mon Apr 08, 2019 1:16 am

Re: Monitor devices with dynamic IP addresses

Wed Mar 29, 2023 6:20 pm

No experience.
Seems to be an old requirement, with no solution , so far. : viewtopic.php?t=95823
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Monitor devices with dynamic IP addresses

Wed Mar 29, 2023 11:06 pm

No experience.
Seems to be an old requirement, with no solution , so far. : viewtopic.php?t=95823
The more I read the more I’m beginning to think that the Dude isn’t fit for my purpose and a lot of people have a similar problem which always results in them having to set the IP statically which is a shame. I think if Mikrotik put some love into the Dude and gave it a refresh than it could be a super powerful platform for cloud management and MSPs.

Having said all that does anyone know of a platform out there that will do what I and many others are wanting to do that is preferably self-hosted and free?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 1:34 am

If you set MAC to IP, but don't set MAC... IT DOESN'T WORK!!!...
From your screenshot, you didn't put the MAC....

The device must be on the same L2 domain as The Dude server.

Tip: Set IP to MAC first, and after MAC is resolved (when possible) and appears in the field, click MAC to IP.

If multiple devices have the same MAC, the devices are not on the same L2 domain... (and that MAC is the MAC of the device through the connection is estabilished)
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 10:23 am

If you set MAC to IP, but don't set MAC... IT DOESN'T WORK!!!...
From your screenshot, you didn't put the MAC....

The device must be on the same L2 domain as The Dude server.

Tip: Set IP to MAC first, and after MAC is resolved (when possible) and appears in the field, click MAC to IP.

If multiple devices have the same MAC, the devices are not on the same L2 domain... (and that MAC is the MAC of the device through the connection is estabilished)
I see.. well all my routers are connecting via VPN so they won’t be on the same Layer2. I thought the whole point of MAC mapping was to pull the MAC address via SNMP which is layer3.
 
User avatar
Ca6ko
Member
Member
Posts: 498
Joined: Wed May 04, 2022 10:59 pm
Location: Kharkiv, Ukraine

Re: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 12:31 pm

Try using the DNS name.
name to address
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 12:38 pm

Try using the DNS name.
name to address
If the device have private IP 10.x.x.x, how can DNS work with private dynamic IPs???
 
User avatar
Ca6ko
Member
Member
Posts: 498
Joined: Wed May 04, 2022 10:59 pm
Location: Kharkiv, Ukraine

Re: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 12:54 pm

Sometimes Cloud helps.
PS Unfortunately, the documentation does not describe how to select the address when there is more than one. Usually the first address in the address list is assigned
You do not have the required permissions to view the files attached to this post.
Last edited by Ca6ko on Thu Mar 30, 2023 1:21 pm, 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: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 1:04 pm

👌👌👌
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2978
Joined: Mon Apr 08, 2019 1:16 am

Re: Monitor devices with dynamic IP addresses

Thu Mar 30, 2023 2:16 pm

Try using the DNS name.
name to address
If the device have private IP 10.x.x.x, how can DNS work with private dynamic IPs???
Static entries in your (MT router) DNS server/forwarder. ?
"router.lan" is usually there by default already.
Anything not in the static list will be forwarded to the 'Servers' or 'Dynamic servers'
Clients must use the MT router server to have local (static) + public resolved.

DHCP servers mostly have the option to update the DNS entries.
In Mikrotik you need to use a script : viewtopic.php?t=145177

Who is online

Users browsing this forum: No registered users and 8 guests