Basically I want to isolate an AP for guest/unsafe, from the rest of the network. Currently the router is using a PPP connection on WAN and performing NAT(the traffic is going to a switch via eth2). I have a managed switch where I will configure 2 VLANs(one for the safe network and one for the unsafe/guest AP).
Do you have any ideas on how should I proceed with altering the existing configuration?
The AP cannot read VLANs, but I have a dedicated AP for unsafe wifi.
I only created 2 VLANs in the router(safe network, unsafe network), but I don’t know how to continue.
I was hoping that I could mark somehow the packets with a VLAN tag based on their subnet in the Firewall section, but it seems that this “shortcut” isn’t possible.
The problem is that I only have basic CCNA1 knowledge, I don’t have network architecture design skills and I also don’t know how to organize the steps to not screw up the connectivity with the router.
It will take months for me to learn VLANs in general, VLANs on mikrotik routers and how to design the solution and figure out the steps needed.
Btw, I only have a simple masquerading rule on the router.
The only certification of our friendly @anav is the one noted in his forum signature. And didn’t take him months to get a grip on things. OK, perhaps it took more than that and sometimes he still struggles .
The point is that this forum is about sharing knowledge, not about spoon feeding or free consultancy services. And it’s not that hard, you’re mentioning CCNA and if you can get that without knowledge as basic as VLAN fundamentals, then my regard of CC certs just dropped to underground.
Max, then follow the guidance on assistance, because communication in IT, is key!!! Learn how to articulate requirements and the rest will follow! https://forum.mikrotik.com/viewtopic.php?t=182373
Click on the link entitled - HAVING ISSUES AND NEED HELP READ THIS FIRST
The setup you are asking for is very basic.
Create bridge.
Assign vlans to the bridge ( one vlan for every subnet you have on the router).
Give vlans ip pool, dhcpserver, dhcpservernetwork, ip address
assign /interface bridge ports
assign /interface bridge vlans
ensure firewall rules are okay for your needs
ensure ip routes are okay for your needs
turn on bridge vlan filtering
basically done…
This is what I put on the switch:
And on the router:
Which menus do I have to access for this step?
“Give vlans ip pool, dhcpserver, dhcpservernetwork, ip address”
The switch setup IS WRONG!!
DO NOT USE PORT BASED VLANS, you want 802.1Q VLANS
When you do…
VLAN1 is the default vlan or native vlan and is out of the box assigned to every port (untagged).
For trunk ports that are carrying vlans, the native or default vlan stays put as is!
For access ports that get untagged traffic from dumb devices, tag the traffic heading to the router and out the internet and then untag the return traffic before hitting the dumb device Replace vlan1 with THE PVID of the untagged vlan that is supposed to go through that port.
(1) I do not see any vlans defined??
they need to be assigned with parent interface of the bridge,
then they each need, IP pool, IP address, IP dhcp-server, IP dhcp-server-network settings!!
(okay I see pools etc…)
(2) Get rid of list discover its not required and does nothing for you.
(3) Similarly get rid of any interface list members to discover.
All you need is vlan2 to LAN, vlan3 to LAN and ether1 to WAN.
(4) IP addresses are set to ports, need to be set to vlan2 and vlan3 as interfaces..
(5) Need /interface bridge ports and /interface bridge vlans
The /interface bridge vlans looks more like you were trying to create/identify vlans which needs to be done in the interface menu.
/interface bridge ports -->Here you want to identify if the port is going to be a trunk port or an access port (need pvid for access port).
/interface bridge vlans → Here you want to identify the tagging and untagging of ports
(6) Source nat ----> I dont understand what you are trying to do and would stick to the standard rule until you can describe the requirement and the appropriate config rule can be put in place…
(7) WHy so wide open ??? set winbox address=10.0.0.0/8
Thank you for your post, but it’s too complex for me.
Have no idea how to do most of those steps, and I’m 95% sure I’ll end up losing connection to the router at some point by a wrong order of operations mistake.
I regret buying the switch, the sdcard and the camera. Now I have to sell them.
LE: this is already like this, so I don’t know what’s the problem:
As @anav (*) pointed out, currently you don’t have any VLANs. If you need only one cable between router and switch and everything else should be connected to switch, then you don’t need to bother with bridges at all (you currently have two, both empty and useless), simply add VLANs like this (where etherX is where switch is connected to):
Then you’ll have tagged VLANs 2 and 3 on etherX and new interfaces vlan2 and vlan3 for them. Give them IP addresses, DHCP server, etc. Currently you have them on ether2 and ether3, so move them (if you want to use those subnets for VLANs). To not lock yourself out, connect to router using one, move the other, then see it you can connect to that, and only then move the first one.
If you want VLANs spread over more than one router’s ports, that would require bridge, which is used to configure on which ports you want VLANs and their forms (tagged/untagged). My favourite example is one in manual, which I find simple and easy to understand (but not everyone feels the same).
–
(*) He’s helpful, but so far we didn’t manage to train him to recognize important stuff from unimportant, sorry about that.
what you guys wrote, I might have a chance this evening to make it work. Fingers crossed.
(6) Source nat ----> I dont understand what you are trying to do and would stick to the standard rule until you can describe the requirement and the appropriate config rule can be put in place…
(7) WHy so wide open ??? set winbox address=10.0.0.0/8
(8) Recommend you stick with default rules and not add all the extra garbage…
viewtopic.php?t=180838
/interface vlan
add interface=ether2 name=vlan2 vlan-id=2
add interface=ether2 name=vlan3 vlan-id=3
/ip address
add address=10.223.44.1/24 interface=vlan2
add address=10.255.1.1/24 interface=vlan3
/ip pool add name=vlan2 ranges=10.223.44.1-10.223.44.254
/ip pool add name=vlan3 ranges=10.255.1.1-10.255.1.254
/ Ip dhcp-server enable 0
/ Ip dhcp-server add interface = LOCAL address-pool = vlan2
/ Ip dhcp-server add interface = LOCAL address-pool = vlan3
/ i don't understand why i have to specify dns-server here, i already have a dns specified in the dns menu
/ Ip dhcp-server network add address = 10.223.44.0/24 gateway = 10.223.44.1 dns-server = ?.?.?.? comment=”vlan2”
/ Ip dhcp-server network add address = 10.255.1.0/24 gateway = 10.255.1.1 dns-server = ?.?.?.? comment=”vlan3”
/ip firewall nat
add chain=srcnat action=masquerade src-address=10.223.44.0/24 out-interface=WAN
add chain=srcnat action=masquerade src-address=10.255.1.0/24 out-interface=WAN
Should these be enough?
I don’t understand why I have to specify the DNS in the dhcp-server command, though.
It still feels sketchy to copy-paste these in the terminal.
I don’t want to risk taking the router out, reseting it, connecting to it directly with a laptop, reuploading the last working config, etc. That’s another 1 hour lost in anger.
That example is for trunkless inter-vlan routering. I think this (old) and this (new) are more like the example in this thread, with a trunk link.
There’s an updated version of the intervlan routing with bridge document referenced by @Sobhere with some changes: It specifies allowed frame types, which is good practice. The update /interface bridge vlan section does not explicitly show the untagged ports, which has the same effect, but I think is possibly more confusing, because it relies on implicit behavior. I like to explicitly specify all involved bridge-ports related to a vlan in this section, if for no other reason than if you search the config, you can see the vlan member ports in the line. But all I have configured is hEX S, and that is port limited. On a CRS with many ports, that could be unwieldy (perhaps there is a way to create a “port group” that could be treated equally, but if that feature exists, I am not aware of it. It would be nice to be able to specify a list of bridge-port and give it a name, similar to /interface list for firewalls, but that could be referenced where a list of ports would be accepted. That would make configuring a CRS with many ports configured as access ports for the same vlan easier to configure/understand. Perhaps there is a way to do it using scripts, but I haven’t gotten that far, and for port limited devices like the hEX S, it wouldn’t make much difference.
These are the differences (the red is what is different)
Old:
Add bridge ports and specify pvid for VLAN access ports to assign their untagged traffic to the intended VLAN:
/interface bridge port
add bridge=bridge1 interface=ether6 pvid=200
add bridge=bridge1 interface=ether7 pvid=300
add bridge=bridge1 interface=ether8 pvid=400
Add Bridge VLAN entries and specify tagged and untagged ports in them. In this example bridge1 interface is the VLAN trunk that will send traffic further to do InterVLAN routing:
New:
Add bridge ports and specify pvid for VLAN access ports to assign their untagged traffic to the intended VLAN. Use frame-types setting to accept only untagged packets.
/interface bridge port
add bridge=bridge1 interface=ether6 pvid=200 frame-types=admit-only-untagged-and-priority-tagged
add bridge=bridge1 interface=ether7 pvid=300 frame-types=admit-only-untagged-and-priority-tagged
add bridge=bridge1 interface=ether8 pvid=400 frame-types=admit-only-untagged-and-priority-tagged
Add Bridge VLAN entries and specify tagged ports in them. In this example bridge1 interface is the VLAN trunk that will send traffic further to do InterVLAN routing. Bridge ports with frame-types set to admit-only-untagged-and-priority-tagged will be automatically added as untagged ports for the pvid VLAN.