Hi all.
I’m facing an issue with setting up a interVLAN filtering firewall rules which drops any connection with one VLAN to another. I have a router with configurated 3 VLANS: vlan31-staff (10.8.31.0/24), vlan32-guest (10.8.32.0/24) and vlan33-iot (10.8.33.0/24).
- vlan31-staff represents the internal network and is suppose to access all Vlans, including the internet
- vlan-ids=32 and vlan-ids=33 represents “host and iot” vlans and should not be able to access any other vlan network, including the router (10.8.31.1) on vlan-ids=31. Should be able to access the internet only!
I have setup firewall rules that should drop any interVlan communication between vlans: vlan32-guest → vlan31-istaff and vlan33-iot → vlan31-istaff
add action=drop chain=forward comment="Drop all Guest Wifi to internal network" in-interface=vlan32-guest out-interface=vlan31-staff
add action=drop chain=forward comment="Drop all from IoT Wifi to internal network" in-interface=vlan33-iot out-interface=vlan31-staff
For some reason even though these rules are present vlan32-guest and vlan33-iot is able to communicate with “vlan31-istaff”.
I can’t figure out what I’m missing / What did I overlooked or didn’t realized.
Any help would be highly appreciated.
Config:
# oct/25/2022 12:55:40 by RouterOS 7.5
# model = RB760iGS
/interface bridge
add ingress-filtering=no name=bridge-local vlan-filtering=yes
/interface ethernet
set [ find default-name=sfp1 ] disabled=yes
/interface wireguard
add listen-port=13231 mtu=1420 name=vpn-dtml-core
/interface vlan
add interface=bridge-local name=vlan31-staff vlan-id=31
add interface=bridge-local name=vlan32-guest vlan-id=32
add interface=bridge-local name=vlan33-iot vlan-id=33
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp-pool-staff ranges=10.8.31.20-10.8.31.249
add name=dhcp-pool-guest ranges=10.8.32.20-10.8.32.249
add name=dhcp-pool-iot ranges=10.8.33.20-10.8.33.249
/ip dhcp-server
add address-pool=dhcp-pool-staff interface=vlan31-staff name=dhcp-staff
add address-pool=dhcp-pool-guest interface=vlan32-guest name=dhcp-guest
add address-pool=dhcp-pool-iot interface=vlan33-iot name=dhcp-iot
/port
set 0 name=serial0
/system logging action
set 0 memory-lines=5000
/interface bridge port
add bridge=bridge-local frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=no interface=\
ether2 multicast-router=disabled pvid=31
add bridge=bridge-local frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=no interface=\
ether3 multicast-router=disabled pvid=31
add bridge=bridge-local frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=no interface=\
ether4 multicast-router=disabled pvid=31
add bridge=bridge-local ingress-filtering=no interface=ether5 multicast-router=disabled pvid=31
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface bridge vlan
add bridge=bridge-local tagged=bridge-local untagged=ether2,ether3,ether4,ether5 vlan-ids=31
add bridge=bridge-local tagged=ether5,bridge-local vlan-ids=32
add bridge=bridge-local tagged=ether5,bridge-local vlan-ids=33
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add disabled=yes interface=sfp1 list=LAN
add interface=*9 list=WAN
add interface=bridge-local list=LAN
add interface=*B list=WAN
/interface ovpn-server server
set auth=sha1,md5
/interface wireguard peers
add allowed-address=10.255.69.7/32,10.7.0.0/16,172.27.11.0/24,10.38.65.0/24 comment="Router in Prague Office" \
endpoint-address=*** endpoint-port=13231 interface=vpn-dtml-core persistent-keepalive=25s \
public-key=***"
add allowed-address=10.255.69.9/32,10.9.0.0/16 comment="Router in Brno Office" endpoint-address=*** \
endpoint-port=13231 interface=vpn-dtml-core persistent-keepalive=25s public-key=\
"***"
/ip address
add address=10.8.31.1/24 interface=vlan31-staff network=10.8.31.0
add address=10.8.32.1/24 interface=vlan32-guest network=10.8.32.0
add address=10.8.33.1/24 interface=vlan33-iot network=10.8.33.0
add address=10.255.69.8/24 interface=vpn-dtml-core network=10.255.69.0
/ip dhcp-client
add disabled=yes interface=bridge-local
add interface=ether1 use-peer-dns=no
/ip dhcp-server lease
add address=10.8.31.2 client-id=ff:b6:22:f:eb:0:2:0:0:ab:11:c5:c0:54:f2:a7:4b:fd:1c mac-address=\
1C:69:7A:A8:23:D1 server=dhcp-staff
add address=10.8.31.3 client-id=1:78:45:58:88:c8:33 mac-address=78:45:58:88:C8:33 server=dhcp-staff
/ip dhcp-server network
add address=10.8.31.0/24 dns-server=10.8.31.1 gateway=10.8.31.1
add address=10.8.32.0/24 dns-server=10.8.31.1 gateway=10.8.32.1
add address=10.8.33.0/24 dns-server=10.8.31.1 gateway=10.8.33.1
/ip dns
set allow-remote-requests=yes cache-max-ttl=30s cache-size=512KiB max-concurrent-queries=500 \
max-concurrent-tcp-sessions=200 servers=10.8.31.2
/ip firewall filter
add action=accept chain=input comment=WireGuard dst-port=13231 protocol=udp src-address=10.255.69.7
add action=accept chain=input comment="Accept established, related" connection-state=established,related
add action=accept chain=forward comment="Accept established, related" connection-state=established,related
add action=drop chain=forward comment="Drop invalid" connection-state=invalid
add action=accept chain=input comment=ICMP protocol=icmp
add action=drop chain=input comment="Drop invalid" connection-state=invalid
add action=drop chain=forward comment="Drop all Guest Wifi to internal network." in-interface=\
vlan32-guest out-interface=vlan31-staff
add action=drop chain=forward comment="Drop all from IoT Wifi to internal network." in-interface=\
vlan33-iot out-interface=vlan31-staff
/ip firewall nat
add action=masquerade chain=srcnat src-address=10.8.32.0/24
add action=masquerade chain=srcnat src-address=10.8.31.0/24
add action=masquerade chain=srcnat src-address=10.8.33.0/24
add action=masquerade chain=srcnat comment=Default out-interface=ether1
/ip route
add disabled=yes distance=1 dst-address=10.7.31.0/24 gateway=10.8.31.2 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=10.7.31.0/24 gateway=vpn-dtml-core pref-src=0.0.0.0 routing-table=main \
scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=10.9.0.0/16 gateway=vpn-dtml-core pref-src=0.0.0.0 routing-table=main \
scope=30 suppress-hw-offload=no target-scope=10