hypernia
Goto Top

Mikrotik: Geräte in falschem VLAN

Ich habe
  • einen CRS326 als Router
  • daran per SFP1 angebunden einen CSS610-8P
  • am CSS610 mehrere wAP / hAP / cAP als Access Points.

Dabei existieren 4 VLANs. Aus VLAN100 (Heim) soll alle Kommunikation erlaubt sein. Ich hatte jetzt festgestellt, dass mein Handy dabei eingeschränkt ist: Von hier kann ich z. B. den CSS610 nicht anpingen / aufrufen, von anderen Geräten schon. Die erste Frage die sich mir gestellt hatte: Kann ich eigentlich irgendwo sehen, welches Gerät welchem VLAN zugeordnet ist? Beholfen habe ich mir mit einer Passthrough-Regel. Wenn ich hier von VLAN300 in "all VLAN" einstelle bekomme ich sekündlich +1 Paket, solange ich auf dem Handy den Ping-Befehl starte.

Die Frage, dies sich mir stellt: Warum bekommt das Handy VLAN300? Hinweis: Ports 17 und 21 gehen an 2 lokale Geräte, die korrekt eine IP aus dem Server-Netz erhalten und dort erreichbar sind.

Konfik am CRS326:
[admin@MikroTik CRS326 Router] > export hide-sensitive 
# 2024-03-04 10:30:55 by RouterOS 7.13
# software id = 0W7J-R7C0
#
# model = CRS326-24G-2S+
# serial number = 763C08E550B9
/interface bridge
add admin-mac=CC:2D:E0:D2:24:09 auto-mac=no comment="defconf, Prio 2000 um Root zu sein " name=bridge1 priority=0x2000 vlan-filtering=yes  
/interface vlan
add interface=ether19 name="vlan7 (Telekom)" vlan-id=7  
add interface=bridge1 name="vlan100 (Heim)" vlan-id=100  
add interface=bridge1 name="vlan200 (Gast)" vlan-id=200  
add interface=bridge1 name="vlan300 (Server)" vlan-id=300  
add interface=bridge1 name="vlan400 (IoT)" vlan-id=400  
/caps-man configuration
add channel.band=5ghz-a/n/ac country=etsi datapath.bridge=bridge1 .client-to-client-forwarding=yes .vlan-id=100 .vlan-mode=use-tag name=cfg_HaHo_5GHz security.authentication-types=wpa2-psk ssid=HaHo
add channel.band=5ghz-a/n/ac country=etsi datapath.bridge=bridge1 .vlan-id=200 .vlan-mode=use-tag name=cfg_TPH_5Ghz security.authentication-types=wpa2-psk ssid=TPH
add channel.band=2ghz-b/g/n country=etsi datapath.bridge=bridge1 .vlan-id=100 .vlan-mode=use-tag name=cfg_HaHo_2.4GHz security.authentication-types=wpa2-psk ssid=HaHo_2.4
add channel.band=2ghz-b/g/n country=etsi datapath.bridge=bridge1 .vlan-id=200 .vlan-mode=use-tag name=cfg_TPH_2.4 security.authentication-types=wpa2-psk ssid=TPH
/interface pppoe-client
add add-default-route=yes disabled=no interface="vlan7 (Telekom)" max-mtu=1500 name=pppoe-telekom-fiber user=123  
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk eap-methods="" mode=dynamic-keys supplicant-identity=MikroTik  
add authentication-types=wpa2-psk eap-methods="" mode=dynamic-keys name=Gast-Profil supplicant-identity=""  
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add name=default-dhcp ranges=100.0.1.10-100.0.1.254
add name=Gast-DHCP ranges=100.0.2.10-100.0.2.254
add name=Server-DHCP ranges=100.0.3.10-100.0.3.254
add name=IoT-DHCP ranges=100.0.4.10-100.0.4.254
/ip dhcp-server
add address-pool=default-dhcp interface="vlan100 (Heim)" name=Heim-DHCP  
add address-pool=Gast-DHCP interface="vlan200 (Gast)" name=Gast-DHCP  
add address-pool=Server-DHCP interface="vlan300 (Server)" name=Server-DHCP  
add address-pool=IoT-DHCP interface="vlan400 (IoT)" name=IoT-DHCP  
/port
set 0 name=serial0
/caps-man manager
set ca-certificate=auto certificate=auto enabled=yes
/caps-man provisioning
add action=create-dynamic-enabled comment=5GHz hw-supported-modes=ac,an,a master-configuration=cfg_HaHo_5GHz name-format=prefix name-prefix=5GHz- slave-configurations=cfg_TPH_5Ghz
add action=create-dynamic-enabled comment=2.4GHz hw-supported-modes=gn master-configuration=cfg_HaHo_2.4GHz name-format=prefix name-prefix=2.4GHz- slave-configurations=cfg_TPH_2.4
/interface bridge port
add bridge=bridge1 interface=ether2 pvid=100
add bridge=bridge1 interface=ether3 pvid=100
add bridge=bridge1 interface=ether4 pvid=100
add bridge=bridge1 interface=ether5 pvid=100
add bridge=bridge1 interface=ether6 pvid=100
add bridge=bridge1 interface=ether7 pvid=100
add bridge=bridge1 interface=ether8 pvid=100
add bridge=bridge1 interface=ether9 pvid=100
add bridge=bridge1 interface=ether10 pvid=100
add bridge=bridge1 interface=ether11 pvid=100
add bridge=bridge1 interface=ether12 pvid=100
add bridge=bridge1 interface=ether13 pvid=100
add bridge=bridge1 interface=ether14 pvid=100
add bridge=bridge1 interface=ether15 pvid=100
add bridge=bridge1 interface=ether16 pvid=100
add bridge=bridge1 interface=ether17 pvid=300
add bridge=bridge1 interface=ether18 pvid=100
add bridge=bridge1 interface=ether21 pvid=300
add bridge=bridge1 interface=ether22 pvid=100
add bridge=bridge1 interface=ether23 pvid=100
add bridge=bridge1 interface=ether24 pvid=100
add bridge=bridge1 interface=sfp-sfpplus1 pvid=100
add bridge=bridge1 interface=ether1 pvid=100
add bridge=bridge1 interface=ether20 multicast-router=disabled pvid=100
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ipv6 settings
set accept-redirects=no accept-router-advertisements=yes
/interface bridge vlan
add bridge=bridge1 tagged=bridge1 vlan-ids=100
add bridge=bridge1 tagged=bridge1,sfp-sfpplus1 vlan-ids=200
add bridge=bridge1 tagged=bridge1,sfp-sfpplus1 vlan-ids=300
add bridge=bridge1 tagged=bridge1,sfp-sfpplus1 vlan-ids=400
/interface list member
add interface=bridge1 list=LAN
add interface=ether19 list=WAN
add interface="vlan200 (Gast)" list=LAN  
add interface="vlan300 (Server)" list=LAN  
add interface="vlan400 (IoT)" list=LAN  
add interface="vlan100 (Heim)" list=LAN  
/ip address
add address=100.0.1.1/24 interface="vlan100 (Heim)" network=100.0.1.0  
add address=100.0.2.1/24 interface="vlan200 (Gast)" network=100.0.2.0  
add address=100.0.3.1/24 interface="vlan300 (Server)" network=100.0.3.0  
add address=100.0.4.1/24 interface="vlan400 (IoT)" network=100.0.4.0  
/ip dhcp-client
add add-default-route=no interface=ether19
# DHCP client can not run on slave or passthrough interface!
/ip dhcp-server lease
add address=100.0.1.10 client-id=1:48:a9:8a:95:a8:b2 comment="Mikrotik CSS610 8P" mac-address=48:A9:8A:95:A8:B2 server=Heim-DHCP  
add address=100.0.1.24 client-id=1:78:9a:18:9e:63:20 comment="Mikrotik wAP AC Garage" mac-address=78:9A:18:9E:63:20 server=Heim-DHCP  
add address=100.0.1.20 client-id=1:48:8f:5a:c7:e9:90 comment="Mikrotik hAP AC\B2 Keller" mac-address=48:8F:5A:C7:E9:90 server=Heim-DHCP  
add address=100.0.1.21 client-id=1:48:8f:5a:5f:e3:fc comment="Mikrotik hAP AC\B2 Wohnzimmer" mac-address=48:8F:5A:5F:E3:FC server=Heim-DHCP  
add address=100.0.1.23 client-id=1:78:9a:18:c1:da:1c comment="Mikrotik cAP AC OG" mac-address=78:9A:18:C1:DA:1C server=Heim-DHCP  
/ip dhcp-server network
add address=100.0.1.0/24 comment=Heim-Netzwerk dns-server=100.0.3.10 gateway=100.0.1.1
add address=100.0.2.0/24 comment=Gast-Netzwerk dns-server=8.8.8.8 gateway=100.0.2.1
add address=100.0.3.0/24 comment=Server-Netzwerk dns-server=100.0.3.10 gateway=100.0.3.1
add address=100.0.4.0/24 comment=IoT-Netzwerk dns-server=100.0.3.10 gateway=100.0.4.1
/ip dns
set allow-remote-requests=yes servers=100.0.3.10,fe80::d103:7c63:3e44:4b45
/ip dns static
add address=100.0.1.1 name=router.lan
/ip firewall filter
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked  
add action=passthrough chain=forward in-interface="vlan300 (Server)" out-interface="vlan100 (Heim)"  
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related hw-offload=yes  
add action=accept chain=forward comment="Alles erlaubt aus Heim-VLAN" in-interface="vlan100 (Heim)"  
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=established,related,untracked  
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid  
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp  
add action=accept chain=input comment="Loopback erlaubt fuer Cap in Capsman " dst-address-type=local src-address-type=local  
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN  
add action=accept chain=forward comment="defconf: accept in ipsec policy" disabled=yes ipsec-policy=in,ipsec  
add action=accept chain=forward comment="defconf: accept out ipsec policy" disabled=yes ipsec-policy=out,ipsec  
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid  
add action=accept chain=forward comment="Server d\C3\BCrfen an IoT" in-interface="vlan300 (Server)" out-interface="vlan400 (IoT)"  
add action=drop chain=forward comment="Drop Inter-VLAN-Routing" in-interface=all-vlan out-interface=all-vlan  
add action=drop chain=forward comment="Internet f\C3\BCr IoT verbieten" in-interface="vlan400 (IoT)" out-interface=pppoe-telekom-fiber  
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN  
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN  
add action=masquerade chain=srcnat out-interface=pppoe-telekom-fiber src-address=100.0.0.0/16
/ip proxy access
add action=deny comment="block telnet & spam e-mail relaying"  
add action=deny comment="allow CONNECT only to SSL ports 443 [https] and 563 [snews]" method=CONNECT  
/ip upnp
set allow-disable-external-interface=yes enabled=yes
/ipv6 address
add from-pool=pool-ipv6 interface="vlan100 (Heim)"  
add from-pool=pool-ipv6 interface="vlan200 (Gast)"  
add from-pool=pool-ipv6 interface="vlan300 (Server)"  
add from-pool=pool-ipv6 interface="vlan400 (IoT)"  
/ipv6 dhcp-client
add add-default-route=yes interface=pppoe-telekom-fiber pool-name=pool-ipv6 request=prefix use-peer-dns=no
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6  
add address=::1/128 comment="defconf: lo" list=bad_ipv6  
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6  
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6  
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6  
add address=100::/64 comment="defconf: discard only " list=bad_ipv6  
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6  
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6  
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6  
add address=::224.0.0.0/100 comment="defconf: other" list=bad_ipv6  
add address=::127.0.0.0/104 comment="defconf: other" list=bad_ipv6  
add address=::/104 comment="defconf: other" list=bad_ipv6  
add address=::255.0.0.0/104 comment="defconf: other" list=bad_ipv6  
add address=hypernia.spdns.de list=Odroid
/ipv6 firewall filter
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=established,related,untracked  
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid  
add action=accept chain=input comment="defconf: accept ICMPv6" protocol=icmpv6  
add action=accept chain=input comment="defconf: accept UDP traceroute" port=33434-33534 protocol=udp  
add action=accept chain=input comment="defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=udp src-address=fe80::/16  
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 protocol=udp  
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=ipsec-ah  
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=ipsec-esp  
add action=accept chain=input comment="defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec  
add action=drop chain=input comment="defconf: drop everything else not coming from LAN" in-interface-list=!LAN  
add action=accept chain=forward comment="defconf: accept established,related,untracked" connection-state=established,related,untracked  
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid  
add action=drop chain=forward comment="defconf: drop packets with bad src ipv6" src-address-list=bad_ipv6  
add action=drop chain=forward comment="defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6  
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" hop-limit=equal:1 protocol=icmpv6  
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=icmpv6  
add action=accept chain=forward comment="defconf: accept HIP" protocol=139  
add action=accept chain=forward comment="defconf: accept IKE" dst-port=500,4500 protocol=udp  
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=ipsec-ah  
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=ipsec-esp  
add action=accept chain=forward comment="defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec  
add action=accept chain=forward comment="Aus Heimnetz alles erlauben" in-interface="vlan100 (Heim)"  
add action=drop chain=forward comment="Inter-VLAN-Routing unterbinden" in-interface=all-vlan out-interface=all-vlan  
add action=drop chain=forward comment="defconf: drop everything else not coming from LAN" in-interface-list=!LAN  
/ipv6 nd
set [ find default=yes ] interface="vlan100 (Heim)"  
add hop-limit=64 interface="vlan200 (Gast)"  
add hop-limit=64 interface="vlan300 (Server)"  
add hop-limit=64 interface="vlan400 (IoT)"  

Im CSS610 (Version 2.17) habe ich für alle Ports unter VLAN:
VLAN Mode optional
VLAN Receive any
Default VLAN ID 100
Force VLAN ID Nein

Unter VLANs sind alle Ports zu allen VLANs erlaubt. Auch beim Rest ist eigentlich erst mal alles im Standard geblieben.

Die Konfiguration auf den Access Points sieht eigentlich immer gleich aus:
[admin@Mikrotik wAP AC Garage] > export hide-sensitive 
# 2024-03-04 10:33:46 by RouterOS 7.13
# software id = M44M-R0KV
#
# model = RBwAPG-5HacD2HnD
# serial number = HFA0904H091
/interface bridge
add admin-mac=78:9A:18:9E:63:19 auto-mac=no name=bridge1
/interface wireless
# managed by CAPsMAN
# channel: 2412/20-Ce/gn(17dBm), SSID: HaHo_2.4, CAPsMAN forwarding
set [ find default-name=wlan1 ] ssid=MikroTik
# managed by CAPsMAN
# channel: 5640/20-eCee/ac/DP(24dBm), SSID: HaHo, CAPsMAN forwarding
set [ find default-name=wlan2 ] band=5ghz-a/n/ac ssid=MikroTik
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 disabled=yes interface=wlan1
add bridge=bridge1 disabled=yes interface=wlan2
/interface wifi cap
set caps-man-addresses=100.0.1.1 discovery-interfaces=bridge1
/interface wireless cap
# 
set bridge=bridge1 certificate=request discovery-interfaces=ether1 enabled=yes interfaces=wlan1,wlan2
/ip dhcp-client
add interface=ether1
/system identity
set name="Mikrotik wAP AC Garage"  

Content-Key: 71991396704

Url: https://administrator.de/contentid/71991396704

Printed on: April 28, 2024 at 17:04 o'clock

Member: Hypernia
Hypernia Mar 04, 2024 at 10:15:25 (UTC)
Goto Top
Ergänzung: Mein Handy ist im HaHo 5Ghz, müsste also in VLAN 100 auskommen. Wenn ich die Firewall-Regel bzgl. "Drop Inter-VLAN-Routing" deaktiviere, kann ich erfolgreich den CSS610 erreichen.
Member: Hypernia
Hypernia Mar 04, 2024 at 11:53:02 (UTC)
Goto Top
Update 2 mit extremem Facepalm: Ich habe meine Wireguard-App am Handy angeschaltet gehabt. Da das über den Server kommt, ist alles so gelaufen, wie es sollte bzw. den Fall habe ich bislang einfach nicht bedacht.

Zudem hat der liebe @aqui mich darauf hingewiesen, dass die IPs im 100.*-Bereich nicht zulässig sind. Falls jemand davon etwas übernimmt, bedient euch in den https://de.wikipedia.org/wiki/Private_IP-Adresse#Private_Adressbereiche
Member: commodity
commodity Mar 04, 2024 updated at 12:25:59 (UTC)
Goto Top
Auch kein Hallo,
Discussion guidelines - The rules for our content
Die erste Frage die sich mir gestellt hatte: Kann ich eigentlich irgendwo sehen, welches Gerät welchem VLAN zugeordnet ist?
Im Reiter Bridge\Hosts der WinBox siehst Du die Geräte (MAC) und die zugewiesenen VLANs. Die Verbindung MAC zu Gerätename findest Du dann entweder bei den DHCP-Leases oder im KidControl-Devices-Menü.

Heißt Update2, dass der Rest erledigt ist? Ansonsten: How to correctly ask a question

Ergänzender Hinweis: Ein CRS326 ist - trotz des Namens - kein Router und dafür ziemlich ungeeignet. Du kannst damit routen, wirst aber wenig Freude daran haben. Klassischer Fehler beim Einkauf. Nicht ausreichend recherchiert. Bist nicht allein damit face-smile

Auch kein Gruß,
commodity
Member: Hypernia
Hypernia Mar 04, 2024 at 13:57:01 (UTC)
Goto Top
Hi commodity,

Zitat von @commodity:

Die erste Frage die sich mir gestellt hatte: Kann ich eigentlich irgendwo sehen, welches Gerät welchem VLAN zugeordnet ist?
Im Reiter Bridge\Hosts der WinBox siehst Du die Geräte (MAC) und die zugewiesenen VLANs. Die Verbindung MAC zu Gerätename findest Du dann entweder bei den DHCP-Leases oder im KidControl-Devices-Menü.
Danke dir!

Zitat von @commodity:

Heißt Update2, dass der Rest erledigt ist? Ansonsten: How to correctly ask a question
Ja. Ganz liebe Grüße face-wink

Zitat von @commodity:

Ergänzender Hinweis: Ein CRS326 ist - trotz des Namens - kein Router und dafür ziemlich ungeeignet. Du kannst damit routen, wirst aber wenig Freude daran haben. Klassischer Fehler beim Einkauf. Nicht ausreichend recherchiert. Bist nicht allein damit face-smile
Vorher war es ein hAP AC². Ich brauche die Menge an Ports (aber nicht wegen der User, sondern wegen der Anzahl an Anschlüssen im Haus etc.), möchte es im 19-Zoll-Rack haben und nicht Unmengen an Kohle ausgeben. Dass es grundsätzlich potentere Geräte gibt, ist mir klar und auch, dass CRS eher so ein Hybrid-Ding ist. Wo würdest du Probleme sehen bzw. womit das Setup ergänzen? Es geht halt darum, ein Wohnhaus zu versorgen. Ein paar Smarthome-Geräte haben quasi keinen Durchsatz und darauf kommen halt Familie + Gäste.

VG Hypernia
Member: commodity
commodity Mar 04, 2024 at 15:46:53 (UTC)
Goto Top
Wo würdest du Probleme sehen
Vor allem Routing-Performance. Selbst der (für privat akzeptable) hAP ac2 hat fast das Vierfache der Routing-Leistung des CRS (der eben ein Switch ist - und entsprechend schneller switcht, als es der hAP je könnte).

screenshot 2024-03-04 163343
https://mikrotik.com/product/CRS326-24G-2SplusRM#fndtn-testresults
screenshot 2024-03-04 163502
https://mikrotik.com/product/hap_ac2#fndtn-testresults

Spannend wird es auch bei prozessorfordernden Sachen wie VPN. Da wird der 326 eins fix in die Knie gehen. Nicht ohne Grund gibt's für den 326 keine IPsec-Angaben.

Wenn Ihr low-traffic seid und kein VPN am Router braucht, ist das kein Problem. Wenn das Netz jedoch laggt - immerhin nutzt Du ja VLANs, die vielleicht geroutet werden wollen, kann es gut und gern am Switch(Router) liegen.

Wenn Du das merkst, kannst Du ja wieder den hAP fürs Routing einsetzen face-big-smile Ist das Gerät meiner Wahl in kleineren Umgebungen (Büro, Arztpraxis usw.).

Kannst ja mit Graphing die Prozessorlast im Blick behalten.

Viele Grüße, commodity