i want to bloc access wan client pppoe
/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN
set [ find default-name=ether5 ] name=ether5-PPPOE
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
add hotspot-address=10.182.0.1 html-directory=hotspot1 login-by=http-chap,trial
name=hpMYWIFI1 trial-uptime-limit=2m trial-uptime-reset=1m use-radius=yes
/ip hotspot user profile
set [ find default=yes ] keepalive-timeout=1h shared-users=unlimited
/ip pool
add name=hs-pool-MYWIFI1 ranges=10.0.0.1-10.0.0.254
add name=ppp-MYWIFI-Expired ranges=10.64.0.100-10.64.254.254
add name=ppp-MYWIFI ranges=10.128.0.100-10.128.254.254
/ip dhcp-server
add address-pool=ppp-MYWIFI disabled=no interface=ether5-PPPOE name=server1
/ip hotspot
add address-pool=hs-pool-MYWIFI1 disabled=no idle-timeout=none interface=ether3
name=MYWIFI1 profile=hpMYWIFI1
/ppp profile
add comment=MYWIFI dns-server=8.8.8.8 local-address=10.0.0.1 name=
MYWIFI-Profile on-up=“if ([:pick $"remote-address" 0 6]="10.64.") do {
\r
\n/ip proxy access\r
\nremove [find src-address="$"remote-address""]\r
\nadd action=deny redirect-to="cp.mywifiservice.com/login/pppko\?nasid=20
576&login=$"user"&ip=$"remote-address"&mac=$"caller-id"" src-addre
ss="$"remote-address""\r
\n}” remote-address=ppp-MYWIFI
/tool user-manager customer
set admin access=
own-routers,own-users,own-profiles,own-limits,config-payment-gw
/tool user-manager profile
add name=“nuovo utente 1 minut” name-for-users=“” override-shared-users=off
owner=admin price=0 starts-at=now validity=1m
add name=“ricarica 1 mese” name-for-users=“” override-shared-users=1 owner=
admin price=0 starts-at=now validity=4w2d
add name=“nuovo 1mese” name-for-users=“” override-shared-users=1 owner=admin
price=15 starts-at=now validity=4w2d
/tool user-manager profile limitation
add address-list=“” download-limit=10485760B group-name=“” ip-pool=“” name=10MB
owner=admin transfer-limit=0B upload-limit=1048576B uptime-limit=0s
/interface pppoe-server server
add authentication=pap default-profile=MYWIFI-Profile disabled=no interface=
ether5-PPPOE max-mru=1488 max-mtu=1488 mrru=1600 one-session-per-host=yes
service-name=Service-MyWiFi
/ip address
add address=10.182.0.1/16 comment=MYWIFI interface=ether3 network=10.182.0.0
add address=10.0.0.1/24 interface=ether5-PPPOE network=10.0.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1-WAN
/ip dhcp-server network
add address=10.182.0.0/16 comment=MYWIFI dns-server=8.8.8.8 gateway=10.182.0.1
/ip dns
set servers=8.8.8.8
/ip firewall address-list
add address=213.199.136.20 list=DontProxy
/ip firewall filter
add action=drop chain=forward dst-address=192.168.1.0/24 src-address=
10.0.0.0/24
add action=passthrough chain=unused-hs-chain comment=“place hotspot rules here”
disabled=yes
add action=reject chain=forward comment=MYWIFI dst-port=!80,8080 protocol=tcp
reject-with=icmp-network-unreachable src-address=10.64.0.0/16
src-address-list=!tempLogin
/ip firewall mangle
add action=add-dst-to-address-list address-list=tempLogin address-list-timeout=
3m chain=forward comment=MYWIFI content=
4ffga95Hm8afki12657dNASPlafs4by5220576 dst-address=10.64.0.0/16 protocol=
tcp src-port=80
add action=add-src-to-address-list address-list=ipToDisconnect chain=forward
comment=MYWIFI content=dummyforpppipdisconnect dst-port=80 protocol=tcp
src-address=10.64.0.0/16
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment=“place hotspot rules here”
disabled=yes
add action=masquerade chain=srcnat comment=MYWIFI src-address=10.182.0.0/16
add action=redirect chain=dstnat comment=MYWIFI dst-address-list=!DontProxy
dst-port=80 protocol=tcp src-address=10.64.0.0/16 src-address-list=
!tempLogin to-ports=8080
add action=masquerade chain=srcnat comment=MYWIFI src-address=10.64.0.0/16
add action=masquerade chain=srcnat comment=MYWIFI src-address=10.128.0.0/16
add action=masquerade chain=srcnat out-interface=all-ethernet
/ip hotspot walled-garden
add comment=“place hotspot rules here” disabled=yes
add comment=“place hotspot rules here” disabled=yes
add comment=MYWIFI dst-host=*.mywifiservice.com server=MYWIFI1
/ip hotspot walled-garden ip
add action=accept comment=MYWIFI disabled=no dst-address=213.199.136.20 server=
MYWIFI1
/ip proxy
set enabled=yes max-cache-size=none
/ip proxy access
add action=deny redirect-to=“cp.mywifiservice.com/login/pppko?nasid=20576&login
=wiritaly02&ip=10.64.254.253&mac=78:8A:20:34:25:48” src-address=
10.64.254.253
add action=deny redirect-to=“cp.mywifiservice.com/login/pppko?nasid=20576&login
=wiritaly02&ip=10.64.254.254&mac=78:8A:20:34:25:48” src-address=
10.64.254.254
add action=deny redirect-to=“cp.mywifiservice.com/login/pppko?nasid=20576&login
=wiritaly02&ip=10.64.0.100&mac=F8:A9:63:4E:C6:98” src-address=10.64.0.100
/ip service
set www port=8088
/ppp aaa
set interim-update=10m use-radius=yes
/radius
add address=213.199.136.20 comment=MYWIFI service=ppp,hotspot timeout=3s
/radius incoming
set accept=yes port=3779
/system clock
set time-zone-name=Europe/Rome
/system identity
set name=20576
/system ntp client
set enabled=yes primary-ntp=83.162.149.224 secondary-ntp=5.79.108.34
/system routerboard settings
set silent-boot=no
/system scheduler
add interval=30m name=UpdateRadiusServer on-event=
“/system script run RadiusServer” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
add interval=2m name=UpdateAlive on-event=“/system script run Alive” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
add interval=30m name=UpdateCaptivePortalIP on-event=
“/system script run CaptivePortalIP” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
add name=RunAliveBoot on-event=“/system script run Alive” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
add interval=5s name=UpdateCPUmonitor on-event=“/system script run CPUmonitor”
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
add interval=15s name=checkPaymentCompleted on-event=
“/system script run PaymentCompleted” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
add interval=30m name=UpdateDontProxyList on-event=
“/system script run DontProxyList” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-time=startup
/system script
add name=RadiusServer owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“:lo
cal radiusname "radius1.mywifiservice.com" \r
\n:local newradiusip [:resolve $"radiusname"]\r
\n:local currentradiusip [/radius get [find comment="MYWIFI"] address]\r
\n:if ($"currentradiusip" != $"newradiusip") do={ /radius set [find co
mment="MYWIFI"] address=$"newradiusip"}”
add name=CaptivePortalIP owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“:lo
cal cpname "cp.mywifiservice.com"
\n:local newcpip [:resolve $"cpname"]\r
\n:local currentcpip [/ip hotspot walled-garden ip get [find comment="MYWIF
I"] dst-address]\r
\n:if ($"currentcpip" != $"newcpip") do={ /ip hotspot walled-garden ip
_set [find comment="MYWIFI"] dst-address=$"newcpip"}”
add name=CPUmonitor owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“:lo
cal maxsamples 20 \r
\n:global cpuarray \r
\n:set cpuarray ([/system resource get cpu-load] , [:pick $cpuarray 0 ($ma
xsamples - 1)]) \r
\n:local arraytot 0 \r
\n:foreach o in=$cpuarray do={:set arraytot ($arraytot + $o)}; \r
\n:local arraysize [:len $cpuarray] \r
\n:global avgcpuload ($arraytot / $arraysize)”
add name=Alive owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“:lo
cal bootPar \r
\n:global avgcpuload \r
\n:global alivecounter \r
\n:if ($alivecounter>0) do={ :set bootPar ""} else={ :set bootPar "-b";
_:delay 10 } \r
\n:set alivecounter ($alivecounter+1) \r
\n:local nproc [/system resource get cpu-count] \r
\n:local model [/system resource get board-name] \r
\n:local memtot [/system resource get total-memory] \r
\n:local mac [/interface get [/interface find default-name=ether1] mac-addre
ss] \r
\n:local memfree [/system resource get free-memory] \r
\n:local hsusers [:len [/ip hotspot active find]] \r
\n:local hsips [:len [/ip hotspot host find]] \r
\n:local pppusers [:len [/ppp active find [:pick $address 0 6]="10.128"]]
_\r
\n:local pppips [:len [/ppp active find]] \r
\n:local upbytes [/interface get ether3 rx-byte] \r
\n:local dwnbytes [/interface get ether3 tx-byte] \r
\n:local url "http://app.mywifiservice.com/script/alive/20576?par=$bootPa
r&mac=$mac&nproc=$nproc&memtot=$memtot&model=$model&cpuload=$avgcpuload
&memfree=$memfree&users=$($hsusers+$pppusers)&ips=$($hsips+$pppips)&d
wnbytes=$dwnbytes&upbytes=$upbytes" \r
\n:local encurl "" \r
\n:for i from=0 to=([:len $url] - 1) do={ :local char [:pick $url $i]; :i
f ($char = " ") do={ :set $char "%20" }; :if ($char = "-") do={ :se
t $char "%2D" }; :set $encurl ($encurl . $char) } \r
\n:if ([:len [/file find name=aliveres.rsc]] > 0) do={ /file remove aliveres
.rsc } \r
\n/tool fetch keep-result=yes dst-path=aliveres.rsc mode=http url="$encurl
";/import aliveres.rsc”
add name=PaymentCompleted owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“:fo
reach i in=[/ip firewall address-list find list=ipToDisconnect] do={\r
\n :local iptd [/ip firewall address-list get $i address]\r
\n /ppp active remove [find address=$iptd]\r
\n /ip firewall address-list remove [find address=$iptd]\r
\n}”
add name=DontProxyList owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“/ip
_firewall address\r
\n remove [find list=DontProxy]\r
\n add address=[:resolve cp.mywifiservice.com] list=DontProxy\r
\n”
/tool user-manager database
set db-path=user-manager
/tool user-manager profile profile-limitation
add from-time=0s limitation=10MB till-time=23h59m59s weekdays=
sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation=10MB till-time=23h59m59s weekdays=
sunday,monday,tuesday,wednesday,thursday,friday,saturday
add from-time=0s limitation=10MB profile=“nuovo 1mese” till-time=23h59m59s
weekdays=sunday,monday,tuesday,wednesday,thursday,friday,saturday
/tool user-manager router
add coa-port=1700 customer=admin disabled=no ip-address=10.0.0.250 log=
auth-ok,auth-fail,acct-ok,acct-fail name=pppoe-server shared-secret=123456
use-coa=yes
[admin@20576] >