Goals:
Since I’m always living on BASE_VLAN, BASE_VLAN should have access to any VLANs and internet.
All other VLANs should only be able to access the internet and machines that are within the same VLAN.
Basic security.
VLANs:
BASE_VLAN - used only by my personal devices
SERVERS_VLAN - used by hypervisor
GUESTS_VLAN - used by work pc, IOT devices and AP
I’ve run into two issues so far:
Time sync on windows hosts isn’t working. Had to set up NTP client and server on the router and manually configure windows hosts to target the router as their NTP server.
During SMB file transfers between VLANs/ports, router CPU usage peaks at 30% and transfer speed is limited to 50mb/s. However, file transfers within the same VLAN are 10x faster. Wired connection is used when transferring files.
Can anyone experienced take a look at my firewall rules and give some recommendations?
Firewall rules:
/ip firewall filter
add action=accept chain=input comment="Allow Estab & Related" connection-state=established,related
add action=drop chain=input comment="drop invalid" connection-state=invalid
add action=drop chain=input comment="defconf: drop all not coming from VLAN" in-interface-list=!VLAN
add action=accept chain=input comment="Allow VLAN" in-interface-list=VLAN
add action=accept chain=input comment="Allow Base_Vlan Full Access" in-interface=BASE_VLAN
add action=drop chain=input comment=Drop
add action=accept chain=forward comment="Allow Estab & Related" connection-state=established,related
add action=accept chain=forward comment="VLAN Internet Access only" connection-state=new in-interface-list=VLAN out-interface-list=WAN
add action=accept chain=forward comment="Allow BASE access any VLAN" in-interface-list=BASE out-interface-list=VLAN
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment=Drop
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="Default masquerade" out-interface-list=WAN"
First one may be related to firewall rules but second one most likely to VLAN setup.
First guess: your VLANs are being routed through CPU instead of HW offloaded.
If you look at bridge ports, do the related ports have H in front of them or not ?
So we may have to take a look at your full config (minus serial and other private info).
Order of entries in firewall is crucial. It starts at top and goes down…
For the input
add action=accept chain=input comment=“Allow Estab & Related” connection-state=established,related
add action=drop chain=input comment=“drop invalid” connection-state=invalid
add action=drop chain=input comment=“defconf: drop all not coming from VLAN” in-interface-list=!VLAN
add action=accept chain=input comment=“Allow VLAN” in-interface-list=VLAN
add action=accept chain=input comment=“Allow Base_Vlan Full Access” in-interface=BASE_VLAN
add action=drop chain=input comment=Drop
Nothing that is not in the list VLAN gets past that rule, even your BASE_VLAN. That entry should be removed.
And for the forward order should look like this
add action=fasttrack-connection chain=forward comment=“defconf: fasttrack” connection-state=established,related
add action=accept chain=forward comment=“defconf: accept established,related, untracked” connection-state=established,related,untracked
add action=drop chain=forward comment=“defconf: drop invalid” connection-state=invalid
add action=accept chain=forward comment=“VLAN Internet Access only” connection-state=new in-interface-list=VLAN out-interface-list=WAN
add action=accept chain=forward comment=“Allow BASE access any VLAN” in-interface-list=BASE out-interface-list=VLAN
add action=drop chain=forward comment=“Drop”
After couple attempts, I finally moved VLANs to the switch chip.
Each machine is acquiring its correct IP address from the respective VLAN’s DHCP service as with the previous configuration.
However, I’m now experiencing issues:
I’m unable to ping between machines in different VLANs.
Pinging between machines within the same VLAN results in timeouts.
The router’s ping tool also times out.
Internet access is unavailable from within the VLANs.
Some machines can’t be remotely accessed while on the same VLAN. This might be related to cache issues maybe…
When connected to Wifi, it doesn’t assign IP, but I didn’t tried to configure it yet.
Any ideas?
Here is updated config:
/interface bridge
add name=BR1
/interface ethernet
set [ find default-name=ether5 ] advertise=10M-half,10M-full,100M-half
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=2G \
wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=5G \
wireless-protocol=802.11
/interface vlan
add interface=BR1 name=BASE_VLAN vlan-id=99
add interface=BR1 name=GUESTS_VLAN vlan-id=200
add interface=BR1 name=SERVERS_VLAN vlan-id=100
/interface ethernet switch port
set 1 default-vlan-id=100 vlan-mode=secure
set 2 default-vlan-id=99 vlan-mode=secure
set 3 default-vlan-id=200 vlan-mode=secure
set 4 default-vlan-id=200 vlan-mode=secure
set 5 vlan-mode=secure
/interface list
add name=WAN
add name=VLAN
add name=BASE
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk mode=dynamic-keys supplicant-identity=MikroTik
/ip pool
add name=SERVERS_POOL ranges=192.168.100.10-192.168.100.254
add name=GUESTS_POOL ranges=192.168.200.10-192.168.200.254
add name=BASE_POOL ranges=192.168.89.10-192.168.89.254
/ip dhcp-server
add address-pool=SERVERS_POOL disabled=no interface=SERVERS_VLAN name=SERVERS_DHCP
add address-pool=GUESTS_POOL disabled=no interface=GUESTS_VLAN name=GUESTS_DHCP
add address-pool=BASE_POOL disabled=no interface=BASE_VLAN name=BASE_DHCP
/interface bridge port
add bridge=BR1 interface=ether2
add bridge=BR1 interface=ether3
add bridge=BR1 interface=ether4
add bridge=BR1 interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=BASE
/interface ethernet switch vlan
add independent-learning=no ports=ether2,switch1-cpu switch=switch1 vlan-id=100
add independent-learning=no ports=ether3,switch1-cpu switch=switch1 vlan-id=99
add independent-learning=no ports=ether5,switch1-cpu switch=switch1 vlan-id=200
/interface list member
add interface=ether1 list=WAN
add interface=BASE_VLAN list=VLAN
add interface=SERVERS_VLAN list=VLAN
add interface=GUESTS_VLAN list=VLAN
add interface=BASE_VLAN list=BASE
/ip address
add address=192.168.200.1/24 interface=GUESTS_VLAN network=192.168.200.0
add address=192.168.100.1/24 interface=SERVERS_VLAN network=192.168.100.0
add address=192.168.89.1/24 interface=BASE_VLAN network=192.168.89.0
/ip dhcp-client
add disabled=no interface=ether1
/ip dhcp-server lease
add address=192.168.100.11 client-id=1:5e:6d:73:13:b0:d7 mac-address=5E:6D:73:13:B0:D7 server=SERVERS_DHCP
add address=192.168.100.10 mac-address=70:85:C2:93:88:64 server=SERVERS_DHCP
add address=192.168.100.102 client-id=ff:ca:53:9:5a:0:2:0:0:ab:11:2f:b8:1b:3c:f4:79:a0:ce mac-address=96:66:CA:85:6E:97 server=SERVERS_DHCP
add address=192.168.100.100 client-id=ff:ca:53:9:5a:0:2:0:0:ab:11:d2:9:f8:54:78:24:ce:1e mac-address=A6:E7:4C:74:C1:32 server=SERVERS_DHCP
/ip dns
set allow-remote-requests=yes
/ip firewall filter
add action=accept chain=input comment="Allow Estab & Related" connection-state=established,related
add action=drop chain=input comment="drop invalid" connection-state=invalid
add action=drop chain=input comment="defconf: drop all not coming from VLAN" in-interface-list=!VLAN
add action=accept chain=input comment="Allow VLAN" in-interface-list=VLAN
add action=accept chain=input comment="Allow Base_Vlan Full Access" in-interface=BASE_VLAN
add action=drop chain=input comment=Drop
add action=accept chain=forward comment="Allow Estab & Related" connection-state=established,related
add action=accept chain=forward comment="VLAN Internet Access only" connection-state=new in-interface-list=VLAN out-interface-list=WAN
add action=accept chain=forward comment="Allow BASE access any VLAN" in-interface-list=BASE out-interface-list=VLAN
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment=Drop
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="Default masquerade" out-interface-list=WAN
/ip service
set telnet disabled=yes
set ftp disabled=yes
set ssh disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/system clock
set time-zone-name=Europe/Riga
/system ntp client
set enabled=yes primary-ntp=89.111.54.85 secondary-ntp=94.100.3.214
/system ntp server
set broadcast=yes enabled=yes
/tool mac-server
set allowed-interface-list=BASE
/tool mac-server mac-winbox
set allowed-interface-list=BASE