Wednesday, March 16, 2011

/IP Firewall Microtik Router



IP Firewall
 ip firewall filter
add chain=input protocol=tcp dst-port=1337 action=add-src-to-address-list address-list=knock \ address-list-timeout=15s comment="" disabled=no
add chain=input protocol=tcp dst-port=7331 src-address-list=knock action= add-src-to-address-list \ address-list=safe address-list-timeout=15m comment="" disabled=no
add IP address in list. So that only this IP address can full acses to mikrotik router.

add chain=input connection-state=established action=accept comment="accept established connection packets" disabled=no   
add chain=input connection-state=related action=accept comment="accept related connection packets" disabled=no   
add chain=input connection-state=invalid action=drop comment="drop invalid packets" disabled=no

add chain=input src-address-list=safe action=accept comment="Allow access to router from known network" disabled=no

add chain=input protocol=tcp psd=21,3s,3,1 action=drop comment="detect and drop port scan connections" disabled=no
add chain=input protocol=tcp connection-limit=3,32 src-address-list=black_list action=tarpit \ comment="suppress DoS attack" disabled=no
add chain=input protocol=tcp connection-limit=10,32 action= add-src-to-address-list \ address-list=black_list address-list-timeout=1d comment="detect DoS attack" disabled=no
add chain=input protocol=icmp action=jump jump-target=ICMP comment="jump to chain ICMP" disabled=no
add chain=input dst-address-type=broadcast action=accept comment="Allow Broadcast Traffic" disabled=no
add chain=input action=log log-prefix="Filter:" comment="" disabled=no
add chain=input action=drop comment="drop everything else" disabled=no
add chain=ICMP protocol=icmp icmp-options=0:0-255 limit=5,5 action=accept comment="0:0 and limit for 5pac/s" disabled=no   
add chain=ICMP protocol=icmp icmp-options=3:3 limit=5,5 action=accept comment="3:3 and limit for 5pac/s" disabled=no   
add chain=ICMP protocol=icmp icmp-options=3:4 limit=5,5 action=accept comment="3:4 and limit for 5pac/s" disabled=no   
add chain=ICMP protocol=icmp icmp-options=8:0-255 limit=5,5 action=accept comment="8:0 and limit for 5pac/s" disabled=no   
add chain=ICMP protocol=icmp icmp-options=11:0-255 limit=5,5 action=accept comment="11:0 and limit for 5pac/s" disabled=no   
add chain=ICMP protocol=icmp action=drop comment="Drop everything else"     disabled=no   
add chain=services src-address-list=127.0.0.1 dst-address=127.0.0.1 action=accept comment="accept localhost" disabled=no   
add chain=services protocol=udp dst-port=20561 action=accept comment="allow MACwinbox " disabled=no   
add chain=services protocol=tcp dst-port=2000 action=accept comment="Bandwidth server" disabled=no   
add chain=services protocol=udp dst-port=5678 action=accept comment=" MT Discovery Protocol" disabled=no   
add chain=services protocol=tcp dst-port=161 action=accept comment="allow SNMP" disabled=yes  
add chain=services protocol=tcp dst-port=179 action=accept comment="Allow BGP" disabled=yes  
add chain=services protocol=udp dst-port=5000-5100 action=accept comment="allow BGP" disabled=yes  
add chain=services protocol=udp dst-port=123 action=accept comment="Allow NTP" disabled=yes  
add chain=services protocol=tcp dst-port=1723 action=accept comment="Allow PPTP" disabled=yes   
add chain=services protocol=gre action=accept comment="allow PPTP and EoIP" disabled=yes   
add chain=services protocol=tcp dst-port=53 action=accept comment="allow DNS request" disabled=yes   
add chain=services protocol=udp dst-port=53 action=accept comment="Allow DNS request" disabled=yes   
add chain=services protocol=udp dst-port=1900 action=accept comment="UPnP" disabled=yes   
add chain=services protocol=tcp dst-port=2828 action=accept comment="UPnP" disabled=yes   
add chain=services protocol=udp dst-port=67-68 action=accept comment="allow DHCP" disabled=yes   
add chain=services protocol=tcp dst-port=8080 action=accept comment="allow Web Proxy" disabled=yes   
add chain=services protocol=ipencap action=accept comment="allow IPIP" disabled=yes   
add chain=services protocol=tcp dst-port=443 action=accept comment="allow https for Hotspot" disabled=yes   
add chain=services protocol=tcp dst-port=1080 action=accept comment="allow Socks for Hotspot" disabled=yes   
add chain=services protocol=udp dst-port=500 action=accept comment="allow IPSec connections" disabled=yes   
add chain=services protocol=ipsec-esp action=accept comment="allow IPSec" disabled=yes   
add chain=services protocol=ipsec-ah action=accept comment="allow IPSec" disabled=yes   
add chain=services protocol=udp dst-port=520-521 action=accept comment="allow RIP" disabled=yes   
add chain=services protocol=ospf action=accept comment="allow OSPF" disabled=yes   
add chain=services action=return comment="" disabled=no  

0 comments:

Post a Comment