File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,6 @@ The configuration goes to interface's comment:
3333You should know you user name from login. The ` id ` is the tunnel's numeric
3434id, ` pass ` is the * update key* found on the tunnel's advanced tab.
3535
36- Also enabling dynamic DNS in Mikrotik cloud is required:
37-
38- /ip/cloud/set ddns-enabled=yes;
39-
4036See also
4137--------
4238
Original file line number Diff line number Diff line change 1717:global LogPrintExit2;
1818:global ParseKeyValueStore;
1919
20- :if ([ /ip/cloud/get ddns-enabled ] != true) do={
21- $LogPrintExit2 error $0 ("IP cloud DDNS is not enabled.") true;
20+ :if ([ $CertificateAvailable "Starfield Secure Certificate Authority - G2" ] = false || \
21+ [ $CertificateAvailable "R3" ] = false) do={
22+ $LogPrintExit2 error $0 ("Downloading required certificate failed.") true;
2223}
2324
24- # Get the current ip address from cloud
25- /ip/cloud/force-update;
26- :while ([ /ip/cloud/get status ] != "updated") do={
27- :delay 1s;
25+ :local PublicAddress;
26+ :do {
27+ :set PublicAddress ([ /tool/fetch check-certificate=yes-without-crl \
28+ "https://ipv4.showipv6.de/short" output=user as-value ]->"data");
29+ } on-error={
30+ $LogPrintExit2 error $0 ("Failed getting public address.") true;
31+ }
32+
33+ :if ([ :len [ /ip/address find where address~("^" . $PublicAddress . "/") ] ] < 1) do={
34+ $LogPrintExit2 warning $0 ("The address " . $PublicAddress . " is not configured on your device. NAT by ISP?") false;
2835}
29- :local PublicAddress [ /ip/cloud/get public-address ];
3036
3137:foreach Interface in=[ /interface/6to4/find where comment~"^tunnelbroker" !disabled ] do={
3238 :local InterfaceVal [ /interface/6to4/get $Interface ];
3642 :local Success false;
3743 :local Comment [ $ParseKeyValueStore ($InterfaceVal->"comment") ];
3844
39- :if ([ $CertificateAvailable "Starfield Secure Certificate Authority - G2" ] = false) do={
40- $LogPrintExit2 error $0 ("Downloading required certificate failed.") true;
41- }
4245 $LogPrintExit2 info $0 ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress) false;
4346 :while ($I < 3 && $Success = false) do={
4447 :do {
You can’t perform that action at this time.
0 commit comments