Community discussions

MikroTik App
 
SilverNodashi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Mon Sep 04, 2017 4:18 pm
Location: South Africa
Contact:

How to get dynamic WAN IP?

Tue Sep 19, 2017 2:29 pm

Hi,

I wonder if anyone can help me.

I have a MikroTik RB2011UiASM, with a Hauwei LTE router on IP 192.168.8.1. The MikroTik is on 192.168.8.2.

How can I get the WAN IP address, using a script? I have searched the forum but cannot find anything that works?
 
User avatar
az1984
newbie
Posts: 28
Joined: Thu Sep 14, 2017 3:58 pm
Location: Germany

Re: How to get dynamic WAN IP?

Tue Sep 19, 2017 2:39 pm

Hi,

for what you want to use the WAN-IP information?

In IP -> Cloud you can find the Mikrotik-DNS Name and your WAN-IP - maybe this will help you out.
 
SilverNodashi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Mon Sep 04, 2017 4:18 pm
Location: South Africa
Contact:

Re: How to get dynamic WAN IP?

Tue Sep 19, 2017 3:17 pm

Hi,

for what you want to use the WAN-IP information?

In IP -> Cloud you can find the Mikrotik-DNS Name and your WAN-IP - maybe this will help you out.
Oh, yes, I should have said. I have a dual WAN setup, with a remove VPN. So the MikroTik can establish a VPN connection regardless of which WAN connection is connected. But it's giving some problems so I want to write a script to change the routes, depending on which WAN is connected. Pinging the LTE router (192.168.8.1) and ADSL router (192.168.4.3) doesn't help much.

So, how do I get that IP address using a script?
And, how do I know chih gateway updated the DNS entry?
 
User avatar
az1984
newbie
Posts: 28
Joined: Thu Sep 14, 2017 3:58 pm
Location: Germany

Re: How to get dynamic WAN IP?

Tue Sep 19, 2017 3:58 pm

Ok, that makes things a bit clearer, but I don't know yet, why you want to work with your WAN-IP.
If you have VPN-Clients which want to connect to the Mikrotik you can use it's DNS-name I think.
 
SilverNodashi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Mon Sep 04, 2017 4:18 pm
Location: South Africa
Contact:

Re: How to get dynamic WAN IP?

Tue Sep 19, 2017 4:04 pm

Ok, that makes things a bit clearer, but I don't know yet, why you want to work with your WAN-IP.
If you have VPN-Clients which want to connect to the Mikrotik you can use it's DNS-name I think.
Like I said, there's 2 WAN's and I need to change some stuff when the WANS's change, based on which WAN is used.

And, client's don't connect to the MikroTik. The MikroTik is a VPN client to another network.
 
User avatar
az1984
newbie
Posts: 28
Joined: Thu Sep 14, 2017 3:58 pm
Location: Germany

Re: How to get dynamic WAN IP?

Tue Sep 19, 2017 4:09 pm

Just found here...

viewtopic.php?t=73287
 
SilverNodashi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Mon Sep 04, 2017 4:18 pm
Location: South Africa
Contact:

Re: How to get dynamic WAN IP?

Tue Sep 19, 2017 4:16 pm

Just found here...

viewtopic.php?t=73287
Thanx.

I am still looking for a way to know which WAN / route was used to establish the connection.
 
gotsprings
Forum Guru
Forum Guru
Posts: 2118
Joined: Mon May 14, 2012 9:30 pm

Re: How to get dynamic WAN IP?

Sun Sep 24, 2017 8:39 pm

Look at the Call-ID on the Connected to Tik?

But if you need to "get the WAN IP"

/ip cloud get public-address

Who is online

Users browsing this forum: No registered users and 33 guests