Community discussions

MikroTik App
 
MrYan
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 27, 2010 6:13 pm

Re: Is it possible to create a script that updates the domain record every time the pppoe connection is established?

Fri Nov 12, 2021 11:15 am

Couple of options:
Configure on-up in the PPP profile and then run a script using /tool/fetch to update DNS (if possible).
Use /ip/cloud to get a Mikrotik dns-name (SERIAL_NUMBER..sn.mynetname.net) and CNAME to that from your domain.

The latter is possibly the more reliable (and less work).
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 725
Joined: Tue Dec 17, 2019 1:08 pm

Re: Is it possible to create a script that updates the domain record every time the pppoe connection is established?

Wed Nov 17, 2021 4:00 am

Yes,

The PPPoE-Interface can be assigned a "Profile"
In return each Profile can be assigned a "On-Up" and "On-Down" Script.
 
thekrzos
newbie
Posts: 29
Joined: Tue Aug 02, 2016 10:39 am

Re: Is it possible to create a script that updates the domain record every time the pppoe connection is established?

Sat Dec 04, 2021 12:27 am

Something like this:
/int pppoe-client monitor pppoe-client1 once do={
    :if ($status = "connected") do={
    	// here you can use $"local-address" variable
    	// and make changes if actual IP != old IP saved to variables
    }
}
You need write your logic to this script.
if local-address != old_address than use /tool fetch to update IP or execute /ip cloud force-update;

Who is online

Users browsing this forum: No registered users and 2 guests