Community discussions

MikroTik App
 
medievil
just joined
Topic Author
Posts: 2
Joined: Mon Jan 15, 2018 7:49 pm

How to open a url using script?

Mon Jan 15, 2018 7:59 pm

Hi. My name is Juan. I would like to be able to open a URL through the ether2 interface. The result of the web I do not care just want to open a web type: www.domain.com/url.php?id=2

It's possible?
Thank you
 
User avatar
PaulsMT
MikroTik Support
MikroTik Support
Posts: 282
Joined: Tue Feb 10, 2015 3:21 pm

Re: How to open a url using script?

Thu Jan 18, 2018 11:41 am

If you want to do this FROM the RouterOS, then you can use fetch to send a simple GET request to the specified web page:
/tool fetch url="www.domain.com/url.php?id=2" keep-result=no

More about the fetch command:
https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch

Similar example based no HTTP GET request:
https://wiki.mikrotik.com/wiki/Manual:T ... am_Example
 
medievil
just joined
Topic Author
Posts: 2
Joined: Mon Jan 15, 2018 7:49 pm

Re: How to open a url using script?

Fri Jan 19, 2018 9:26 am

Thank you very much! that web will be of great help to me. I have two ADSL eth1 and eth2, I would like to open a web with one adsl and another web with the other adsl. How do I select the ethX? bye
 
MK4L
just joined
Posts: 1
Joined: Mon May 06, 2019 5:58 pm

Re: How to open a url using script?

Mon May 06, 2019 6:03 pm

How do I select the ethX?
Reply is late I know, but I wanted to help you like your question quickly helped me.

You can do that using static-and-conditional routing. You just need to know the destination IP of your WEB1 and WEB2, which I suppose should be easy (and if not easy then you need to choose ones that are easy) and force-route your connection to each from the wan interface you like; and that is done using a Firewall/Mangle rule, with Action: Route.
 
emulemodes
just joined
Posts: 11
Joined: Sat Jul 11, 2020 3:47 pm
Location: Turkey

Re: How to open a url using script?

Thu Dec 16, 2021 6:53 pm

If you want to do this FROM the RouterOS, then you can use fetch to send a simple GET request to the specified web page:
/tool fetch url="www.domain.com/url.php?id=2" keep-result=no

More about the fetch command:
https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch

Similar example based no HTTP GET request:
https://wiki.mikrotik.com/wiki/Manual:T ... am_Example
Thenks
https://link-ip.nextdns.io/xxxxxx/xxxxxx45xxxxxxx

Who is online

Users browsing this forum: elico and 18 guests