Small webserver

Hi,
on this link http://wiki.mikrotik.com/wiki/MikroTik_RouterOS/v3/Feature_Requests in part “Already done” is row Small webserver - or allow main page modification/replacement - already possible to OEMs
What does it mean?
Small webserver on routerOS on mikrotik routerboard?

maslo

Can i put on routerboard simple custom html page for clients?
for example:
when the main link is down and client put some website to browser then RB answare with this custom html page with information where is problem.

is it possible.

maslo

Hi,
i have
internet ↔ RB1 ↔ RB2, so when i’m going for some reason to repair RB1(for example change cable,card…),clients on RB2 are not connected for this time on internet, but clients are connected to RB2.Many clients call me why internet is down.
So i want inform clients “SORRY WE REPAIR DEVICES” on default page on RB2.I configure it before i turn the RB1 off.

Sorry for my ENGLISH.

maslo

I think you might be able to do this with the hotpot feature. Edit the login page to tell your customers Service is down for maintainence, and turn hotspot on when needed.


If anyone has any better Ideas please chime in, I am in no way an expert.

Hotspot was my first idea,but i spent too many times without success.
Some example would be helpfull.

Why this request is not build in MT RB yet?

maslo

I think the reason a web server has not been incorporated is; these are routers, not servers.

But I have found a way to trick it into being a small webserver, but requires the hotspot active AND it is only available on the hotspot interface. See this post:
http://forum.mikrotik.com/t/show-a-web-page-each-10-minutes/25464/1

use proxy…
[silviu@SkyNet] > ip proxy print

enabled: yes
             src-address: 192.168.0.1
                    port: 8080
            parent-proxy: 0.0.0.0
       parent-proxy-port: 0
     cache-administrator: "SkyNet"
          max-cache-size: 25071000KiB
           cache-on-disk: yes
  max-client-connections: 1000
  max-server-connections: 1000
          max-fresh-time: 3d
   serialize-connections: no
       always-from-cache: yes
          cache-hit-dscp: 0
             cache-drive: primary-maste

[silviu@SkyNet] > ip proxy access print

Flags: X - disabled 
 #   DST-PORT                            DST-HOST                      PATH                      METHOD  ACTION HITS      
 0                                                                                                       deny   30

/file edit webproxy/error.html contents

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>System Error</title>
<style type="text/css">
<!--
body p {
	text-align: center;
	color: #F00;
}
.mare {
	font-size: 36px;
	color: #F00;
}
body p {
	color: #000;
}
body p {
	font-size: 24px;
	font-weight: bold;
}
.mare {
	font-size: 46px;
}
body {
	background-color: #999;
}
-->
</style>
</head>
<body>
<hr noshade size="2px"/>
<center>
  <p>&nbsp;</p>
  <p>$(if error)</p>
</center>
<p><span class="mare">$(error)</strong></ul></center></span>
  <center>$(endif)</center>
<p>
<p>Server Down .... please wait !<span class="mare"></span>
<p>
<p>
<p>
<p>
<p><center>$(signature)</center>
</body></html>

[silviu@SkyNet] > system script print

0   name="gw_up" owner="silviu" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive 
     last-started=apr/08/2010 06:09:10 run-count=26 source=
       :log info "GateWay Link is UP..."
       /ip firewall nat disable [/ip firewall nat find comment=avarie]

1   name="gw_dw" owner="silviu" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive 
     last-started=apr/08/2010 06:06:30 run-count=25 source=
       :log info "GateWay link is DOWN..."
       /ip firewall nat enable [/ip firewall nat find comment=avarie]

[silviu@SkyNet] > tool netwatch print

Flags: X - disabled 
 #   HOST            TIMEOUT              INTERVAL             STATUS  SINCE               
 0   ;;; Gw uptime
     10.0.99.254     1s                   5s                   up      apr/08/2010 06:09:10

/ip firewall nat add chain=dstnat action=redirect to-ports=8080 protocol=tcp src-address 192.168.0.0/24 dst-port=80 comment=avarie

[silviu@SkyNet] > ip firewall nat print 
Flags: X - disabled, I - invalid, D - dynamic
0   ;;; avarie
chain=dstnat action=redirect to-ports=8080 protocol=tcp src-address 192.168.0.0/24 dst-port=80 comment=avarie