RouterOS first open page Force jump

Source: Internet
Author: User
Tags routeros

There is very little on the web for the first time RouterOS to open a page to force jump home, most of the way is to browse the IP address of a domain name to your home page, this method sometimes fails.
Another way is that when the user connects with Port 80, fetch the source address to the address list, and then specify the timeout time of the address, do address mapping to achieve the purpose of forcing a jump, but this method will often fail, some instant Messenger software will also use TCP 80 port to communicate.
BUG: Cyclic scripting consumes CPU, and you need to be aware of the router hardware configuration when using this method.

Note: You need to add two tags mangle, one DST destination address rule, and one looping script. Also want to make a page jump page. Note: If the address you want to jump to is not valid, all pages cannot be opened.

First, add tags.

1, the first mark

2. Add a second marker

3. Add DST Destination address jump rules.

Second, add the scheduled task script. This script is used to delete the IP that has skipped the page. Set up a task loop execution timer at/system Scheduler 2-4 second best

: foreach I in=[/ip firewall address-list find LIST=SRC1] do={

: foreach n in=[/ip firewall address-list find LIST=SRC2] do={

: if ([/IP firewall address-list get $i address] = [/IP firewall address-list get $n address]) do={

/IP firewall address-list remove $i}

}

}

Third, page jump page. This is a must, otherwise SRC2 will not automatically add IP. Save the following code as an HTM file to the default Web site for IIS.

<meta http-equiv= "Content-language" content= "ZH-CN" >

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

<title></title>

<script language= "JavaScript" >

<!--Start Code

var ver = navigator.appversion;

if (Ver.indexof ("MSIE")! =-1)

{

window.location.href= "Web site virtual directory to jump to, such as Http://10.20.20.1/webmedia"

}else

window.location.href= "Web site virtual directory to jump to, such as Http://10.20.20.1/webmedia"

End Code--

</SCRIPT>

Here is the configuration file

/IP Firewall mangle

Add action=add-src-to-address-list address-list=src1 address-list-timeout=0s \

Chain=prerouting comment= "" Disabled=no dst-address=!10.20.20.1 dst-port=\

in-interface=! WAN protocol=tcp Src-address-list=!src2

Add action=add-src-to-address-list address-list=src2 address-list-timeout=3h \

Chain=prerouting comment= "" Disabled=no dst-address=10.20.20.1 dst-port=\

in-interface=! WAN protocol=tcp

/IP Firewall NAT

Add Action=dst-nat chain=dstnat comment=toaddress disabled=yes dst-port=80 \

Protocol=tcp Src-address-list=src1 to-addresses=10.20.20.1 to-ports=80

RouterOS first open page Force jump

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.