This is probably the easiest way:
/tool fetch output=user url=https://ipinfo.co.za;
Example output:
status: finished
downloaded: 0KiBC-z pause]
data: Your IP address is: 81.180.71.14
This is probably the easiest way:
/tool fetch output=user url=https://ipinfo.co.za;
Example output:
status: finished
downloaded: 0KiBC-z pause]
data: Your IP address is: 81.180.71.14
The result of your “code” is
failure: invalid URL
This is the simplest way, as long as the RouterBOARD can connect to the Internet.
:put [:resolve myip.opendns.com server=208.67.222.222]
As I write above.
:put [/ip cloud get public-address]
On many devices…
= empty string…
This require the Cloud to be on, and your IP is binded with serial number, and all other disadvantages…
Can you give some example on that.
I know that if you posting config, you should not post serial, since it can be used to find your IP. Not a very big problem if you have secured your router well.
Remember that you know olny knowed bugs or backdor…
Works like a charm! Thank you..
Jotne, I want to put the dynamic wanip in a dstnat rule. Note the comment for identification/location purposes.
/ip firewall nat
chain=dstnat dst-address-type=local in-interface=WAN2 protocol=udp dst-port=wg-port action=dst-nat to-addresses=dynamic-ip comment="wireguard-workaround’
The only similar script I have is the one to identify new Gateway and insert into routes…
:if ($bound=1) do={
:local gw $“gateway-address”
/ip route set [ find comment=“wireguard-workaround” gateway!=$gw ] gateway=$gw
}
How do I translate that to wanip versus gateweayIP?
OR…using your method which says to me put ( router findable address) but where is this being put it seems incomplete??
:put [/ip cloud get public-address]
Not sure what you mean by where is this being put. I can just add it to a variable and it works fine for me.
{
:local test [/ip cloud get public-address]
:put $test
}
Greetings anav. Try the code below for the dhcp script. Been using this for other rules as well.
/ip firewall nat set [find comment=“wireguard-workaround”] to-addresses=$“lease-address”