Community discussions

MikroTik App
 
lrn23
newbie
Topic Author
Posts: 30
Joined: Mon Jan 07, 2019 10:24 am

Configuring VLAN access port

Wed May 22, 2019 5:42 pm

Hello,
I have a problem. I have VLANs on my RB (RB3011UiAS). There is a working trunk port ether2 but I can't configure ether3 as an access port. There is a computer connected to that port unaware of VLANs and I need to have that computer in VLAN 30. According to Wiki https://wiki.mikrotik.com/wiki/Manual:S ... s_Ports.29 configuration should be like this, but it does not work. Am I missing something? Thank you very much for every suggestion...
/interface bridge add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5

/interface vlan
add interface=bridge1 name=vlan20 vlan-id=20
add interface=bridge1 name=vlan30 vlan-id=30

/interface ethernet switch vlan
add independent-learning=yes ports=ether2,switch1-cpu switch=switch1 vlan-id=20
add independent-learning=yes ports=ether2,ether3,switch1-cpu switch=switch1 vlan-id=30

/interface ethernet switch port
set ether3 vlan-mode=secure vlan-header=always-strip default-vlan-id=30

/ip dhcp-server
add address-pool=pool1 disabled=no interface=bridge1 name=server1
add address-pool=pool2 disabled=no interface=vlan20 name=server2
add address-pool=pool3 disabled=no interface=vlan30 name=server3

(This is shortened configuration. I configured IP addresses, pools, DHCP is working, trunk is working...)
Last edited by lrn23 on Fri May 24, 2019 11:53 am, edited 3 times in total.
 
tdw
Forum Guru
Forum Guru
Posts: 1845
Joined: Sat May 05, 2018 11:55 am

Re: Configuring VLAN access port

Wed May 22, 2019 8:45 pm

You don't say what model Mikrotik, but switch2 is connected to ether6-10 and switch1 to ether1-5 on 2011/3011 (additionally switch 1 to sfp1 on a 2011)
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Configuring VLAN access port

Wed May 22, 2019 9:45 pm

Have a slow long read of this excellent source which will help you clean up your config and provide all the answers you desire!
viewtopic.php?f=13&t=143620

After reading that you should be well on your way to success.
The MT wiki resources have been playing catchup such that these ones are now not too bad either!
https://wiki.mikrotik.com/wiki/Manual:Bridge_VLAN_Table
 
lrn23
newbie
Topic Author
Posts: 30
Joined: Mon Jan 07, 2019 10:24 am

Re: Configuring VLAN access port

Thu May 23, 2019 12:04 am

tdw: Yes, I know. It's a typo. This is example of my config. It's switch2 and ether6, ether7 in my production configuration. But thank you!

anav: Thanks a lot for the link! I'll check it!
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11587
Joined: Thu Mar 03, 2016 10:23 pm

Re: Configuring VLAN access port

Thu May 23, 2019 3:49 pm

tdw: Yes, I know. It's a typo. This is example of my config. It's switch2 and ether6, ether7 in my production configuration. But thank you!
In this case the /interface ethernet switch vlan section should look like this:
/interface ethernet switch vlan
add independent-learning=yes ports=ether2,switch1-cpu switch=switch1 vlan-id=20
add independent-learning=yes ports=ether2,ether3,switch1-cpu switch=switch1 vlan-id=30
add independent-learning=yes ports=ether6,switch2-cpu switch=switch2 vlan-id=30
Note that there should be at least 2 config lines for each vlan-id, one per switch= ...

But, as always, it's hard to analyze concrete problems by looking at obfuscated config with typoes ... I'm often asking myself why do I bother to think about problem if the person with problem doesn't want to present all the information in unaltered form ...


anav: Thanks a lot for the link! I'll check it!

Tutorial from @anav's post will work, but slowly as it doesn't use HW capabilities of your RB ...
 
lrn23
newbie
Topic Author
Posts: 30
Joined: Mon Jan 07, 2019 10:24 am

Re: Configuring VLAN access port

Fri May 24, 2019 2:09 pm

mkx: Yes, you're right. Sorry for wasting your time. There was another typo. I can't even rewrite few lines without mistakes. I don't even know why I'm doing it. Readability is not better, but worse... Sorry for that.

/interface bridge add name=LANbridge
/interface bridge port
add bridge=LANbridge interface=eth6
add bridge=LANbridge interface=eth7
add bridge=LANbridge interface=eth8
add bridge=LANbridge interface=eth9
add bridge=LANbridge interface=eth10

/interface vlan
add interface=LANbridge name=vlan20 vlan-id=20
add interface=LANbridge name=vlan30 vlan-id=30

/interface ethernet switch vlan
add independent-learning=yes ports=eth6,switch2-cpu switch=switch2 vlan-id=20
add independent-learning=yes ports=eth6,eth7,switch2-cpu switch=switch2 vlan-id=30

/interface ethernet switch port
set ether7 vlan-mode=secure vlan-header=always-strip default-vlan-id=30

It's configured this way now and port eth7 is still not behaving like access port :(

Tutorial from @anav's post will work, but slowly as it doesn't use HW capabilities of your RB ...

That's a shame. I need to use HW capabilities, because there would be quite a big load on that device.
I'm quite lost in VLANs.. There is an old way, new way since v6.41, VLANs configured only with bridge, VLANs configured with bridge and switch...hw-offloading and switch chip stuff... Ugh... :( I'm trying to understand VLAN principles on MikroTik for few weeks now, but it's complicated, because the information is fragmented and qute often misleading. It's like one huge puzzle.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11587
Joined: Thu Mar 03, 2016 10:23 pm

Re: Configuring VLAN access port

Fri May 24, 2019 3:03 pm

OK, I'll just pass this problem to anybody else who wants - quoting @anav - to play whack-a-mole with you. You're not showing us full config (not even the relevant sections), only pieces which you think are relevant.

If you have a problem and don't know how to solve it (or else you wouldn't be asking here), how can you assume you know which bits of information do we need?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Configuring VLAN access port

Fri May 24, 2019 4:02 pm

In other words a decent diagram will help and the config
/export hide-sensitive file=yourconfigmay24

Who is online

Users browsing this forum: GoogleOther [Bot], Grumpy, raulico and 61 guests