I trying to build my firewall. I found some roules on internet (on excelent Greg site). I'm using 6.34.2 code
My router config
- 4 LAN interfaces
- 1 WAN interface with 4 IPs (every network must have dedicated IP for NAT). It's IP with management services winbox is on x.y.z.170/26.
- every LAN must be sapareated from each other
- my router has DHCP for every LAN
- my router is a DNS proxy for every LAN
My firewall looks like:
Code: Select all
/ip firewall address-list
add address=0.0.0.0/8 comment="Self-Identification [RFC 3330]" disabled=no list=bogons
add address=10.0.0.0/8 comment="Private[RFC 1918] - CLASS A # Check if you need this subnet before enable it" disabled=no list=bogons
add address=127.0.0.0/16 comment="Loopback [RFC 3330]" disabled=no list=bogons
add address=169.254.0.0/16 comment="Link Local [RFC 3330]" disabled=no list=bogons
add address=172.16.0.0/12 comment="Private[RFC 1918] - CLASS B # Check if you need this subnet before enable it" disabled=no list=bogons
#add address=192.168.0.0/16 comment="Private[RFC 1918] - CLASS C # Check if you need this subnet before enable it" disabled=yes list=bogons
add address=192.0.2.0/24 comment="Reserved - IANA - TestNet1" disabled=no list=bogons
add address=192.88.99.0/24 comment="6to4 Relay Anycast [RFC 3068]" disabled=no list=bogons
add address=198.18.0.0/15 comment="NIDB Testing" disabled=no list=bogons
add address=198.51.100.0/24 comment="Reserved - IANA - TestNet2" disabled=no list=bogons
add address=203.0.113.0/24 comment="Reserved - IANA - TestNet3" disabled=no list=bogons
add address=224.0.0.0/4 comment="MC, Class D, IANA # Check if you need this subnet before enable it" disabled=no list=bogons
/ ip firewall filter
add chain=input connection-state=invalid action=drop comment="Drop Invalid connections"
add chain=input connection-state=established action=accept comment="Allow Established connections"
add chain=input protocol=udp action=accept comment="Allow UDP"
add chain=input protocol=icmp action=accept comment="Allow ICMP"
add chain=input src-address=192.168.180.0/24 action=accept comment="Allow access to router from known network"
add chain=input src-address=192.168.190.0/24 action=accept comment="Allow access to router from known network"
add chain=input src-address=192.168.220.0/24 action=accept comment="Allow access to router from known network"
add chain=input src-address=192.168.250.0/24 action=accept comment="Allow access to router from known network"
add chain=input src-address=x.y.z.128/26 action=accept comment="Allow access to router from known network"
add chain=input action=drop comment="Drop anything else"
/ip firewall filter
add chain=forward comment="Accept traffic from VLAN sunets to WAN" out-interface=WAN
add action=reject chain=forward comment="Block communication between all vlan subnet" reject-with=icmp-net-prohibited src-address=192.168.0.1-192.168.255.255
/ip firewall nat
add chain=srcnat action=masquerade src-address=192.168.180.0/24 out-interface=WAN
add chain=srcnat action=masquerade src-address=192.168.190.0/24 out-interface=WAN
add chain=srcnat action=masquerade src-address=192.168.220.0/24 out-interface=WAN
add chain=srcnat action=masquerade src-address=192.168.250.0/24 out-interface=WAN
/ip firewall filter
add action=drop chain=forward comment="Drop to bogon list" disabled=no dst-address-list=bogons
add chain=forward protocol=tcp connection-state=invalid action=drop comment="drop invalid connections"
add chain=forward connection-state=established action=accept comment="allow already established connections"
add chain=forward connection-state=related action=accept comment="allow related connections"
Code: Select all
/tool
mac-server set [find] disabled=yes
mac-server mac-winbox set [find] disabled=yes
mac-server ping set enabled=no
romon set enabled=no
/ip settings set rp-filter=strict
/ip service disable 0,1,2,4,5,7
/tool bandwidth-server set enabled=no
/ip dns set allow-remote-requests=no
/ip socks set enabled=no
1. this rules doesnt limit access to port 53 from internet - why? I'd like to limit access only from dedicated IP to 8192 port from internet only.
2. I can ping from 192.168.250.253 to 192.168.190.1 -this should be prohibited
3. I see on Connection tab from time to time connection from every interface to 255.255.255.255:5678 this should be allowed
4. winbox from 192.168.250.253 see my microtic router - in my opinion discovery is diabled...
I'm new in Mikrotik world, help me please with firewal roules. I'm counting on You and I hope that someone will help me how to correct it.
With regards
Slawek