8
OK, díky všem za rady. Nebylo na to moc času tak to trvá, ale na stole to mám kromě FW a WLAN rozjeté (ne že by to nejelo, jen jsem s tím zatím nezačal).
Ty VLAN nejsou až tak složité, ale všude kde jsem na to narazil to vysvětlení není úplně ono a systémově, všude jen tuny příkladů a jak rozjet 2 VLAN na jednom-dvou routeru/switchi se statickou IP... Ale občas jen někde někdo zmíní jak to v pozadí pracuje, takže se z těch příkladů často blbě odvozuje co se týká routeru, co switche, jak páteřní switch, jak access switch... Nejlepší jsou borci na YT, co nakreslí a ukážou schéma co jdou dělat a hned na to řekne, že to má v jiném portu:D
Chápu to tak, že to co nastavuji v Bridge, tak se týká L2 switche, takže v momentě kdy se zapne VLAN filtering, tak jde komunikace s ROS do háje a swtich chip všechno řeší sám. Co se nastavuje v Interface-VLAN a nad těmi VLAN ITF, tak je L3 tlačící provoz do CPU a HW offload to neodřeže. Takže switche a porty se nastavují v Bridge (+1x MGMT VLAN), router je zase prakticky celý nastavený v interface. Pokud bych nechtěl na GW využít prázdné porty pro testovací přístup do jednotlivých VLAN, tak bridge na GW prakticky není potřeba (dalo by se všechny VLAN natlačit přímo na SFP1).
Nechce se mi anonymizovat celé schéma, tak jen stručný popis se zaokrouhlenými počty...
GW - 5009. SFP na páteřní switch, ETH1 WAN, ETH2-7 testovací přástup do vybraných VLAN, ETH8 MGMT (vlastně stejně jako 2-7, jen jiné číslo VLAN)
Páteřní switch - 317, vše spojené sem přes DAC / Maxlink BiDi. VLAN průchozí - pouze ETH1 pro MGMT
PoE switch 328 - 8x kamera, 6x wifi, 4x další PoE... Pro WiFi trunk, pro koncové zařízení access
Pracoviště+byty switche - 3x 310 a 2x 326 - ETH access porty, SFP1 trunk, SFP2 - hybrid záložní trunk + MGMT přes S-RJ01
Jestli se to někomu bude chtít projít a případně by k tomu měl nějaké připománky, určitě uvítám. Zatím to nejde do provozu, ale v principu by se to už moc měnit snad nemuselo (doplnění firewallu a wifi, případně u koncových acess switchů ořežu všechny VLAN na pouze potřebné)
Nastavení GateWay RB5009 (kromě obecných nesouvisejících věcí jako DNS, NTP...):
/interface bridge
add frame-types=admit-only-vlan-tagged name=bridge1 protocol-mode=none vlan-filtering=no #vlan-filtering až na konci po nastavení VLAN
# L2 rozhraní - aby jim šly přidělit IP a routovat je, "správa VLAN"
/interface vlan
add interface=bridge1 name=vlan10 vlan-id=10
add interface=bridge1 name=vlan20 vlan-id=20
add interface=bridge1 name=vlan30 vlan-id=30
...
add interface=bridge1 name=vlan99-MGMT vlan-id=99
add interface=bridge1 name=vlan100-Public vlan-id=100
add interface=ether1 name=vlan848 vlan-id=848
# Porty do bridge - SFP je trunk - pouze nastavení only tagged, zbytek je testovací přístup do VLAN - untaged access porty
/interface bridge port
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=sfp-sfpplus1
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether2 pvid=10
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether3 pvid=20
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether4 pvid=30
...
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether8 pvid=99
# Před rozjetím je dobré jeden port nechat mimo bridge - pokud se podělá přístup, aby se dalo z Winbox připojit na MAC a opravit to, do Bridge ho dát až to celé funguje i a je ověřené přes VLAN
# Trunk port - všechny VLAN pustit do SFP směrem na páteřní switch - musí se pro TRUNK. Pro untagged access a L3 VLAN interface se přidá samo dynamicky
/interface bridge vlan
add bridge=bridge1 tagged=sfp-sfpplus1 vlan-ids=10-100
# DSL připojení přes terminátor
/interface pppoe-client
add add-default-route=yes disabled=no interface=vlan848 name=pppoe-out1 user=o2...
/ip firewall nat
add action=masquerade chain=srcnat comment="NAT na WAN" out-interface=pppoe-out1
# IP adresy a DHCP servery pro jednotlivé sítě
/ip address
add address=192.168.10.1/24 interface=vlan10 network=192.168.10.0
add address=192.168.20.1/24 interface=vlan20 network=192.168.20.0
add address=192.168.30.1/24 interface=vlan30 network=192.168.30.0
...
add address=192.168.99.1/24 interface=vlan99-MGMT network=192.168.99.0
add address=192.168.100.1/24 interface=vlan100-Public network=192.168.100.0
/ip pool
add name=pool10 ranges=192.168.10.100-192.168.10.200
add name=pool20 ranges=192.168.20.100-192.168.20.200
add name=pool30 ranges=192.168.30.100-192.168.30.200
...
add name=pool99 ranges=192.168.99.100-192.168.99.200
add name=pool100 ranges=192.168.100.100-192.168.100.200
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.10.1 domain=p1.local gateway=192.168.10.1 ntp-server=192.168.10.1
add address=192.168.20.0/24 dns-server=192.168.20.1 domain=p2.local gateway=192.168.20.1 ntp-server=192.168.20.1
add address=192.168.30.0/24 dns-server=192.168.30.1 domain=p3.local gateway=192.168.30.1 ntp-server=192.168.30.1
...
add address=192.168.99.0/24 dns-server=192.168.99.1 domain=sys.local gateway=192.168.99.1 ntp-server=192.168.99.1
add address=192.168.100.0/24 dns-server=192.168.100.1 gateway=192.168.100.1 ntp-server=192.168.100.1
/ip dhcp-server
add address-pool=pool10 interface=vlan10 lease-time=10m name=server10
add address-pool=pool20 interface=vlan20 lease-time=10m name=server20
add address-pool=pool30 interface=vlan30 lease-time=10m name=server30
...
add address-pool=pool99 interface=vlan99-MGMT lease-time=10m name=server99
add address-pool=pool100 interface=vlan100-Public lease-time=10m name=server100
#Zapnout vlan-filtering... na GW celkem zbytečné - všechno se stejně routuje/NATuje...
Konfigurace páteřního SFP switche CRS317 (nerozlišuji, kde je která VLAN, všechno všude - asi ne ideální bezpečnost, ale všechno můžu libovolně přeházet a pořád to funguje):
/interface bridge
add frame-types=admit-only-vlan-tagged name=bridge1 protocol-mode=none vlan-filtering=no #vlan-filtering až na konci po nastavení VLAN
# MGMT přístup do nastavené ROS, jinak switch chip všcehno požere a switch je nedostupný
/interface vlan
add interface=bridge1 name=vlan99 vlan-id=99
/ip dhcp-client
add default-route-tables=main interface=vlan99
# Všechny SFP jako trunk, pouze eth1 jako access port pro MGMT
/interface bridge port
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=sfp-sfpplus1
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=sfp-sfpplus2
...
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=sfp-sfpplus16
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether1 pvid=99
# Nastavení všech VLAN na všechny SFP - musí se pro TRUNK. Pro untagged access a L3 VLAN interface se přidá samo dynamicky
/interface bridge vlan
add bridge=bridge1 tagged="sfp-sfpplus1,sfp-sfpplus2,...,sfp-sfpplus16" vlan-ids=10-100
#Zapnout vlan-filtering
Konfigurace koncových access switchů CRS310/326:
/interface bridge
add frame-types=admit-only-vlan-tagged name=bridge1 protocol-mode=none vlan-filtering=no #vlan-filtering až na konci po nastavení VLAN
# MGMT přístup do nastavené ROS, jinak switch chip všcehno požere a switch je nedostupný
/interface vlan
add interface=bridge1 name=vlan99 vlan-id=99
/ip dhcp-client
add default-route-tables=main interface=vlan99
# Všechny porty jako untagged acces, jen SFP1 jako TRUNK, SFP2 jako hybrid záložní trunk + MGMT přes S-RJ01
/interface bridge port
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether1 pvid=10
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether2 pvid=10
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether3 pvid=10
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether4 pvid=20
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether5 pvid=20
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether6 pvid=20
...
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether99 pvid=100
add bridge=bridge1 frame-types=admit-only-untagged-and-priority-tagged interface=ether100 pvid=100
add bridge=bridge1 frame-types=admit-only-vlan-tagged interface=sfp-sfpplus1
add bridge=bridge1 interface=sfp-sfpplus2 pvid=99
# Nastavení všech VLAN na oba SFP - musí se pro TRUNK. Pro untagged access a L3 VLAN interface se přidá samo dynamicky
/interface bridge vlan
add bridge=bridge1 tagged=sfp-sfpplus1,sfp-sfpplus2 vlan-ids=10-100
#Zapnout vlan-filtering
Pokud tedy chci port přehodit z jedné sítě do druhé (a na switchi mám příslušné VLAN přivedené TRUNK portem), tak jen na portu přepíšu PVID a to je vše...