Diverse Mikrotik Cloud Core Swtich

butonel: Mihai Stancu | ianuarie 25th, 2015

Mikrotik-ul şi VLAN-urile – O aventură

Mikrotik Cloud Core Switch – VLANs

Tutorial

Presupunem ca dorim urmatoarea configuratie:

Mikrotik VLANs Topology

Vlanurile

VLAN2 – 10.10.20.0/24

VLAN3 – 10.10.30.0/24

VLAN4 – 10.10.40.0/24

Porturi – ‘Access Ports’

ether2-ether5 – Vlan2

ether6-ether9 – Vlan3

ether10-ether13 – Vlan4

Porturi – ‘Trunk Ports’

ether1 – Vlan2, Vlan3, Vlan4 (Trunking)


Crearea Interfetelor Tip VLAN pe interfata ‘master port’ a switch-ului
/interface vlan
add name=VLAN2 vlan-id=2 interface=ether1 disabled=no
add name=VLAN3 vlan-id=3 interface=ether1 disabled=no
add name=VLAN4 vlan-id=4 interface=ether1 disabled=no
Setarea IP-urilor pe interfetele VLAN
/ip address 
add address=10.10.20.1/24 interface=VLAN2
add address=10.10.30.1/24 interface=VLAN3
add address=10.10.40.1/24 interface=VLAN4
 Setarea interfetelor in switch ( ‘master port interface’ )
/interface ethernet
set ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9,ether10,ether11,ether12,ether13 master-port=ether1
 Tagarea pachetelor la intrarea in porturile tip ‘Access Ports’
Vlan Nativ pentru mikrotik este Vlan0
/interface ethernet switch ingress-vlan-translation
add ports=ether2,ether3,ether4,ether5 customer-vid=0 new-customer-vid=2 sa-learning=yes
add ports=ether6,ether7,ether8,ether9 customer-vid=0 new-customer-vid=3 sa-learning=yes
add ports=ether10,ether11,ether12,ether13 customer-vid=0 new-customer-vid=4 sa-learning=yes
Tagarea pachetelor la iesirea din interfata ‘Trunk’ ether1 si din procesorul de pachete al switch-ului
/interface ethernet switch egress-vlan-tag
add tagged-ports=switch1-cpu,ether1 vlan-id=2
add tagged-ports=switch1-cpu,ether1 vlan-id=3
add tagged-ports=switch1-cpu,ether1 vlan-id=4
 InterVLAN Routing – Validarea VLAN-urilor pe porturi
/interface ethernet switch vlan
add ports=switch1-cpu,ether1,ether2,ether3,ether4,ether5 vlan-id=2 learn=yes
add ports=switch1-cpu,ether1,ether6,ether7,ether8,ether9 vlan-id=3 learn=yes
add ports=switch1-cpu,ether1,ether10,ether11,ether12,ether3 vlan-id=4 learn=yes
 Dezactivarea trecerii Vlan-urilor necunoscute/invalide
/interface ethernet switch
set forward-unknown-vlan=no

Urmeaza sa va creati regulile de filtrare a traficului intre Vlan-uri

/ip firewall filter

…reguli…

Pentru mai multe informatii sau exemple de configurari ale VLAN-urilor / InterVLAN Routing, accesati wiki-ul Mikrotik iar pentru modele RB intrati aici



Back to Top ↑