Community discussions

MikroTik App
 
cj3666
just joined
Topic Author
Posts: 6
Joined: Mon Dec 02, 2019 1:42 am

Obtain the IP of DNS Name of the hotspot automatically

Fri May 29, 2020 1:50 am

Greetings everyone, thanks for taking a minute of your time and looking at this.

What I want is to take the IP of DNS Name de hotspot automatically, is there a prefix or code which allows me to take the ip of the hotspot? something like $ ip-hotspot or $ ipdnsname

the code where I want to add is this, where $ ip-hotspot is where I want to get the ip of the hotspot
ip firewall address-list add address="$ip-hotspot" list=home
.
.
Image
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Posts: 854
Joined: Wed Mar 25, 2020 4:04 am

Re: Obtain the IP of DNS Name of the hotspot automatically

Fri May 29, 2020 9:13 am

So, you operate a device, and don't know its IP? :-) Man-o-man :-)

You need to read out the IP of the RED-HOTSPOT interface that you had defined sometime ago.
See this example setup: https://wiki.mikrotik.com/wiki/Manual:I ... Spot_Setup
Ie. the "local address of network" HotSpot gateway address.

Try also this to get the IP of the device.
:put [/resolve hotspot1]

I think it is the field "IP of DNS Name". Just use that IP in your address list.

See also https://wiki.mikrotik.com/wiki/Hotspot_server_setup
 
cj3666
just joined
Topic Author
Posts: 6
Joined: Mon Dec 02, 2019 1:42 am

Re: Obtain the IP of DNS Name of the hotspot automatically

Fri May 29, 2020 4:21 pm

if I try to add the unknown ip hotspot since it is a script that I am trying to do.

try with:
ip firewall address-list add address = "[/ resolve hotspot1]" list = home
it doesn't work for me.

I also tried
ip firewall address-list add address = [/ ip hotspot get hotspot1] list = home
it doesn't work for me either.

you can help?
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Posts: 854
Joined: Wed Mar 25, 2020 4:04 am

Re: Obtain the IP of DNS Name of the hotspot automatically

Fri May 29, 2020 4:32 pm

- Remove the blanks around "="
- Put "/" in front
And: the IP is static, so you can add it directly.

Try this:
/ip firewall address-list add address="10.0.10.1" list="home"
OR this:
/ip firewall address-list add address=[/resolve hotspot1] list="home"
 
cj3666
just joined
Topic Author
Posts: 6
Joined: Mon Dec 02, 2019 1:42 am

Re: Obtain the IP of DNS Name of the hotspot automatically

Fri May 29, 2020 7:59 pm

it gives me error when adding: "
failure: dns name does not exist "

Image


:( :( :( :(
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Posts: 854
Joined: Wed Mar 25, 2020 4:04 am

Re: Obtain the IP of DNS Name of the hotspot automatically

Fri May 29, 2020 10:08 pm

What does this output on your device? :
/ip dns print

Add all the IPs of your DNS servers there by doing:
/ip dns set servers=IP1,IP2,...