add action=accept chain=forward out-interface=ether1 protocol=icmp src-address=217.66.55.252
add action=accept chain=forward dst-address=217.66.55.252 out-interface=ether1 protocol=icmp
217.66.55.252 адрес сервера
/ip firewall - все запреты отключены
[admin@RouterOS] > /ip firewall export
# jan/23/2017 00:55:40 by RouterOS 6.38
# software id = YJLW-CR7U
#
/ip firewall address-list
add address=10.77.0.5 comment=4467785733 list=goodboys
add address=10.0.0.100 comment=4462739556 list=goodboys
add address=10.0.1.2 comment=7939974135 list=goodboys
/ip firewall filter
add action=fasttrack-connection chain=forward connection-state=established,related
add action=accept chain=forward comment="default configuration" connection-state=established,related
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input connection-state=established
add action=accept chain=input src-address=10.77.0.0/24
add action=accept chain=input src-address=10.0.0.0/24
add action=accept chain=input src-address=10.0.1.0/24
add action=accept chain=forward out-interface=ether1 protocol=icmp src-address=217.66.55.252
add action=accept chain=forward dst-address=217.66.55.252 out-interface=ether1 protocol=icmp
add action=accept chain=icmp comment="ICMP echo reply" icmp-options=0:0 protocol=icmp
add action=accept chain=icmp comment="ICMP net unreachable" icmp-options=3:0 protocol=icmp
add action=accept chain=icmp comment="ICMP net unreachable" icmp-options=3:0 protocol=icmp
add action=accept chain=icmp comment="ICMP host unreachable" icmp-options=3:1 protocol=icmp
add action=accept chain=icmp comment="ICMP host unreachable fragmentation required" icmp-options=3:4 protocol=icmp
add action=accept chain=icmp comment="ICMP allow source quench" icmp-options=4:0 protocol=icmp
add action=accept chain=icmp comment="ICMP allow echo request" icmp-options=8:0 protocol=icmp
add action=accept chain=icmp comment="ICMP allow time exceed" icmp-options=11:0 protocol=icmp
add action=accept chain=icmp comment="ICMP allow parameter bad" icmp-options=12:0 protocol=icmp
add action=accept chain=input comment="Accept PPTP tunnels" dst-port=1723 protocol=tcp
add action=accept chain=input protocol=gre
add action=accept chain=input comment="Allow Established connections" connection-state=established
add action=accept chain=input comment="Allow Related connections" connection-state=related
add action=accept chain=input comment="Allow SSH" dst-port=22 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=22 in-interface=ether2 protocol=tcp
add action=accept chain=input comment="Allow HTTP" dst-port=80 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=80 in-interface=ether2 protocol=tcp
add action=accept chain=input comment="Allow SNMP" dst-port=161 in-interface=ether1 protocol=udp
add action=accept chain=input dst-port=161 in-interface=ether2 protocol=udp
add action=accept chain=input comment="Allow HTTPS" dst-port=443 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=443 in-interface=ether2 protocol=tcp
add action=accept chain=input comment="Allow OpenVPN" dst-port=1194 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=1194 in-interface=ether1 protocol=udp
add action=accept chain=input dst-port=1194 in-interface=ether2 protocol=tcp
add action=accept chain=input dst-port=1194 in-interface=ether2 protocol=udp
add action=accept chain=input comment=Winbox dst-port=8291 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=8291 in-interface=ether1 protocol=udp
add action=accept chain=input dst-port=8291 in-interface=ether2 protocol=tcp
add action=accept chain=input dst-port=8291 in-interface=ether2 protocol=udp
add action=accept chain=input comment="Allow L2TP tcp" dst-port=1701 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=1701 in-interface=ether2 protocol=tcp
add action=accept chain=input comment="Allow L2TP udp" dst-port=1701 in-interface=ether1 protocol=udp
add action=accept chain=input dst-port=1701 in-interface=ether2 protocol=udp
add action=accept chain=input comment="Allow L2TP IPSec" dst-port=500 protocol=udp
add action=accept chain=input protocol=ipsec-ah
add action=accept chain=forward protocol=ipsec-esp
add action=accept chain=input comment="Allow PPTP" dst-port=1723 in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=1723 in-interface=ether2 protocol=tcp
add action=accept chain=input comment="Allow GRE" in-interface=ether1 protocol=gre
add action=accept chain=input in-interface=ether2 protocol=gre
add action=accept chain=forward comment="Allow Established connections" connection-state=established
add action=accept chain=forward comment="Allow Related connections" connection-state=related
add action=drop chain=forward disabled=yes src-address=192.168.89.0/24
add action=drop chain=input comment="Drop everything else" disabled=yes in-interface=ether1
add action=drop chain=input comment="Drop everything else" disabled=yes in-interface=ether2
add action=drop chain=forward comment="Drop Invalid connections" connection-state=invalid disabled=yes
add action=drop chain=icmp comment="ICMP deny all other types" disabled=yes
add action=drop chain=forward comment="Block Bogon IP Address" disabled=yes src-address=127.0.0.0/8
add action=drop chain=forward disabled=yes dst-address=127.0.0.0/8
add action=drop chain=forward disabled=yes src-address=224.0.0.0/3
add action=drop chain=forward disabled=yes dst-address=224.0.0.0/3
add action=drop chain=input comment="Drop DNS" disabled=yes dst-port=53 in-interface=ether1 protocol=udp
add action=drop chain=input disabled=yes dst-port=53 in-interface=ether1 protocol=tcp
add action=drop chain=input comment="Drop DNS" disabled=yes dst-port=53 in-interface=ether2 protocol=udp
add action=drop chain=input disabled=yes dst-port=53 in-interface=ether2 protocol=tcp
add action=drop chain=input comment="Block hole Windows" disabled=yes dst-port=135,137-139,445,593,4444 protocol=tcp
add action=drop chain=forward disabled=yes dst-port=135,137-139,445,593,4444 protocol=tcp
add action=drop chain=input disabled=yes dst-port=135,137-139 protocol=udp
add action=drop chain=forward disabled=yes dst-port=135,137-139 protocol=udp
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="Port scanners to list" disabled=yes protocol=tcp psd=21,3s,3,1
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="NMAP FIN Stealth scan" disabled=yes protocol=tcp tcp-flags=\
fin,!syn,!rst,!psh,!ack,!urg
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="SYN/FIN scan" disabled=yes protocol=tcp tcp-flags=fin,syn
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="SYN/RST scan" disabled=yes protocol=tcp tcp-flags=syn,rst
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="FIN/PSH/URG scan" disabled=yes protocol=tcp tcp-flags=\
fin,psh,urg,!syn,!rst,!ack
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="ALL/ALL scan" disabled=yes protocol=tcp tcp-flags=\
fin,syn,rst,psh,ack,urg
add action=add-src-to-address-list address-list=port_scanners address-list-timeout=2w chain=input comment="NMAP NULL scan" disabled=yes protocol=tcp tcp-flags=\
!fin,!syn,!rst,!psh,!ack,!urg
add action=drop chain=input comment="dropping port scanners" disabled=yes src-address-list=port_scanners
add action=drop chain=forward comment="dropping port scanners" disabled=yes src-address-list=port_scanners
add action=jump chain=forward comment="Zashita ot DDOS s fiksacyey na 10 minet istochnika i naznacheniya" connection-state=new disabled=yes jump-target=block-ddos
add action=drop chain=forward connection-state=new disabled=yes dst-address-list=ddosed src-address-list=ddoser
add action=return chain=block-ddos disabled=yes dst-limit=50,50,src-and-dst-addresses/10s
add action=add-dst-to-address-list address-list=ddosed address-list-timeout=10m chain=block-ddos disabled=yes
add action=add-src-to-address-list address-list=ddoser address-list-timeout=10m chain=block-ddos disabled=yes
/ip firewall nat
add action=masquerade chain=srcnat disabled=yes
add action=accept chain=srcnat disabled=yes protocol=icmp
add action=accept chain=dstnat disabled=yes protocol=icmp
add action=dst-nat chain=dstnat dst-address=!217.66.55.252 dst-port=80,443 fragment=no protocol=tcp src-address=!217.66.55.252 src-address-list=!goodboys to-addresses=\
217.66.55.252 to-ports=8080
add action=masquerade chain=srcnat out-interface=ether1 src-address=10.0.1.0/24 src-address-list=goodboys
add action=masquerade chain=srcnat out-interface=ether2 src-address=10.0.1.0/24 src-address-list=goodboys
[admin@RouterOS] >
Когда пускаешь пинг на сервере в сторону клиента за микротиком:
root@my:/usr/local/nodeny# ping 10.0.1.2
PING 10.0.1.2 (10.0.1.2) 56(84) bytes of data.
From 217.66.99.250 icmp_seq=1 Destination Host Unreachable
From 217.66.99.250 icmp_seq=2 Destination Host Unreachable
From 217.66.99.250 icmp_seq=3 Destination Host Unreachable
При каждом запуске пинга, в нижних правилах растет трафик:
/ip firewall nat
add action=accept chain=srcnat disabled=yes protocol=icmp
add action=accept chain=dstnat disabled=yes protocol=icmp