Backup Voucheran Mikrotik Uwaisnet 1 WAN


/interface wireless
set [ find default-name=wlan1 ] country=indonesia frequency=2457 ssid=\
    MikroTik wireless-protocol=nv2-nstreme-802.11
/interface ethernet
set [ find default-name=ether1 ] name=OPENWRT
set [ find default-name=ether2 ] name=PC
set [ find default-name=ether3 ] name=SWITCH-AP
set [ find default-name=ether4 ] advertise=\
    10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full disabled=yes \
    name=ether4-ACCESS-POINT-2
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] dns-name=uwais.net hotspot-address=10.10.10.1 \
    html-directory=uwaisnet login-by=http-chap,http-pap,mac-cookie
add dns-name=uwais.net hotspot-address=10.10.10.1 html-directory=uwaisnet \
    login-by=http-chap,http-pap,mac-cookie name=hsprof1
add dns-name=uwais.net hotspot-address=10.10.10.1 html-directory=uwaisnet \
    login-by=http-chap,http-pap,mac-cookie name=hsprof2
/ip hotspot user profile
set [ find default=yes ] add-mac-cookie=no on-login=":put (\",,0,,,noexp,Enabl\
    e,\"); [:local mac \$\"mac-address\"; /ip hotspot user set mac-address=\$m\
    ac [find where name=\$user]]" parent-queue=none rate-limit=512/1M
add name=2J_1000 on-login=":put (\",rem,1000,2h,1000,,Enable,\"); {:local date\
    \_[ /system clock get date ];:local year [ :pick \$date 7 11 ];:local mont\
    h [ :pick \$date 0 3 ];:local comment [ /ip hotspot user get [/ip hotspot \
    user find where name=\"\$user\"] comment]; :local ucode [:pic \$comment 0 \
    2]; :if (\$ucode = \"vc\" or \$ucode = \"up\" or \$comment = \"\") do={ /s\
    ys sch add name=\"\$user\" disable=no start-date=\$date interval=\"2h\"; :\
    delay 2s; :local exp [ /sys sch get [ /sys sch find where name=\"\$user\" \
    ] next-run]; :local getxp [len \$exp]; :if (\$getxp = 15) do={ :local d [:\
    pic \$exp 0 6]; :local t [:pic \$exp 7 16]; :local s (\"/\"); :local exp (\
    \"\$d\$s\$year \$t\"); /ip hotspot user set comment=\$exp [find where name\
    =\"\$user\"];}; :if (\$getxp = 8) do={ /ip hotspot user set comment=\"\$da\
    te \$exp\" [find where name=\"\$user\"];}; :if (\$getxp > 15) do={ /ip hot\
    spot user set comment=\$exp [find where name=\"\$user\"];}; /sys sch remov\
    e [find where name=\"\$user\"]; [:local mac \$\"mac-address\"; /ip hotspot\
    \_user set mac-address=\$mac [find where name=\$user]]}}" parent-queue=\
    none rate-limit=3M/3M
add name=3J_2000 on-login=":put (\",rem,2000,3h,2000,,Enable,\"); {:local date\
    \_[ /system clock get date ];:local year [ :pick \$date 7 11 ];:local mont\
    h [ :pick \$date 0 3 ];:local comment [ /ip hotspot user get [/ip hotspot \
    user find where name=\"\$user\"] comment]; :local ucode [:pic \$comment 0 \
    2]; :if (\$ucode = \"vc\" or \$ucode = \"up\" or \$comment = \"\") do={ /s\
    ys sch add name=\"\$user\" disable=no start-date=\$date interval=\"3h\"; :\
    delay 2s; :local exp [ /sys sch get [ /sys sch find where name=\"\$user\" \
    ] next-run]; :local getxp [len \$exp]; :if (\$getxp = 15) do={ :local d [:\
    pic \$exp 0 6]; :local t [:pic \$exp 7 16]; :local s (\"/\"); :local exp (\
    \"\$d\$s\$year \$t\"); /ip hotspot user set comment=\$exp [find where name\
    =\"\$user\"];}; :if (\$getxp = 8) do={ /ip hotspot user set comment=\"\$da\
    te \$exp\" [find where name=\"\$user\"];}; :if (\$getxp > 15) do={ /ip hot\
    spot user set comment=\$exp [find where name=\"\$user\"];}; /sys sch remov\
    e [find where name=\"\$user\"]; [:local mac \$\"mac-address\"; /ip hotspot\
    \_user set mac-address=\$mac [find where name=\$user]]}}" parent-queue=\
    none rate-limit=2M/3M
add name=1H_5000 on-login=":put (\",rem,5000,1d,5000,,Enable,\"); {:local date\
    \_[ /system clock get date ];:local year [ :pick \$date 7 11 ];:local mont\
    h [ :pick \$date 0 3 ];:local comment [ /ip hotspot user get [/ip hotspot \
    user find where name=\"\$user\"] comment]; :local ucode [:pic \$comment 0 \
    2]; :if (\$ucode = \"vc\" or \$ucode = \"up\" or \$comment = \"\") do={ /s\
    ys sch add name=\"\$user\" disable=no start-date=\$date interval=\"1d\"; :\
    delay 2s; :local exp [ /sys sch get [ /sys sch find where name=\"\$user\" \
    ] next-run]; :local getxp [len \$exp]; :if (\$getxp = 15) do={ :local d [:\
    pic \$exp 0 6]; :local t [:pic \$exp 7 16]; :local s (\"/\"); :local exp (\
    \"\$d\$s\$year \$t\"); /ip hotspot user set comment=\$exp [find where name\
    =\"\$user\"];}; :if (\$getxp = 8) do={ /ip hotspot user set comment=\"\$da\
    te \$exp\" [find where name=\"\$user\"];}; :if (\$getxp > 15) do={ /ip hot\
    spot user set comment=\$exp [find where name=\"\$user\"];}; /sys sch remov\
    e [find where name=\"\$user\"]; [:local mac \$\"mac-address\"; /ip hotspot\
    \_user set mac-address=\$mac [find where name=\$user]]}}" parent-queue=\
    none rate-limit=1M/2M
add name=30H_35000 on-login=":put (\",rem,35000,30d,35000,,Enable,\"); {:local\
    \_date [ /system clock get date ];:local year [ :pick \$date 7 11 ];:local\
    \_month [ :pick \$date 0 3 ];:local comment [ /ip hotspot user get [/ip ho\
    tspot user find where name=\"\$user\"] comment]; :local ucode [:pic \$comm\
    ent 0 2]; :if (\$ucode = \"vc\" or \$ucode = \"up\" or \$comment = \"\") d\
    o={ /sys sch add name=\"\$user\" disable=no start-date=\$date interval=\"3\
    0d\"; :delay 2s; :local exp [ /sys sch get [ /sys sch find where name=\"\$\
    user\" ] next-run]; :local getxp [len \$exp]; :if (\$getxp = 15) do={ :loc\
    al d [:pic \$exp 0 6]; :local t [:pic \$exp 7 16]; :local s (\"/\"); :loca\
    l exp (\"\$d\$s\$year \$t\"); /ip hotspot user set comment=\$exp [find whe\
    re name=\"\$user\"];}; :if (\$getxp = 8) do={ /ip hotspot user set comment\
    =\"\$date \$exp\" [find where name=\"\$user\"];}; :if (\$getxp > 15) do={ \
    /ip hotspot user set comment=\$exp [find where name=\"\$user\"];}; /sys sc\
    h remove [find where name=\"\$user\"]; [:local mac \$\"mac-address\"; /ip \
    hotspot user set mac-address=\$mac [find where name=\$user]]}}" \
    parent-queue=none rate-limit=2M/3M
add name=pc on-login=":put (\",,0,,,noexp,Enable,\"); [:local mac \$\"mac-addr\
    ess\"; /ip hotspot user set mac-address=\$mac [find where name=\$user]]" \
    parent-queue=none rate-limit=1M/3M
add name=mbahuti on-login=":put (\",,0,,,noexp,Enable,\"); [:local mac \$\"mac\
    -address\"; /ip hotspot user set mac-address=\$mac [find where name=\$user\
    ]]" parent-queue=none rate-limit=1M/2M
add name=7H_10000 on-login=":put (\",rem,10000,7d,10000,,Enable,\"); {:local d\
    ate [ /system clock get date ];:local year [ :pick \$date 7 11 ];:local mo\
    nth [ :pick \$date 0 3 ];:local comment [ /ip hotspot user get [/ip hotspo\
    t user find where name=\"\$user\"] comment]; :local ucode [:pic \$comment \
    0 2]; :if (\$ucode = \"vc\" or \$ucode = \"up\" or \$comment = \"\") do={ \
    /sys sch add name=\"\$user\" disable=no start-date=\$date interval=\"7d\";\
    \_:delay 2s; :local exp [ /sys sch get [ /sys sch find where name=\"\$user\
    \" ] next-run]; :local getxp [len \$exp]; :if (\$getxp = 15) do={ :local d\
    \_[:pic \$exp 0 6]; :local t [:pic \$exp 7 16]; :local s (\"/\"); :local e\
    xp (\"\$d\$s\$year \$t\"); /ip hotspot user set comment=\$exp [find where \
    name=\"\$user\"];}; :if (\$getxp = 8) do={ /ip hotspot user set comment=\"\
    \$date \$exp\" [find where name=\"\$user\"];}; :if (\$getxp > 15) do={ /ip\
    \_hotspot user set comment=\$exp [find where name=\"\$user\"];}; /sys sch \
    remove [find where name=\"\$user\"]; [:local mac \$\"mac-address\"; /ip ho\
    tspot user set mac-address=\$mac [find where name=\$user]]}}" \
    parent-queue=none rate-limit=2M/3M
add name=512 rate-limit="512k / 512k" transparent-proxy=yes
add name=tamu rate-limit=3M/3M shared-users=7 transparent-proxy=yes
add name=100 rate-limit=100k/100k transparent-proxy=yes
add name=ilman
/ip pool
add name=dhcp_pool0 ranges=192.168.22.2-192.168.22.10
add name=hs-pool-3 ranges=10.10.10.11-10.10.10.254
add name=hs-pool-4 ranges=10.10.20.2-10.10.20.254
add name=dhcp_pool3 ranges=10.10.10.2-10.10.10.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=PC lease-time=12h10m name=\
    dhcp1
add address-pool=hs-pool-3 disabled=no interface=SWITCH-AP lease-time=1h \
    name=dhcp2
/ip hotspot
add address-pool=hs-pool-3 addresses-per-mac=100 disabled=no interface=\
    SWITCH-AP name=hotspot1
/ip settings
set accept-redirects=yes
/interface detect-internet
set detect-interface-list=all internet-interface-list=WAN lan-interface-list=\
    LAN wan-interface-list=WAN
/ip address
add address=192.168.22.1/24 interface=PC network=192.168.22.0
add address=10.10.10.1/24 interface=SWITCH-AP network=10.10.10.0
/ip dhcp-client
add disabled=no interface=OPENWRT
/ip dhcp-server network
add address=10.10.10.0/24 comment="hotspot network" gateway=10.10.10.1
add address=192.168.22.0/24 dns-server=192.168.22.1 gateway=192.168.22.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1
/ip firewall filter
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat out-interface=OPENWRT
add action=masquerade chain=srcnat comment="masquerade hotspot network" \
    src-address=10.10.10.0/24
add action=masquerade chain=srcnat comment="masquerade hotspot network" \
    src-address=10.10.20.0/24
/ip hotspot ip-binding
add mac-address=9C:2B:A6:7F:C5:70 to-address=10.10.10.30 type=bypassed
/ip hotspot user
add comment=up- mac-address=68:BF:C4:B7:79:F6 name=mbahuti password=mbahuti \
    profile=512
add comment=vc- mac-address=D8:FE:E3:67:A7:66 name=pc password=pc profile=pc
add mac-address=64:CC:2E:1F:2F:01 name=uwais password=uwais profile=mbahuti
add mac-address=C4:0B:CB:E9:5F:16 name=ammati password=ammati profile=mbahuti
add mac-address=70:5E:55:2B:14:D9 name=caca password=caca profile=512
add mac-address=40:B0:76:62:DC:A8 name=mbaiis password=mbaiis profile=mbahuti
add name=tamuxxx password=tamuxxx profile=tamu
add comment="aug/10/2023 19:23:48" mac-address=88:5A:06:63:54:EF name=nana \
    password=nana profile=30H_35000
add name=dua password=dua profile=2J_1000
add comment="aug/15/2023 20:41:21" mac-address=9C:5F:5A:40:F0:8D name=mbahibu \
    password=mbahibu profile=30H_35000
add name=bypass password=bypass profile=ilman
add comment="aug/22/2023 09:44:17" mac-address=70:4D:E7:8F:C6:85 name=dika \
    password=dika profile=30H_35000
add comment="aug/11/2023 06:29:21" mac-address=F4:63:FC:50:BB:8C name=\
    budelamidi password=budelamidi profile=7H_10000
add comment="aug/14/2023 16:04:57" mac-address=64:A2:00:F9:F2:B0 name=desi \
    password=desi profile=7H_10000
/ip service
set www-ssl disabled=no
/system clock
set time-zone-autodetect=no time-zone-name=Asia/Jakarta
/system identity
set name=UWAISNET
/system logging
add action=disk prefix=-> topics=hotspot,info,debug
/system ntp client
set enabled=yes server-dns-names=id.pool.ntp.org
/system scheduler
add comment="Monitor Profile 2J_1000" interval=2m40s name=2J_1000 on-event=":l\
    ocal dateint do={:local montharray ( \"jan\",\"feb\",\"mar\",\"apr\",\"may\
    \",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" );:local days [\
    \_:pick \$d 4 6 ];:local month [ :pick \$d 0 3 ];:local year [ :pick \$d 7\
    \_11 ];:local monthint ([ :find \$montharray \$month]);:local month (\$mon\
    thint + 1);:if ( [len \$month] = 1) do={:local zero (\"0\");:return [:tonu\
    m (\"\$year\$zero\$month\$days\")];} else={:return [:tonum (\"\$year\$mont\
    h\$days\")];}}; :local timeint do={ :local hours [ :pick \$t 0 2 ]; :local\
    \_minutes [ :pick \$t 3 5 ]; :return (\$hours * 60 + \$minutes) ; }; :loca\
    l date [ /system clock get date ]; :local time [ /system clock get time ];\
    \_:local today [\$dateint d=\$date] ; :local curtime [\$timeint t=\$time] \
    ; :foreach i in [ /ip hotspot user find where profile=\"2J_1000\" ] do={ :\
    local comment [ /ip hotspot user get \$i comment]; :local name [ /ip hotsp\
    ot user get \$i name]; :local gettime [:pic \$comment 12 20]; :if ([:pic \
    \$comment 3] = \"/\" and [:pic \$comment 6] = \"/\") do={:local expd [\$da\
    teint d=\$comment] ; :local expt [\$timeint t=\$gettime] ; :if ((\$expd < \
    \$today and \$expt < \$curtime) or (\$expd < \$today and \$expt > \$curtim\
    e) or (\$expd = \$today and \$expt < \$curtime)) do={ [ /ip hotspot user r\
    emove \$i ]; [ /ip hotspot active remove [find where user=\$name] ];}}}" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=sep/06/2022 start-time=04:25:13
add comment="Monitor Profile 3J_2000" interval=2m34s name=3J_2000 on-event=":l\
    ocal dateint do={:local montharray ( \"jan\",\"feb\",\"mar\",\"apr\",\"may\
    \",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" );:local days [\
    \_:pick \$d 4 6 ];:local month [ :pick \$d 0 3 ];:local year [ :pick \$d 7\
    \_11 ];:local monthint ([ :find \$montharray \$month]);:local month (\$mon\
    thint + 1);:if ( [len \$month] = 1) do={:local zero (\"0\");:return [:tonu\
    m (\"\$year\$zero\$month\$days\")];} else={:return [:tonum (\"\$year\$mont\
    h\$days\")];}}; :local timeint do={ :local hours [ :pick \$t 0 2 ]; :local\
    \_minutes [ :pick \$t 3 5 ]; :return (\$hours * 60 + \$minutes) ; }; :loca\
    l date [ /system clock get date ]; :local time [ /system clock get time ];\
    \_:local today [\$dateint d=\$date] ; :local curtime [\$timeint t=\$time] \
    ; :foreach i in [ /ip hotspot user find where profile=\"3J_2000\" ] do={ :\
    local comment [ /ip hotspot user get \$i comment]; :local name [ /ip hotsp\
    ot user get \$i name]; :local gettime [:pic \$comment 12 20]; :if ([:pic \
    \$comment 3] = \"/\" and [:pic \$comment 6] = \"/\") do={:local expd [\$da\
    teint d=\$comment] ; :local expt [\$timeint t=\$gettime] ; :if ((\$expd < \
    \$today and \$expt < \$curtime) or (\$expd < \$today and \$expt > \$curtim\
    e) or (\$expd = \$today and \$expt < \$curtime)) do={ [ /ip hotspot user r\
    emove \$i ]; [ /ip hotspot active remove [find where user=\$name] ];}}}" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=sep/06/2022 start-time=03:31:51
add comment="Monitor Profile 1H_5000" interval=2m55s name=1H_5000 on-event=":l\
    ocal dateint do={:local montharray ( \"jan\",\"feb\",\"mar\",\"apr\",\"may\
    \",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" );:local days [\
    \_:pick \$d 4 6 ];:local month [ :pick \$d 0 3 ];:local year [ :pick \$d 7\
    \_11 ];:local monthint ([ :find \$montharray \$month]);:local month (\$mon\
    thint + 1);:if ( [len \$month] = 1) do={:local zero (\"0\");:return [:tonu\
    m (\"\$year\$zero\$month\$days\")];} else={:return [:tonum (\"\$year\$mont\
    h\$days\")];}}; :local timeint do={ :local hours [ :pick \$t 0 2 ]; :local\
    \_minutes [ :pick \$t 3 5 ]; :return (\$hours * 60 + \$minutes) ; }; :loca\
    l date [ /system clock get date ]; :local time [ /system clock get time ];\
    \_:local today [\$dateint d=\$date] ; :local curtime [\$timeint t=\$time] \
    ; :foreach i in [ /ip hotspot user find where profile=\"1H_5000\" ] do={ :\
    local comment [ /ip hotspot user get \$i comment]; :local name [ /ip hotsp\
    ot user get \$i name]; :local gettime [:pic \$comment 12 20]; :if ([:pic \
    \$comment 3] = \"/\" and [:pic \$comment 6] = \"/\") do={:local expd [\$da\
    teint d=\$comment] ; :local expt [\$timeint t=\$gettime] ; :if ((\$expd < \
    \$today and \$expt < \$curtime) or (\$expd < \$today and \$expt > \$curtim\
    e) or (\$expd = \$today and \$expt < \$curtime)) do={ [ /ip hotspot user r\
    emove \$i ]; [ /ip hotspot active remove [find where user=\$name] ];}}}" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=sep/06/2022 start-time=03:35:57
add comment="Monitor Profile 30H_35000" interval=2m14s name=30H_35000 \
    on-event=":local dateint do={:local montharray ( \"jan\",\"feb\",\"mar\",\
    \"apr\",\"may\",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" );\
    :local days [ :pick \$d 4 6 ];:local month [ :pick \$d 0 3 ];:local year [\
    \_:pick \$d 7 11 ];:local monthint ([ :find \$montharray \$month]);:local \
    month (\$monthint + 1);:if ( [len \$month] = 1) do={:local zero (\"0\");:r\
    eturn [:tonum (\"\$year\$zero\$month\$days\")];} else={:return [:tonum (\"\
    \$year\$month\$days\")];}}; :local timeint do={ :local hours [ :pick \$t 0\
    \_2 ]; :local minutes [ :pick \$t 3 5 ]; :return (\$hours * 60 + \$minutes\
    ) ; }; :local date [ /system clock get date ]; :local time [ /system clock\
    \_get time ]; :local today [\$dateint d=\$date] ; :local curtime [\$timein\
    t t=\$time] ; :foreach i in [ /ip hotspot user find where profile=\"30H_35\
    000\" ] do={ :local comment [ /ip hotspot user get \$i comment]; :local na\
    me [ /ip hotspot user get \$i name]; :local gettime [:pic \$comment 12 20]\
    ; :if ([:pic \$comment 3] = \"/\" and [:pic \$comment 6] = \"/\") do={:loc\
    al expd [\$dateint d=\$comment] ; :local expt [\$timeint t=\$gettime] ; :i\
    f ((\$expd < \$today and \$expt < \$curtime) or (\$expd < \$today and \$ex\
    pt > \$curtime) or (\$expd = \$today and \$expt < \$curtime)) do={ [ /ip h\
    otspot user remove \$i ]; [ /ip hotspot active remove [find where user=\$n\
    ame] ];}}}" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=sep/06/2022 start-time=03:23:59
add comment="Monitor Profile 7H_10000" interval=2m56s name=7H_10000 on-event="\
    :local dateint do={:local montharray ( \"jan\",\"feb\",\"mar\",\"apr\",\"m\
    ay\",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" );:local days\
    \_[ :pick \$d 4 6 ];:local month [ :pick \$d 0 3 ];:local year [ :pick \$d\
    \_7 11 ];:local monthint ([ :find \$montharray \$month]);:local month (\$m\
    onthint + 1);:if ( [len \$month] = 1) do={:local zero (\"0\");:return [:to\
    num (\"\$year\$zero\$month\$days\")];} else={:return [:tonum (\"\$year\$mo\
    nth\$days\")];}}; :local timeint do={ :local hours [ :pick \$t 0 2 ]; :loc\
    al minutes [ :pick \$t 3 5 ]; :return (\$hours * 60 + \$minutes) ; }; :loc\
    al date [ /system clock get date ]; :local time [ /system clock get time ]\
    ; :local today [\$dateint d=\$date] ; :local curtime [\$timeint t=\$time] \
    ; :foreach i in [ /ip hotspot user find where profile=\"7H_10000\" ] do={ \
    :local comment [ /ip hotspot user get \$i comment]; :local name [ /ip hots\
    pot user get \$i name]; :local gettime [:pic \$comment 12 20]; :if ([:pic \
    \$comment 3] = \"/\" and [:pic \$comment 6] = \"/\") do={:local expd [\$da\
    teint d=\$comment] ; :local expt [\$timeint t=\$gettime] ; :if ((\$expd < \
    \$today and \$expt < \$curtime) or (\$expd < \$today and \$expt > \$curtim\
    e) or (\$expd = \$today and \$expt < \$curtime)) do={ [ /ip hotspot user r\
    emove \$i ]; [ /ip hotspot active remove [find where user=\$name] ];}}}" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=may/13/2023 start-time=05:59:13
/tool traffic-monitor
add interface=OPENWRT name=tmon1