Community discussions

MikroTik App
 
John2k
just joined
Topic Author
Posts: 7
Joined: Thu Feb 28, 2019 6:34 pm

Multiple ports in a VLAN

Fri Oct 22, 2021 3:03 am

HI all,

I am trying to learn how to configure Mikrotik router using GNS3. Trying to do a simple configuration here. I would like to configure the router as described below.
- ether2 will be for trunk port (uplink to another router)
- ether3 - VLAN30
- ether4 - VLAN40

So here is print out configuration below.

/interface bridge
add name=bridge1
/interface vlan
add interface=ether2 name=vlan30 vlan-id=30
add interface=ether2 name=vlan40 vlan-id=40
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
/ip dhcp-client
add disabled=no interface=ether1

I tried to add these commands below, they did not work.

[admin@MikroTik] /interface vlan> add interface=ether3 name-vlan30 vlan-id=30
expected end of command (line 1 column 22)
[admin@MikroTik] /interface vlan> add interface=ether4 name=vlan40 vlan-id=40
failure: already have interface with such name

Can a VLAN have multiple ports?
If it can, what is the correct command to do it?


Thanks in advance for your help.
 
User avatar
FiiMitch
newbie
Posts: 35
Joined: Tue Aug 18, 2020 8:49 am
Location: Gold Coast, QLD
Contact:

Re: Multiple ports in a VLAN

Fri Oct 22, 2021 5:14 am

In the following, you've put "name-vlan30", it should be "name=vlan30". The terminal will make you aware of syntax errors as you enter commands, please pay attention to these. You can learn more here: https://help.mikrotik.com/docs/display/ ... +Interface

[admin@MikroTik] /interface vlan> add interface=ether3 name-vlan30 vlan-id=30
expected end of command (line 1 column 22)
[admin@MikroTik] /interface vlan> add interface=ether4 name=vlan40 vlan-id=40
failure: already have interface with such name

Regarding the second failure, the terminal is informing you that you have already created an interface called "vlan40".
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11444
Joined: Thu Mar 03, 2016 10:23 pm

Re: Multiple ports in a VLAN

Fri Oct 22, 2021 8:20 am

Regarding the second failure, the terminal is informing you that you have already created an interface called "vlan40".

And the reason is that VLAN port membership is configured in a very different way. I suggest you to go through this very fine tutorial, it explains how to deal with VLANs in ROS.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19109
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Multiple ports in a VLAN

Fri Oct 22, 2021 3:51 pm

Once you have hoisted in MKS, most excellent reference, and still have unresolved issues
Post entire config
/export hide-sensitive file=anynameyouwant

Who is online

Users browsing this forum: Bing [Bot], clambert, holvoetn, sebus46 and 34 guests