Mikrotik Dns Attack rule Script

/ip firewall address-list
add address=10.0.0.0/8 list=DNS_Accept
add address=172.16.0.0/12 list=DNS_Accept
add address=192.168.0.0/16 list=DNS_Accept

############################################################################################################################
#### Add your DNS servers to the DNS_Accept list. Remove and DNS servers you are not using for your router.               ##
############################################################################################################################

add address=8.8.8.8/32 list=DNS_Accept disabled=yes comment="Add DNS Server to this List"
add address=8.8.4.4/32 list=DNS_Accept disabled=yes comment="Add DNS Server to this List"
add address=4.2.2.1/32 list=DNS_Accept disabled=yes comment="Add DNS Server to this List"
add address=4.2.2.2/32 list=DNS_Accept disabled=yes comment="Add DNS Server to this List"


/ip firewall filter
add action=jump chain=input comment="Jump to DNS_DDoS Chain" disabled=no jump-target=DNS_DDoS
add action=accept chain=DNS_DDoS comment="Make exceptions for DNS" disabled=no port=53 protocol=tcp src-address-list=DNS_Accept
add action=accept chain=DNS_DDoS comment="Make exceptions for DNS" disabled=no dst-address-list=DNS_Accept port=53 protocol=tcp
add action=accept chain=DNS_DDoS comment="Make exceptions for DNS" disabled=no port=53 protocol=udp src-address-list=DNS_Accept
add action=accept chain=DNS_DDoS comment="Make exceptions for DNS" disabled=no dst-address-list=DNS_Accept port=53 protocol=udp
add action=add-src-to-address-list address-list=DNS_DDoS address-list-timeout=0s chain=DNS_DDoS comment="Add DNS_DDoS Offenders to Blacklist" disabled=no port=53 protocol=tcp src-address-list=!DNS_Accept
add action=add-src-to-address-list address-list=DNS_DDoS address-list-timeout=0s chain=DNS_DDoS comment="Add DNS_DDoS Offenders to Blacklist" disabled=no port=53 protocol=udp src-address-list=!DNS_Accept
add action=drop chain=DNS_DDoS comment="Drop DNS_DDoS Offenders" disabled=no src-address-list=DNS_DDoS
add action=return chain=DNS_DDoS comment="Return from DNS_DDoS Chain" disabled=no
/

Source : http://rickfreyconsulting.com/articles/

Yorum ekle

Loading