# Program name: Ros force-opens the home page (similar to the China Telecom ADSL force-opens the specified home page)
# Program version: Test
# Program rating: None
# Installation instructions:
#1. This program is only debugged on ros2.9.27 and has not been tested in other versions;
#2. Back up data before installation. All consequences are irrelevant to kuwin;
#2. winbox-> system-> scripts-> Press +, paste the program content, press OK, and then press run script.
######################################## ######################################## ####
# Defining variables
# Server IP address of the Home Page
: Local strtoaddress
: Set strtoaddress 192.168.120.253
# Server port of the Home Page
: Local strtoport
: Set strtoport 80
# Time Limit 1: Jump to the specified homepage within the specified time limit, and set 1-5 seconds
: Local strtimeout1
: Set strtimeout1 2 S
# Time Limit 2: Do not jump to the specified homepage within the specified time limit. The value of 3 hours is 3 h. (The test can be set to 1 minute and 1 m)
: Local strtimeout2
: Set strtimeout2 3 H
IP firewall mangle add chain = prerouting protocol = tcp dst-Port = 80 Src-address-list =! Src2 \
Action = add-Src-to-address-list = src1 address-list-Timeout = $ strtimeout1 comment = timeout1
IP firewall mangle add chain = prerouting protocol = tcp dst-Port = 80 \
Action = add-Src-to-address-list = src2 address-list-Timeout = $ strtimeout2 comment = timeout2
IP firewall Nat add chain = dstnat protocol = tcp dst-Port = 80 Src-address-list = src1 \
Action = DST-nat to-addresses = $ strtoaddress to-ports = $ strtoport comment = toaddress
###### Program end ################################ ######################################