Schlagwort: routing

MikroTik Hotspot Login Redirect mit Routing Marks

Symptom: Hotspot Login Page auf Endgeräten wird bei Setups mit mehreren WAN-Uplinks (Nutzung von Mangle Regeln und Routing Marks) nicht geladen.

Lösung:

/ip firewall mangle add action=accept chain=prerouting comment="no marking for hotspot traffic before authentication (else captive portal can't be reached)" hotspot=!auth in-interface-list=local src-address-list=hotspot

Quelle

MikroTik Failover, Load Balancing und Recursive Routing

Hinweise:

  • bei Default Routes (0.0.0.0/0):
    • Check Gateway mittels Ping aktivieren
    • Target-Scope auf 11
      Dies ist v.a. ab RouterOS 7.x relevant.
      Target-Scope bei den Default Routes muss größer als bei den „Testing Routes“ sein, welche den default Target-Scope 10 haben.

Quellen:

MikroTik Routing Hints

  • NATting?
    • Im Idealfall kein NAT verwenden.
    • Ggf. SRCNAT-IP, die nicht zur relevanten Route / Routing-Table / Interface-IP passt?
      • Lösungsoptionen: MASQUERADE statt SRC-NAT oder die richtige IP-Adresse für das SRC-NAT verwenden.
  • Firewall Regel: fehlende Forward-Regel?
  • Routes: Hin- und Rückweg korrekt definiert?
  • Mangle / Routing Tables: Traffic landet in richtiger Table und dort ist auch eine passende Route vorhanden?
    • Beispiel: Traffic landet wegen Mangle-Regel in der Routing-Table inet1, wo jedoch nur globale Default Routes definiert sind. Soll der Traffic aber bspw. mittels einer spezifischen Route in der Routing-Table main über ein VPN-Netzwerk geleitet werden, so würde genau diese spezifische Route nicht greifen, da wegen der Mangle-Regeln die Routes in inet1 verwendet werden.

RouterOS 7: OSPF Redistribute Connected Routes

/routing/filter/rule/add chain=ospf-redist rule={if [protocol connected] then={action do=accept}

/routing/ospf/instance/set default out-filter-chain=ospf-redist

Zudem Bug bei IP-Addresses vermutet (RouterOS 7.0.2): Erst das Ändern der IP-Adresse auf der VPN-Bridge (/24 entfernen und wieder hinzufügen) hat ein korrektes Routing über die VPN-Bridge ergeben.

Quellen:

https://help.mikrotik.com/docs/display/ROS/ROSv7+Basic+Routing+Examples#ROSv7BasicRoutingExamples-OSPFConfiguration

https://forum.mikrotik.com/viewtopic.php?t=173574

MikroTik Mangle / Routing

Bei Anpassungen der Mangle-Regeln mark routing oder der Routen in der „Route List“, ggf. den Router neustarten.
Ansonsten kann es vorkommen, dass das Routing (wie in der Routing Table dargestellt) nicht greift bzw. davon betroffene, neue Connections abgelehnt werden.

Teilweise kommt es in WinBox auch vor, dass die aktiven / inaktiven Routen in der Route List bei einem Statuswechsel nicht korrekt aktualisiert werden (Flags und farbliche Darstellung sind falsch). Hier hilft es, das Fenster „Route List“ innerhalb der WinBox zu schließen und neu zu öffnen. (Quelle zum WinBox-Bug)

MikroTik FastTrack and FastPath

FastTrack = FastPath + Connection Tracking

All related information and sources:

FastPath
FastPath allows to forward packets without additional processing in the Linux kernel. It improves forwarding speeds significantly. For FastPath to work, interface support and specific configuration conditions are required. Automatically use of IPv4 FastPath if criterias are matching, see here.
Packets can be forwarded by fast path handler (e.g. ipv4 fasttrack) only if at least source interface support FastPath. For complete FastPath forwarding destination interface support is also required (see here).

FastTrack
IPv4 FastTrack handler is automatically used for marked connections. Use firewall action „fasttrack-connection“ to mark connections for FastTrack. Currently only TCP and UDP connections can be actually FastTracked. IPv4 FastTrack handler supports NAT.
Note that not all packets in a connection can be FastTracked, so it is likely to see some packets going through slow path even though connection is marked for FastTrack. This is the reason why fasttrack-connection is usually followed by identical accept-rule. FastTracked packets bypass firewall, connection tracking, traffic shaping queues, IPSec*, and several other configurations. So it is up to the administrator to make sure FastTrack does not interfere with other configuration.

Again, please keep in mind: Firewall filter and mangle rules will not be applied for FastTracked traffic!

*FastTrack can break connections running via IPSec! See video Most underused and overused RouterOS tools and features for details. Solutions: Disabling FastTrack or using Raw Firewalling rules for „no track“.

VPN mit Proxy ARP

Use case: VPN-Einwahl, bei der die VPN-Clients IP-Adressen des Zielnetzes erhalten.

Problem: Forwarding / Routing der Pakete zu Geräten im Zielnetz funktioniert nicht. Tx-Pakete gehen an das Zielgerät, Rx-Pakete (Antworten) kommen nicht zurück.

Lösung: Proxy ARP auf lokalem Netzwerk-Interface des VPN-Servers konfigurieren. Kommt auf dem Gateway für das lokale Netz eine Bridge zum Einsatz, ist auf dieser Proxy ARP zu aktivieren.

Quelle