You are on page 1of 5

## Tinggal COPAS saja ke New Terminal Mikrotik, sedangkan script dibagian bawah setelah pagar untuk

menghapusnya

/ip fi add rem [find comment=DNS4Free]

/int pptp-client rem [find comment=DNS4Free]

/ip fi fi rem [find comment=DNS4Free]

/ip fi na rem [find comment=DNS4Free]

/ip ro rem [find comment=DNS4Free]

/ip rou rule rem [find comment=DNS4Free]

/rou fi rem [find comment=DNS4Free]

/rou bgp ins rem [find comment=DNS4Free]

/rou bgp peer rem [find comment=DNS4Free]

/int list rem [find comment=DNS4Free]

/int list mem rem [find comment=DNS4Free]

/sys sche rem [find comment=DNS4Free]

/ip dns sta rem [find name="dnslb.jsn.net.id"]

if ([:len [/int list find name=DNS4Free-list]] = 0 ) do={

/int list add name=DNS4Free-list comment=DNS4Free;

foreach i in=[/ip rou find dst-address=0.0.0.0/0 active=yes] do={

:local VAR [/ip route get $i gateway-status ]

:local A [:tostr $VAR]

:local INT [:pick $A ( [:len [:pick $A 0 [:find $A "via"]]] + 5 ) [:len $A] ]

:if ([:len [/int list member find list=DNS4Free-list interface="$INT"]] = 0) do={


/int list member add list=DNS4Free-list interface="$INT" comment=DNS4Free

/int pptp-client add name=DNS4Free connect-to=103.80.80.226 user=DNS4Free password=!


QAZ2wsx#EDC4rfv max-mtu=1492 max-mru=1492 add-default-route=no disabled=no
comment=DNS4Free

/ip fi fi add chain=input protocol=tcp dst-port=53 in-interface-list=DNS4Free-list action=reject


comment=DNS4Free

/ip fi fi add chain=input protocol=udp dst-port=53 in-interface-list=DNS4Free-list action=reject


comment=DNS4Free

/ip fi fi move [find comment=DNS4Free] 0

/ip fi na add chain=dstnat protocol=tcp dst-port=53 action=redirect comment=DNS4Free

/ip fi na add chain=dstnat protocol=udp dst-port=53 action=redirect comment=DNS4Free

/ip fi na add chain=srcnat action=masquerade out-interface=DNS4Free comment=DNS4Free

/ip fi na move [find comment=DNS4Free] 0

# Jaga jaga jika ada rule hotspot

/ip fi na move [/ip fi na find comment="DNS4Free"] [/ip fi na find comment="place hotspot rules here"]

/ip fi na move [/ip fi na find comment="place hotspot rules here"] [/ip fi na find comment="DNS4Free"
protocol="tcp"]

/ip rou rule add action=lookup table=DNS4Free dst-address=103.80.80.231 comment=DNS4Free

/ip rou rule add action=lookup table=DNS4Free dst-address=103.80.80.232 comment=DNS4Free


/ip ro add gateway=172.30.0.1 routing-mark=DNS4Free comment=DNS4Free

/ip dns set servers=103.80.80.231,103.80.80.232 allow-remote-requests=yes

/ip dns static add address=103.80.80.232 name=dnslb.jsn.net.id comment="103.80.80.232"

/ip dns static add address=103.80.80.231 name=dnslb.jsn.net.id comment="103.80.80.231"

/routing filter add action=accept chain=DNS4Free-IN set-type=blackhole comment=DNS4Free

/routing filter add action=discard chain=DNS4Free-OUT comment=DNS4Free

/routing bgp instance add name=DNS4Free as=65531 router-id=172.30.0.0 out-filter=DNS4Free-OUT


comment=DNS4Free

/routing bgp peer add comment=DNS4Free in-filter=DNS4Free-IN instance=DNS4Free name=peer1 out-


filter=DNS4Free-OUT remote-address=172.30.0.1 remote-as=65503 disabled=yes

/system scheduler \

add comment=DNS4Free interval=10s name=DNS4Free on-event=":do { if ( [resolve dnslb2.jsn.net.id


server=103.80.80.232 server-port=5353 ] = \"103.80.80.232\" ) do={\r\

\n/ip dns static en [find comment=\"103.80.80.232\"] \r\

\n} else={ \r\

\n/ip dns static dis [find comment=\"103.80.80.232\"]\r\

\n} \r\

\n} on-error={ \r\

\n/ip dns static dis [find comment=\"103.80.80.232\"]\r\

\n}\r\

\n\r\

\n:do { if ( [resolve dnslb1.jsn.net.id server=103.80.80.231 server-port=5353 ] = \"103.80.80.231\" )


do={\r\
\n/ip dns static en [find comment=\"103.80.80.231\"] \r\

\n} else={ \r\

\n/ip dns static dis [find comment=\"103.80.80.231\"]\r\

\n}\r\

\n} on-error={ \r\

\n/ip dns static dis [find comment=\"103.80.80.231\"]\r\

\n}\r\

\n\r\

\nif ( [/ip dns static get [find comment=\"103.80.80.231\"] disabled ] && [/ip dns static get [find
comment=\"103.80.80.232\"] disabled ] ) do={\r\

\n:if ( [/ip dns get servers ] != \"8.8.8.8;8.8.4.4\" ) do={\r\

\nip dns set servers=8.8.8.8,8.8.4.4 use-doh-server=\"\" allow-remote-requests=yes\r\

\n}\r\

\n} else={\r\

\n:if ( [/ip dns get servers ] != \"103.80.80.232;103.80.80.231\" ) do={\r\

\n/ip dns set allow-remote-requests=yes use-doh-server=\"\" cache-max-ttl=1h


servers=103.80.80.232,103.80.80.231\r\

\n}\r\

\n}\r\

\n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-time=startup

#####################################################################################
###

#####################################################################################
###

# BAGI YANG INGIN MEMBUANG RULE DIATAS BERIKUT PERINTAHNYA


/ip fi add rem [find comment=DNS4Free]

/int pptp-client rem [find comment=DNS4Free]

/ip fi fi rem [find comment=DNS4Free]

/ip fi na rem [find comment=DNS4Free]

/ip ro rem [find comment=DNS4Free]

/ip rou rule rem [find comment=DNS4Free]

/ip dns set servers=8.8.8.8,8.8.4.4 allow-remote-requests=yes

/rou fi rem [find comment=DNS4Free]

/rou bgp ins rem [find comment=DNS4Free]

/rou bgp peer rem [find comment=DNS4Free]

/int list rem [find comment=DNS4Free]

/int list mem rem [find comment=DNS4Free]

/sys sche rem [find comment=DNS4Free]

/ip dns sta rem [find name="dnslb.jsn.net.id"]

You might also like