I have web-proxy to a webserver for redirect (payment reminder) but how do I configure ROS to act as webserver for my project?Use can use Netwatch and web-proxy on the CPE. That would be a pretty easy and lightweight solution. There are some great webpages on the Internet that have "Network Up/ Down" that you could use as a template.
/tool netwatch
add down-script=\
"/ip firewall nat\r\
\nset [find comment=Redirect] disabled=no\r\
\n" host=8.8.8.8 interval=5s up-script=\
"/ip firewall nat\r\
\nset [find comment=Redirect] disabled=yes"
/ip firewall nat
add action=redirect chain=dstnat comment=Redirect disabled=yes port=80,443 \
protocol=tcp src-address=0.0.0.0/0 to-ports=8080
/ip proxy
set cache-administrator=Admin enabled=yes parent-proxy=0.0.0.0
/ip proxy access
add action=deny dst-address=0.0.0.0/0
Thanks but using 5.26, with webproxy enabled there is no directory in files called webproxy only pub and skins?When you enable the Webproxy, there will be a directory in the Files folder called "webproxy". The webpage "error.html" is editable.
These are the settings I used in ROS 6.7. Please, let me know what you think about it
Customizing error pages
To customize the page web proxy shows on error:
[admin@MikroTik] > /ip proxy reset-html
Current html pages will be lost! Reset anyway? [y/N]
Answer 'y'. Now HTML files are accessible for editing. (Currently there is only one file: error.html, that contains the error message.)
Only port 80 webpages are redirected, No https pages are redirected unable to resolve so they just hang, I cleared cache but no luck,When you enable the Webproxy, there will be a directory in the Files folder called "webproxy". The webpage "error.html" is editable. I created a very simple webpage as an example of one to replace it with, but this is just for proof of concept. The webpage that is attached here should be cleaned up and made presentable before it is used in a production setting.
So...here is what we want to do... We want the CPE to determine that it is offline and change the rules to send the web traffic to this internal webpage that says, "The Internet is down. We know and and we're working on it." Then when the Internet comes back up, we want normal service to be restored.
We'll start with the Netwatch settings:
Next, we'll add the redirect rule to the firewall to send the traffic to the webproxy:Code: Select all/tool netwatch add down-script=\ "/ip firewall nat\r\ \nset [find comment=Redirect] disabled=no\r\ \n" host=8.8.8.8 interval=5s up-script=\ "/ip firewall nat\r\ \nset [find comment=Redirect] disabled=yes"
Next, we'll turn on the Webproxy:Code: Select all/ip firewall nat add action=redirect chain=dstnat comment=Redirect disabled=yes port=80,443 \ protocol=tcp src-address=0.0.0.0/0 to-ports=8080
These are the settings I used in ROS 6.7. Please, let me know what you think about itCode: Select all/ip proxy set cache-administrator=Admin enabled=yes parent-proxy=0.0.0.0 /ip proxy access add action=deny dst-address=0.0.0.0/0
Could you explain or give a example how this can be setup for testing?netwatch trigger script that enable dst-nat to stub ?
and when uplink back online - netwatch use different script to disable it back ?