[GTER] Configuração Inter Vlan Bridging no CRS

BinaryCrash binarycrash at gmail.com
Fri Oct 28 14:30:24 -02 2016


Vou colocar aqui um script de exemplo, que você pode utilizar pra testar o
equipamento e talvez até se basear neste modelo.
Vou colocar comentarios no meio do script explicando um pouco de cada parte.

/interface ethernet set [ find default-name=ether1 ] !master-port
comment="(Masterport)"
/interface ethernet set [ find default-name=ether2 ] master-port=ether1
/interface ethernet set [ find default-name=ether3 ] master-port=ether1
/interface ethernet set [ find default-name=ether4 ] master-port=ether1
/interface ethernet set [ find default-name=ether5 ] master-port=ether1
/interface ethernet set [ find default-name=ether6 ] master-port=ether1
/interface ethernet set [ find default-name=ether7 ] master-port=ether1
/interface ethernet set [ find default-name=ether8 ] master-port=ether1
/interface ethernet set [ find default-name=ether9 ] master-port=ether1
/interface ethernet set [ find default-name=ether10 ] master-port=ether1
/interface ethernet set [ find default-name=ether11 ] master-port=ether1
/interface ethernet set [ find default-name=ether12 ] master-port=ether1
/interface ethernet set [ find default-name=ether13 ] master-port=ether1
/interface ethernet set [ find default-name=ether14 ] master-port=ether1
/interface ethernet set [ find default-name=ether15 ] master-port=ether1
/interface ethernet set [ find default-name=ether16 ] master-port=ether1
/interface ethernet set [ find default-name=ether17 ] master-port=ether1
/interface ethernet set [ find default-name=ether18 ] master-port=ether1
/interface ethernet set [ find default-name=ether19 ] master-port=ether1
/interface ethernet set [ find default-name=ether20 ] master-port=ether1
/interface ethernet set [ find default-name=ether21 ] master-port=ether1
/interface ethernet set [ find default-name=ether22 ] master-port=ether1
/interface ethernet set [ find default-name=ether23 ] master-port=ether1
/interface ethernet set [ find default-name=ether24 ] master-port=ether1

#Neste codigo acima setei a ether1 como masterport de todas as
interfaces, 2 a 24.
#A proprio mikrotik recomendou isso, ta escrito no forum deles, só não
tenho mais o link exato pro post.
#A ether1 será o cabo que você vai ligar a CRS em uma CCR.


/interface vlan add interface=ether1 name=GERENCIA_300 vlan-id=300

#supondo que sua VLAN de gerencia seja ID 300


/ip address add address=100.64.0.2/30 interface=GERENCIA_300
/ip route add distance=1 gateway=100.64.0.1

#Neste exemplo o IP de gerencia do switch é 100.64.0.2 e o gateway
final 1. Esse gateway você coloca na CCR, na VLAN 300, e a VLAN na
porta onde o cabo liga com a ether1 da CRS.


/interface ethernet switch ingress-vlan-translation remove [ find dynamic=no ]
#Essa linha remove qualquer entrada manual já feita


/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1002 ports=ether2
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1003 ports=ether3
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1004 ports=ether4
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1005 ports=ether5
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1006 ports=ether6
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1007 ports=ether7
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1008 ports=ether8
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1009 ports=ether9
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1010 ports=ether10
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1011 ports=ether11
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1012 ports=ether12
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1013 ports=ether13
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1014 ports=ether14
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1015 ports=ether15
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1016 ports=ether16
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1017 ports=ether17
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1018 ports=ether18
/interface ethernet switch ingress-vlan-translation add customer-vid=0
 new-customer-vid=1019 ports=ether19
/interface ethernet switch ingress-vlan-translation add customer-vid=0
disabled=yes new-customer-vid=1020 ports=ether20
/interface ethernet switch ingress-vlan-translation add customer-vid=0
disabled=yes new-customer-vid=1021 ports=ether21
/interface ethernet switch ingress-vlan-translation add customer-vid=0
disabled=yes new-customer-vid=1022 ports=ether22
/interface ethernet switch ingress-vlan-translation add customer-vid=0
disabled=yes new-customer-vid=1023 ports=ether23
/interface ethernet switch ingress-vlan-translation add customer-vid=0
disabled=yes new-customer-vid=1024 ports=ether24
/interface ethernet switch ingress-vlan-translation add customer-vid=0
new-customer-vid=3333 ports=ether20
/interface ethernet switch ingress-vlan-translation add customer-vid=0
new-customer-vid=3333 ports=ether21
/interface ethernet switch ingress-vlan-translation add customer-vid=0
new-customer-vid=3333 ports=ether22
/interface ethernet switch ingress-vlan-translation add customer-vid=0
new-customer-vid=3333 ports=ether23
/interface ethernet switch ingress-vlan-translation add customer-vid=0
new-customer-vid=3333 ports=ether24

# Acima eu estou fazendo várias portas configuradas para ter VLAN
individual por porta, e as portas 20 a 24 eu coloquei todas com a VLAN
3333, para caso você tiver alguma bridge rodando.
# Lembrando que se você usa bridge em toda a sua rede e está migrando,
vai precisar colocar ela em uma unica VLAN. Não coloque em mais de uma
VLAN pra não esgotar a tabela FDB do switch.
# Neste exemplo as portas que usei pra bridge tem também a regra
desativada para caso você queira por exemplo trocar a configuração.
Facilita ter ela pre-pronta, desativada.
# as regras acima dizem pro switch que os pacotes que entrarem nestas
portas sem nenhuma tag (no caso VLAN 0) é pra colocar a tag
especificada.
# Exemplo todos os pacotes que entrarem pela ether2 e ainda não tem
tag, recebem a tag 1002.

/interface ethernet switch egress-vlan-tag remove [ find dynamic=no ]

/interface ethernet switch egress-vlan-tag add
tagged-ports=ether1,switch1-cpu vlan-id=300
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1002
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1003
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1004
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1005
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1006
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1007
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1008
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1009
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1010
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1011
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1012
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1013
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1014
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1015
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1016
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1017
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1018
/interface ethernet switch egress-vlan-tag add  tagged-ports=ether1 vlan-id=1019
/interface ethernet switch egress-vlan-tag add disabled=yes
tagged-ports=ether1 vlan-id=1020
/interface ethernet switch egress-vlan-tag add disabled=yes
tagged-ports=ether1 vlan-id=1021
/interface ethernet switch egress-vlan-tag add disabled=yes
tagged-ports=ether1 vlan-id=1022
/interface ethernet switch egress-vlan-tag add disabled=yes
tagged-ports=ether1 vlan-id=1023
/interface ethernet switch egress-vlan-tag add disabled=yes
tagged-ports=ether1 vlan-id=1024
/interface ethernet switch egress-vlan-tag add tagged-ports=ether1 vlan-id=3333

# Nos comandos acima eu informo ao switch quais pacotes sairão com a
tag e em quais portas. Ou seja, o pacote sai do switch com a tag e na
CCR eu crio a interface VLAN pra me comunicar.
# No exemplo acima a VLAN 300 que é de gerencia o pacote sai com a tag
na porta ether1 para que possamos ter nossa interface VLAN de gerencia
na CCR
# e também no "switch1-cpu" que indica que o CPU pode acessar esta VLAN.
# Se não colocar o switch1-cpu na vlan de gerencia, a interface VLAN
que está no switch não conseguirá se comunicar.
# veja que tem ali as regras desabilitadas nas portas onde usei como bridge.
# então estou enviando pra ether1 os pacotes com as tags, uma VLAN ID
pra cada porta, exceto as da bridge que estão todas na VLAN ID 3333


/interface ethernet switch vlan remove  [ find dynamic=no ]

/interface ethernet switch vlan add ports=ether1,switch1-cpu vlan-id=300
/interface ethernet switch vlan add  ports=ether1,ether2 vlan-id=1002
/interface ethernet switch vlan add  ports=ether1,ether3 vlan-id=1003
/interface ethernet switch vlan add  ports=ether1,ether4 vlan-id=1004
/interface ethernet switch vlan add  ports=ether1,ether5 vlan-id=1005
/interface ethernet switch vlan add  ports=ether1,ether6 vlan-id=1006
/interface ethernet switch vlan add  ports=ether1,ether7 vlan-id=1007
/interface ethernet switch vlan add  ports=ether1,ether8 vlan-id=1008
/interface ethernet switch vlan add  ports=ether1,ether9 vlan-id=1009
/interface ethernet switch vlan add  ports=ether1,ether10 vlan-id=1010
/interface ethernet switch vlan add  ports=ether1,ether11 vlan-id=1011
/interface ethernet switch vlan add  ports=ether1,ether12 vlan-id=1012
/interface ethernet switch vlan add  ports=ether1,ether13 vlan-id=1013
/interface ethernet switch vlan add  ports=ether1,ether14 vlan-id=1014
/interface ethernet switch vlan add  ports=ether1,ether15 vlan-id=1015
/interface ethernet switch vlan add  ports=ether1,ether16 vlan-id=1016
/interface ethernet switch vlan add  ports=ether1,ether17 vlan-id=1017
/interface ethernet switch vlan add  ports=ether1,ether18 vlan-id=1018
/interface ethernet switch vlan add  ports=ether1,ether19 vlan-id=1019
/interface ethernet switch vlan add disabled=yes ports=ether1,ether20
vlan-id=1020
/interface ethernet switch vlan add disabled=yes ports=ether1,ether21
vlan-id=1021
/interface ethernet switch vlan add disabled=yes ports=ether1,ether22
vlan-id=1022
/interface ethernet switch vlan add disabled=yes ports=ether1,ether23
vlan-id=1023
/interface ethernet switch vlan add disabled=yes ports=ether1,ether24
vlan-id=1024
/interface ethernet switch vlan add
ports=ether1,ether20,ether21,ether22,ether23,ether24 vlan-id=3333

# Nestas linhas acima eu informo ao switch quais portas participam da
VLAN citada.
# Por exemplo estou dizendo que a vlan 300 (gerencia) pode se
comunicar com a porta ether1 e com a CPU.
# E também que a VLAN 1002 pode se comunicar com a ether1 e a ether2.
# Tem as regras desabilitadas ali para facilitar a troca de bridge
para o modelo das outras portas.
# E tem a VLAN 3333 que pode se comunicar com a ether1,ether20 até 24.
# Então na CCR você vai ter uma interface VLAN com ID 3333 que é a
interface pra colocar na bridge. (caso você esteja usando uma como
citado no inicio do email)


/interface ethernet switch port-isolation remove [ find dynamic=no ]
/interface ethernet switch port set ether1 !isolation-leakage-profile-override
/interface ethernet switch port set ether2 !isolation-leakage-profile-override
/interface ethernet switch port set ether3 !isolation-leakage-profile-override
/interface ethernet switch port set ether4 !isolation-leakage-profile-override
/interface ethernet switch port set ether5 !isolation-leakage-profile-override
/interface ethernet switch port set ether6 !isolation-leakage-profile-override
/interface ethernet switch port set ether7 !isolation-leakage-profile-override
/interface ethernet switch port set ether8 !isolation-leakage-profile-override
/interface ethernet switch port set ether9 !isolation-leakage-profile-override
/interface ethernet switch port set ether10 !isolation-leakage-profile-override
/interface ethernet switch port set ether11 !isolation-leakage-profile-override
/interface ethernet switch port set ether12 !isolation-leakage-profile-override
/interface ethernet switch port set ether13 !isolation-leakage-profile-override
/interface ethernet switch port set ether14 !isolation-leakage-profile-override
/interface ethernet switch port set ether15 !isolation-leakage-profile-override
/interface ethernet switch port set ether16 !isolation-leakage-profile-override
/interface ethernet switch port set ether17 !isolation-leakage-profile-override
/interface ethernet switch port set ether18 !isolation-leakage-profile-override
/interface ethernet switch port set ether19 !isolation-leakage-profile-override
/interface ethernet switch port set ether20 !isolation-leakage-profile-override
/interface ethernet switch port set ether21 !isolation-leakage-profile-override
/interface ethernet switch port set ether22 !isolation-leakage-profile-override
/interface ethernet switch port set ether23 !isolation-leakage-profile-override
/interface ethernet switch port set ether24 !isolation-leakage-profile-override
/interface ethernet switch port set sfp1 !isolation-leakage-profile-override


# Nestas linhas acima eu estou trazendo a configuração para o padrão,
sem profile configurado.
# A maneira que eu uso o switch não faço isolamento pela porta, e sim
pelas VLANS.

Depois de configurado tudo que está acima, vou no menu do winbox ->
Switch -> Settings -> Desmarco a opção "Forward invalid VLAN".
Ou seja, só vai permitir tráfego entre as VLANS configuradas nas
portas configuradas.

Lembrando de SEMPRE atualizar antes de fazer a config, porque por
exemplo aqui não coloquei o sa-learning, que por padrão já é ativo nas
versões mais novas.
Recomendo 6.37.1 ( que no momento deste email é a mais atual )


NA CCR você tem que criar as interfaces de cada VLAN, ou seja, das portas,
da brige, e da gerencia. Eu uso essa configuração quando quero aproveitar
uma CCR-1016 pra ligar mais equipamentos. Típico cenário onde tem bastante
CPU sobrando e pouca porta. É uma forma de eu adicionar mais portas a uma
CCR. Essa não é a única forma de usar a CRS, é apenas um exemplo de um
cenário.

Abraços.


Em 28 de outubro de 2016 09:53, Andre Almeida <andre at bnet.com.br> escreveu:

> Bom dia!
>
> Tens algum passo a passo para utilizar a opção Switch ?
>
> Aqui ja tentei de algumas formas, a tratar como um Switch, taggear e
> untaggear vlans em portas distintas.
> Pelo que vi precisa começar marcando outras portas com uma masterport, mas
> ainda não consegui fazer.
>
> Pra quem ja tem esse tipo de configuração em produção pode ajudar a sair da
> bridge e consumir menos CPU aumentando o throughput
>
> Obrigado
>
> Andre Almeida
>
>
> Em 28 de outubro de 2016 00:09, BinaryCrash <binarycrash at gmail.com>
> escreveu:
>
> > Não use bridge do routerOS porque vai passar pela CPU e a CRS não é feita
> > pra você usar a CPU no encaminhamento de pacotes.
> >
> > CRS tem alta capacidade de tráfego se você configurar corretamente e
> isola
> > perfeitamente as VLANs.
> >
> > Alguns cuidados pra quem ta começando a mexer com CRS:
> > 1) Tenha um cabo serial pra emergencias, caso você ficar trancado sem
> > acesso ao switch por problemas na sua configuração.
> > 2) Sempre use uma unica masterport, independente da configuração que for
> > fazer. A CRS trabalha melhor dessa forma.
> > 3) Faça sua VLAN de gerencia do equipamento primeiro, antes de tudo.
> > Garanta que você tenha essa VLAN 100% configurada ai vc pode ir no menu
> > Switch->Settings e desabilite a opção "forward invalid vlan". Isso fará o
> > switch isolar as VLANs, permitindo tráfego apenas onde você configurou.
> > Lembrando que, se você não fizer a vlan de gerencia corretamente, ao
> ativar
> > essa opção você perde acesso a gerencia do switch. Aí só o cabo serial
> terá
> > acesso.
> >
> > Outro detalhe importante é atualizar a versão pra mais atual.
> > Tem muito bug corrigido e também mudanças de opção padrão, como por
> exemplo
> > sa-learning que antes era desligado e agora é ligado por padrão.
> > o sa-learning adiciona os hosts na tabela FDB. assim o switch sabe pra
> quem
> > enviar o pacote e vai apenas pela porta necessária.
> > sem isso não encontra o MAC na FDB e acaba enviando o pacote pra todas as
> > portas que a VLAN participa.
> >
> > Usa a CPU de uma CRS é a mesma coisa que usar uma RB750. Não compensa.
> > Já com uso do switchchip você passa 20 gbps fácil.
> > OBS, esses switches fazem link-aggregation.
> >
> > Em 27 de outubro de 2016 09:24, Euler Garcia - PoçosNet <
> > euler.garcia at pocos-net.com.br> escreveu:
> >
> > > Pessoal bom dia,
> > >
> > >     Gostaria de saber se a configuração abaixo pode ser realizada de
> > > maneira mais eficiente em um Cloud Router Switch usando Port Switching.
> > >
> > >     Tenho na ether3 alguns pacotes que chegarão tagged e estes precisam
> > se
> > > comunicar através da ether2 untagged. Porém as vlans não podem se
> > conversar.
> > >
> > >     Desde já agradeço os comentários.
> > >
> > > /interface vlan
> > > add interface=ether3 name=vlan1 vlan-id=1016
> > > add interface=ether3 name=vlan2 vlan-id=1017
> > >
> > > /interface bridge
> > > add name=bridge1
> > >
> > > /interface bridge port
> > > add bridge=bridge1 interface=ether2
> > > add bridge=bridge1 horizon=1 interface=vlan1
> > > add bridge=bridge1 horizon=1 interface=vlan2
> > >
> > > --
> > > Atenciosamente,
> > > Euler Thomas Garcia
> > > Rede Sul Mineira de Provedores
> > > euler.garcia at pocos-net.com.br
> > >
> > > --
> > > gter list    https://eng.registro.br/mailman/listinfo/gter
> > --
> > gter list    https://eng.registro.br/mailman/listinfo/gter
> --
> gter list    https://eng.registro.br/mailman/listinfo/gter
>



More information about the gter mailing list