PFsense to Mikrotik RouterOS v6.47.7 vlans

Hi All,
I’m new to this forum I’m sorry if this isn’t the place to ask this question…

So I have a pfsense device as my FW, and I just purchased a mikrotik device as it’s the cheapest I can find with sfp+ and I’m having some trouble restricting a port to just one vlan tag… I’ve done it in Unifi controller where I had to create a network and then assign a port a vlan tag and it worked fine, but I just can’t get it to work on the mikrotik. Is there something I have to do to get it to work? I just need the switch to be able to force a port to use a vlan tag I’ve created in the FW and use the rules from the firewall. Also one last question.. Will the rules from the FW be remembered in the mikrotik? Meaning the switch will remember rules and route packets where they need to be port-to-port or will it route them back to the FW then to where they need to be (Sorry if dumb question lol)?

You haven’t said which Mikrotik device you have, there are many with a broad range of capabilities and VLAN configuration differs significantly for some groups of devices.


Also one last question.. Will the rules from the FW be remembered in the mikrotik? Meaning the switch will remember rules and route packets where they need to be port-to-port or will it route them back to the FW then to where they need to be (Sorry if dumb question lol)?

Firewalling and routing interact with each other, but are separate processes. The routing determines the destination for ranges of IP addresses, and firewalling permits, drops or modifies packets between source and destination.

If you have a pfSense box to handle firewalling then that is likely to also be providing routing, in which case the Mikrotik would probably just be configured as a layer-2 switch.

Use the switch example here…
http://forum.mikrotik.com/t/using-routeros-to-vlan-your-network/126489/1

Firewalling and routing interact with each other, but are separate processes. The routing determines the destination for ranges of IP addresses, and firewalling permits, drops or modifies packets between source and destination.

If you have a pfSense box to handle firewalling then that is likely to also be providing routing, in which case the Mikrotik would probably just be configured as a layer-2 switch.

So that means even if I have iSCSI traffic the packets will route all the way back up to the FW with 1G ports then back down to the SFP+ ports on the mikrotik? Is there a way to not do that?

That depends on your network architecture. Traffic within a layer2 network will be switched, e.g. IP traffic within the same subnet, whereas traffic between networks has to be routed.

I guess I have had it set up wrong for some time.. I’ve been reading about how to have VLAN tags passed from pfSense to the Switch which is a CRS354-48G-4S+2Q+RM
and I was told that I have to create a bridge with VLAN tag 10 for example, and then assign that bridge to a port? Is that the correct way to segment a port to only 1 VLAN? Also I wanted to create a VLAN for iSCSI is there a way to segment it out in the switch so the traffic moves through the switch and not back up to the FW

Thank you so much for your time! Sorry I’m not very strong with networking, but I have a good understanding of subnetting/vlans just I haven’t set up any mikrotiks before

CR3xx should be configured with a single VLAN-aware bridge as the switch chip is automatically used, a.k.a. hardware offloading. See https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Bridge_VLAN_Filtering and there is a good primer on Mikrotik VLANs in the forums http://forum.mikrotik.com/t/using-routeros-to-vlan-your-network/126489/1

The port connecting to your pfSense can either have all VLANs tagged (a.k.a. ‘trunk’), or one VLAN untagged and the remainder tagged (a.k.a. ‘hybrid’ or ‘trunk with native’).

It is considered to be good practice to separate general and iSCSI traffic, the iSCSI network shouldn’t need access to any other networks or the internet. You could either use separate network interfaces on devices connecting to untagged (a.k.a. ‘access’) switch ports for the appropriate VLANs, or a single network interface connecting to a trunk or hybrid switch port.

I just printed out all kinds of documentation so I can ready over tonight.. in the meantime what would I have to do to have port 3 on the switch pass down VLAN 10 from the fw? So if I were to hook up a device to that port then DHCP witch is in my FW will get passed down to it

One more question :slight_smile: if i have port 6 & 7 tagged for iSCSI then layer 2 switching would happen on the switch and it would not get routed back to the firewall then back down correct?

Thank you again! :slight_smile:

Assuming all of the ports are in a VLAN-aware bridge, so
/interface bridge
add name=bridge protocol-mode=none vlan-filtering=yes
/interface bridge port
add bridge=bridge ingress-filtering=yes interface=ether1
add bridge=bridge ingress-filtering=yes interface=ether2

Then to make ether3 an access port for VLAN 10 (i.e. untagged) change the bridge port PVID
/interface bridge port
add bridge=bridge ingress-filtering=yes interface=ether3 pvid=10

And add VLAN 10 tagged to the port connecting with your pfSense box (you haven’t said which one it is)
/interface bridge vlan
add bridge=bridge tagged=UPLINKPORT vlan-ids=10


One more question :slight_smile: if i have port 6 & 7 tagged for iSCSI then layer 2 switching would happen on the switch and it would not get routed back to the firewall then back down correct?

Yes, the traffic would be switched between those ports.

Ok so I followed your steps and still I’m getting not DHCP from VLAN 10 on port 3.
My FW is on port 2, and I have a device that I want only on VLAN 10 on port 3. I’ve attached some screenshots to show you what I have so far let me know if there’s something wrong here that I should change. I want to pass all my vlans through port 2 from the FW as they have my DHCP/DNS settings in them, and I want only some ports to have just ONE vlan that as soon as something gets plugged into the switch it will automatically pull a DHCP address from the vlan thats on that port

Edit: I’ve had this working with Ubiquity Switch before so I know the vlans are working. I have esxi running right now that I can assign vlan tags to VM’s and theyre getting a DHCP address from the tag

Here is screenshot of SSH session:

Here is ports in Bridge Section

Here is VLANS in Bridge Section

Here is VLAN in Interface Section

Here are my Interfaces

I dont know if the images are showing up heres the full link to the imgur
https://imgur.com/a/0uGo8fh
https://imgur.com/a/0uGo8fh

Screenshots are generally not that helpful.

In a terminal window run /export hide-sensitive and paste the configuration output in a code block (the icon above the reply box) which makes it more readable.

Here’s the export

# nov/05/2020 16:47:03 by RouterOS 6.47.7
# software id = HL5F-WZNX
#
# model = CRS354-48G-4S+2Q+
# serial number = 
/interface bridge
add admin-mac=C4:AD:34:DC:F3:0F auto-mac=no comment=defconf name=bridge vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] l2mtu=1592
set [ find default-name=ether2 ] l2mtu=1592
set [ find default-name=ether3 ] l2mtu=1592
set [ find default-name=ether4 ] l2mtu=1592
set [ find default-name=ether5 ] l2mtu=1592
set [ find default-name=ether6 ] l2mtu=1592
set [ find default-name=ether7 ] l2mtu=1592
set [ find default-name=ether8 ] l2mtu=1592
set [ find default-name=ether9 ] l2mtu=1592
set [ find default-name=ether10 ] l2mtu=1592
set [ find default-name=ether11 ] l2mtu=1592
set [ find default-name=ether12 ] l2mtu=1592
set [ find default-name=ether13 ] l2mtu=1592
set [ find default-name=ether14 ] l2mtu=1592
set [ find default-name=ether15 ] l2mtu=1592
set [ find default-name=ether16 ] l2mtu=1592
set [ find default-name=ether17 ] l2mtu=1592
set [ find default-name=ether18 ] l2mtu=1592
set [ find default-name=ether19 ] l2mtu=1592
set [ find default-name=ether20 ] l2mtu=1592
set [ find default-name=ether21 ] l2mtu=1592
set [ find default-name=ether22 ] l2mtu=1592
set [ find default-name=ether23 ] l2mtu=1592
set [ find default-name=ether24 ] l2mtu=1592
set [ find default-name=ether25 ] l2mtu=1592
set [ find default-name=ether26 ] l2mtu=1592
set [ find default-name=ether27 ] l2mtu=1592
set [ find default-name=ether28 ] l2mtu=1592
set [ find default-name=ether29 ] l2mtu=1592
set [ find default-name=ether30 ] l2mtu=1592
set [ find default-name=ether31 ] l2mtu=1592
set [ find default-name=ether32 ] l2mtu=1592
set [ find default-name=ether33 ] l2mtu=1592
set [ find default-name=ether34 ] l2mtu=1592
set [ find default-name=ether35 ] l2mtu=1592
set [ find default-name=ether36 ] l2mtu=1592
set [ find default-name=ether37 ] l2mtu=1592
set [ find default-name=ether38 ] l2mtu=1592
set [ find default-name=ether39 ] l2mtu=1592
set [ find default-name=ether40 ] l2mtu=1592
set [ find default-name=ether41 ] l2mtu=1592
set [ find default-name=ether42 ] l2mtu=1592
set [ find default-name=ether43 ] l2mtu=1592
set [ find default-name=ether44 ] l2mtu=1592
set [ find default-name=ether45 ] l2mtu=1592
set [ find default-name=ether46 ] l2mtu=1592
set [ find default-name=ether47 ] l2mtu=1592
set [ find default-name=ether48 ] l2mtu=1592
set [ find default-name=qsfpplus1-1 ] l2mtu=1592
set [ find default-name=qsfpplus1-2 ] l2mtu=1592
set [ find default-name=qsfpplus1-3 ] l2mtu=1592
set [ find default-name=qsfpplus1-4 ] l2mtu=1592
set [ find default-name=qsfpplus2-1 ] l2mtu=1592
set [ find default-name=qsfpplus2-2 ] l2mtu=1592
set [ find default-name=qsfpplus2-3 ] l2mtu=1592
set [ find default-name=qsfpplus2-4 ] l2mtu=1592
set [ find default-name=sfp-sfpplus1 ] l2mtu=1592
set [ find default-name=sfp-sfpplus2 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full,10000M-full \
    l2mtu=1592
set [ find default-name=sfp-sfpplus3 ] l2mtu=1592
set [ find default-name=sfp-sfpplus4 ] l2mtu=1592
/interface vlan
add interface=bridge name=vlan10 vlan-id=10
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/user group
set full policy=\
    local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,password,web,sniff,sensitive,api,romon,dude,tikapp
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf frame-types=admit-only-untagged-and-priority-tagged interface=ether3 pvid=10
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=ether9
add bridge=bridge comment=defconf interface=ether10
add bridge=bridge comment=defconf interface=ether11
add bridge=bridge comment=defconf interface=ether12
add bridge=bridge comment=defconf interface=ether13
add bridge=bridge comment=defconf interface=ether14
add bridge=bridge comment=defconf interface=ether15
add bridge=bridge comment=defconf interface=ether16
add bridge=bridge comment=defconf interface=ether17
add bridge=bridge comment=defconf interface=ether18
add bridge=bridge comment=defconf interface=ether19
add bridge=bridge comment=defconf interface=ether20
add bridge=bridge comment=defconf interface=ether21
add bridge=bridge comment=defconf interface=ether22
add bridge=bridge comment=defconf interface=ether23
add bridge=bridge comment=defconf interface=ether24
add bridge=bridge comment=defconf interface=ether25
add bridge=bridge comment=defconf interface=ether26
add bridge=bridge comment=defconf interface=ether27
add bridge=bridge comment=defconf interface=ether28
add bridge=bridge comment=defconf interface=ether29
add bridge=bridge comment=defconf interface=ether30
add bridge=bridge comment=defconf interface=ether31
add bridge=bridge comment=defconf interface=ether32
add bridge=bridge comment=defconf interface=ether33
add bridge=bridge comment=defconf interface=ether34
add bridge=bridge comment=defconf interface=ether35
add bridge=bridge comment=defconf interface=ether36
add bridge=bridge comment=defconf interface=ether37
add bridge=bridge comment=defconf interface=ether38
add bridge=bridge comment=defconf interface=ether39
add bridge=bridge comment=defconf interface=ether40
add bridge=bridge comment=defconf interface=ether41
add bridge=bridge comment=defconf interface=ether42
add bridge=bridge comment=defconf interface=ether43
add bridge=bridge comment=defconf interface=ether44
add bridge=bridge comment=defconf interface=ether45
add bridge=bridge comment=defconf interface=ether46
add bridge=bridge comment=defconf interface=ether47
add bridge=bridge comment=defconf interface=ether48
add bridge=bridge comment=defconf interface=ether49
add bridge=bridge comment=defconf interface=qsfpplus1-1
add bridge=bridge comment=defconf interface=qsfpplus1-2
add bridge=bridge comment=defconf interface=qsfpplus1-3
add bridge=bridge comment=defconf interface=qsfpplus1-4
add bridge=bridge comment=defconf interface=qsfpplus2-1
add bridge=bridge comment=defconf interface=qsfpplus2-2
add bridge=bridge comment=defconf interface=qsfpplus2-3
add bridge=bridge comment=defconf interface=qsfpplus2-4
add bridge=bridge comment=defconf interface=sfp-sfpplus1
add bridge=bridge comment=defconf interface=sfp-sfpplus2
add bridge=bridge comment=defconf interface=sfp-sfpplus3
add bridge=bridge comment=defconf interface=sfp-sfpplus4
/interface bridge settings
set use-ip-firewall-for-vlan=yes
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip settings
set accept-redirects=yes
/interface bridge vlan
# port with pvid added to untagged group which might cause problems, consider adding a seperate VLAN entry
add bridge=bridge vlan-ids=1-4094
/interface list member
add interface=ether49 list=WAN
add interface=ether1 list=LAN
add interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add interface=ether6 list=LAN
add interface=ether7 list=LAN
add interface=ether8 list=LAN
add interface=ether9 list=LAN
add interface=ether10 list=LAN
add interface=ether11 list=LAN
add interface=ether12 list=LAN
add interface=ether13 list=LAN
add interface=ether14 list=LAN
add interface=ether15 list=LAN
add interface=ether16 list=LAN
add interface=ether17 list=LAN
add interface=ether18 list=LAN
add interface=ether19 list=LAN
add interface=ether20 list=LAN
add interface=ether21 list=LAN
add interface=ether22 list=LAN
add interface=ether23 list=LAN
add interface=ether24 list=LAN
add interface=ether25 list=LAN
add interface=ether26 list=LAN
add interface=ether27 list=LAN
add interface=ether28 list=LAN
add interface=ether29 list=LAN
add interface=ether30 list=LAN
add interface=ether31 list=LAN
add interface=ether32 list=LAN
add interface=ether33 list=LAN
add interface=ether34 list=LAN
add interface=ether35 list=LAN
add interface=ether36 list=LAN
add interface=ether37 list=LAN
add interface=ether38 list=LAN
add interface=ether39 list=LAN
add interface=ether40 list=LAN
add interface=ether41 list=LAN
add interface=ether42 list=LAN
add interface=ether43 list=LAN
add interface=ether44 list=LAN
add interface=ether45 list=LAN
add interface=ether46 list=LAN
add interface=ether47 list=LAN
add interface=ether48 list=LAN
add interface=qsfpplus1-1 list=LAN
add interface=qsfpplus1-2 list=LAN
add interface=qsfpplus1-3 list=LAN
add interface=qsfpplus1-4 list=LAN
add interface=qsfpplus2-1 list=LAN
add interface=qsfpplus2-2 list=LAN
add interface=qsfpplus2-3 list=LAN
add interface=qsfpplus2-4 list=LAN
add interface=sfp-sfpplus1 list=LAN
add interface=sfp-sfpplus2 list=LAN
add interface=sfp-sfpplus3 list=LAN
add interface=sfp-sfpplus4 list=LAN
/ip address
add address=192.168.1.130/24 comment=defconf interface=ether1 network=192.168.1.0
/ip dhcp-server network
add address=192.168.10.0/24 gateway=192.168.10.1 netmask=24
/ip dns
set servers=192.168.1.1
/ip route
add distance=1 gateway=192.168.1.1
/system clock
set time-zone-autodetect=no time-zone-name=America/New_York
/system routerboard settings
set boot-os=router-os
#error exporting /system swos

A number of issues…

You only require /interface vlan entries if you wish VLANs to interface with services on the Mikrotik, they are not required for VLANs merely passing through the Mikrotik bridge/switch.

Under /interface bridge port setting frame-types= has no effect unless ingress-filtering=yes.

There is little point having /interface bridge settings use-ip-firewall-for-vlan=yes, with hardware acceleration packets are handled by the switch chip and never make it to the bridge, you can use switch chip rules although these are much more limited.

Adding IP addresses to child interfaces (ether1 in this case) often causes odd behaviour, they should be applied to the parent interface (bridge in this case).

None of those is the cause of your connectivity issue - you haven’t included your firewall uplink port in the bridge VLAN entries, also Mikrotik specifically warn against having untagged members of bridge VLAN entries which specify a range of VLAN IDs (in the configuration export you can see # port with pvid added to untagged group which might cause problems, consider adding a seperate VLAN entry).

I would remove
/interface bridge vlan
add bridge=bridge vlan-ids=1-4094

and replace it with
/interface bridge vlan
add bridge=bridge tagged=ether2 vlan-ids=10
plus additional entires for each VLAN you use.