Community discussions

MikroTik App
 
punn
newbie
Topic Author
Posts: 34
Joined: Sun Jun 14, 2009 4:48 pm
Location: Prague

Monitoring port 80

Fri Jul 01, 2011 3:44 pm

Hi!

I would like to ask if Mikrotik RouterOS is able in some way monitor port 80 (http).
Config is the following:
Router has a public IP. Has a vpn to our central office.
VPN and internet from behind the local router didn't worked.

We were able to connect to the router trough the public IP and check the config. It was OK.
Then figured out if the ping works from the router and the local subnet to the internet it should be a blocked port problem.

Checked with the local ISP and the had blocked almost all the outgoing ports.

So has the ROS some tool to monitor if a port is open?!

Thank you for the reply!

Best regards
Gabor
Prague
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Monitoring port 80

Fri Jul 01, 2011 4:19 pm

Run telnet to port 80 (it is working, when any program is listening on this port),

when port is open you get reply,
[admin@Test_GW] > system telnet 1.1.1.1 80
Trying 1.1.1.1...
Connected to 1.1.1.1.
Escape character is '^]'.
open
HTTP/1.0 400 Bad Request
Connection: close
Content-Length: 113
Date: Fri, 01 Jul 2011 13:16:02 GMT
Expires: 0

<html>
<head><title>Error 400: Bad Request</title></head>
<body>
<h1>Error 400: Bad Request</h1>
</body>
</html>
Connection closed by foreign host.


Port 80 is closed,
[admin@Test_GW] > system telnet 1.1.1.1 80
Trying 1.1.1.1...
telnet: Unable to connect to remote host: Connection refused

Welcome back!
 
punn
newbie
Topic Author
Posts: 34
Joined: Sun Jun 14, 2009 4:48 pm
Location: Prague

Re: Monitoring port 80

Fri Jul 01, 2011 4:44 pm

can I run the telnet command in a script ?
so if the main connection doesn't work so I can switch it to a backup internet?
 
punn
newbie
Topic Author
Posts: 34
Joined: Sun Jun 14, 2009 4:48 pm
Location: Prague

Re: Monitoring port 80

Mon Jul 04, 2011 4:51 pm

Any idea how can I use telnet from a script ?
in a script how can I use the telnet command "open"?
how can i determine if the connection was successll or isn't functional ?

Thanks for the help!
 
bburley
Frequent Visitor
Frequent Visitor
Posts: 80
Joined: Thu Nov 18, 2010 7:22 am
Location: Alberta, Canada

Re: Monitoring port 80

Tue Jul 05, 2011 11:32 am

Tera Term Pro is a telnet client with a built-in scripting language. It can also be programmed to change settings in MikroTik Routers if certain conditions are met.