Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Seiteneigenschaften


Description:

In diesem Artikel werden Best-Practice Empfehlungen für die Erstellung von Firewall-Regeln auf LANCOM Routern mit LCOS aufgezeigtThis article describes best practices for creating firewall rules on LANCOM routers with LCOS.


Recommendations:

1. Nur Ziel-Port in einer Firewall-Regel angeben: ) Specify only the destination port in a firewall rule: 

Since network communications generally use random source ports (with a few exceptions, e.g. IPsec), only one protocol/target service may be specified in a firewall rule. The protocol/source service must be left in the default setting Da bei der Netzwerk-Kommunikation bis auf wenige Ausnahmen (z.B. IPSec) ein zufälliger Quell-Port verwendet wird, darf in einer Firewall-Regel nur ein protocol/target service angegeben werden. Der protocol/source service muss auf der Standardeinstellung all protocols/source services belassen werden. Ansonsten greift die Regel nicht. Otherwise the rule will not be applied



2. Zusammenfassen von IP-Adressen in einem IP-Adressbereich:Generell ist es empfehlenswert mehrere IP-Adressen in einem IP-Adressbereich zusammenzufassen, anstatt diese einzeln anzugeben) Collect IP addresses into a single IP address range:

It is generally advisable to group several IP addresses into a range of IP addresses, rather than specifying them individually



3. Ein- und ausgehenden Datenverkehr in unterschiedliche Firewall-Regeln auftrennen:

Die Firewall teilt einzelne Regeln in Filter auf. Dabei stellt jede Kombination aus Verbindungs-Quelle, Verbindungs-Ziel, Quell-Dienst und Ziel-Dienst einen Filter dar. Beim Aufbau einer neuen Session werden die Filter durchlaufen, bis ein passender Filter gefunden wird. Je mehr Filter durchlaufen werden müssen, desto mehr Performance wird benötigt. Daher sollte bei der Regel-Erstellung darauf geachtet werden, dass möglichst wenig Filter daraus resultieren (sowohl innerhalb einer Regel als auch gesamt). 

Die Anzahl der Filter resultieren aus der Anzahl der Kombinationsmöglichkeiten der Stations-Objekte multipliziert mit der Anzahl der Protokolle.

) Separate incoming and outgoing data traffic into different firewall rules:

The firewall divides individual rules into filters. Any combination of connection source, connection destination, source service and destination service represents a filter. When a new session is set up, the filters are run through until a suitable filter is found. The more filters that have to be run through, the more performance is required. When creating rules, care should be taken to ensure that as few filters as possible are used (both within a rule and in general). 

The number of filters results from the number of possible combinations of station objects multiplied by the number of protocols.

Info

The total number of filters can be viewed using the console command

Info

Die Gesamt-Anzahl der Filter kann über den Konsolen-Befehl ls Status/IP-Router/Filter eingesehen werden. Die Filter selber können über den Befehl show filter aufgerufen werden. The filters themselves can be invoked by using the show filter command.


Hinweis

In Installationen mit sehr vielen Filtern kann der Aufruf des Befehls show filter zu einem unvermittelten Neustart des Routers führen. Daher sollte in einem solchen Szenario zuerst die Gesamt-Anzahl an Filtern geprüft und die Firewall-Regeln optimiert werden.

...

installations with a large number of filters, invoking the show filter command leads to an abrupt restart of the router. Therefore, in such a scenario, the total number of filters should first be checked and the firewall rules optimized.


Example:

For HTTP and HTTPS over a VPN connection, communication should be allowed in both directions. The second solution below is preferred because fewer filters are generated.

  • A single firewall rule is created for the communication in both directions(source and destination are the same).
    • In the firewall rule there are 4 possible combinations of station objects.
    • 2 protocols are allowed (HTTP and HTTPS).
    • This results

...

Die Kommunikation für HTTP und HTTPS soll über eine VPN-Verbindung in beide Richtungen erlaubt werden. Die zweite Lösung ist dabei zu bevorzugen, da weniger Filter erzeugt werden.

  • Es wird eine einzelne Firewall-Regel erstellt für die Kommunikation in beide Richtungen (Quelle und Ziel sind gleich).
    • In der Firewall-Regel gibt es 4 Kombinationsmöglichkeiten der Stations-Objekte.
    • Es werden 2 Protokolle erlaubt (HTTP und HTTPS).
    • Dies resultiert in 4 x 2 = 8 Filternfilters.

  • Two firewall rules are created and the incoming and outgoing communications are handled separately.
    • For each firewall rule there is just 1 possible combination of station objects.
    • 2 protocols are allowed (HTTP and HTTPS).
    • This results in 1 x 2 filters per firewall rule, i.e. 4 filters in total
    Es werden zwei Firewall-Regeln erstellt und die ein- und ausgehende Kommunikation aufgeteilt.
    • Je Firewall-Regel gibt es lediglich eine Kombinationsmöglichkeit der Stations-Objekte.
    • Es werden 2 Protokolle erlaubt (HTTP und HTTPS).
    • Dies resultiert in 1 x 2 Filtern je Firewall-Regel, also 4 Filter insgesamt.

 



4. Priorisierung von Firewall-Regeln:Die Firewall-Regel-Tabelle wird von oben nach unten durchlaufen, bis eine Regel greift. Grundsätzlich sortiert die Firewall die Regeln bereits in der passenden Reihenfolge.) Prioritization of firewall rules:

The firewall rule table is run through from top to bottom until a rule takes effect. Basically, the firewall sorts the rules into the appropriate order. 


In Einzelfällen kann es allerdings erforderlich sein, die Priorisierung für eine Regel anzupassen. Im folgenden werden zwei Beispiele beschrieben:

Content-Filter Regel:

Die Regel für den Content-Filter muss als Erstes greifen, daher wird dieser die Priorität 9999 zugewiesen.

Image Removed

Übersicht der Firewall-Regel-Tabelle:

Image Removed

Aufbau einer VPN-Verbindung auf dem VPN-Responder verhindern:

Ist eine VPN-Verbindung abgebaut und es wird auf der Seite des VPN-Responders ein Zugriff auf Ressourcen in dem VPN-Netzwerk initiiert, versucht der Router die VPN-Verbindung aufzubauen. Wurde dem Router keine Gateway-IP-Adresse der Gegenseite bekanntgegeben (etwa bei einer dynamischen IKEv2-Verbindung mit Identitäten), wird der Aufbau der VPN-Verbindung fehlschlagen.

some cases, it may be necessary to adjust the prioritization of a rule. Two examples are described below:

Content filter rule:

The rule for the content filter must take effect first, so this is given the priority 9999.

Image Added

Overview of the firewall rule table:

Image Added



Preventing a VPN connection to the VPN responder:

If a VPN connection disconnects and the VPN responder side attempts to initiate access to resources in the VPN network, the router will try to set up the VPN connection. However, if the router has no information about a gateway IP address on the remote side (e.g. with a dynamic IKEv2 connection using identities), the VPN re-connect will fail.

This can be prevented by creating a firewall rule that blocks data traffic to a network accessed via VPN if there is no VPN connection in place Um dies zu verhindern, kann eine Firewall-Regel erstellt werden, die Datenverkehr zu einem per VPN erreichbaren Netzwerk unterbindet, sofern die VPN-Verbindung noch nicht aufgebaut ist (DENY-VPN-NOT-CONNECTED). Diese muss höher priorisiert werden als die restlichen Firewall-Regeln, damit diese als Erstes greift.Zusätzlich muss aufgrund einer Sonderbehandlung für DNS-Pakete eine weitere Firewall-Regel für DNS erstellt werden, die höher priorisiert ist als die Regel This must have a higher priority than the other firewall rules so that it takes effect first.

Additionally, the special treatment of DNS packets requires the creation of another firewall rule for DNS that is prioritized higher than the DENY-VPN-NOT-CONNECTED rule.  

 

Übersicht der Firewall-Regel-TabelleOverview of the firewall rule table:



5. Fragmentierung und PMTU-Reduzierung in QoS-Regeln nur im Ausnahmefall aktivieren:) Only in exceptional cases should fragmentation and PMTU reduction for QoS rules be enabled:

The options Fragmentation and PMTU reduction in QoS rules (under Die Optionen Fragmentierung und PMTU-Reduzierung in QoS-Regeln (unter Note for users of Internet connections with low bandwidth) sollten nur im absoluten Ausnahmefall aktiviert werden.

Durch die Aktivierung dieser Optionen sind alle Pakete der Internet-Gegenstelle betroffen, für die diese Regel gilt. Dies kann zu geringen Übertragungsgeschwindigkeiten und sogar zu Verbindungsabbrüchen von Applikationen führen.

6. Keine VPN-Regeln in der Firewall erstellen:

In sehr alten LCOS-Versionen mussten VPN-Regeln noch in der Firewall angelegt werden, indem dort anstelle der Option Diese Regel ist für die Firewall aktiv die Option Diese Regel wird zum Erzeugen von VPN-Netzbeziehungen (SAs) verwendet ausgewählt wird. Dies wirkt sich allerdings negativ auf die Übersicht aus und es kann unbeabsichtigt zum Erstellen von VPN-Netzbeziehungen (SAs) kommen. Weiterhin gehören die VPN-Regeln thematisch zum VPN und nicht in die Firewall.

Ab LCOS 9.24 können VPN-Regeln in dem Menü VPN → Allgemein → Netzwerk-Regeln angelegt werden. LANCOM Systems empfiehlt daher die VPN-Regeln in diesem Menü zu pflegen anstatt in der Firewall.

should only be activated in exceptional cases.

Enabling these options affects all packets from the Internet peers that the rule applies to. This can cause slow transmission speeds and even application disconnects.



6) Do not create VPN rules in the firewall:

In very old versions of LCOS, VPN rules still had to be created in the firewall by selecting the option This rule is used to create VPN network relationships (SAs) instead of the option This rule is active for the firewall. However, this does nothing for clarity and may inadvertently create VPN network relationships (SAs). Furthermore, the VPN rules belong to the VPN and not to the firewall.

As of LCOS 9.24, VPN rules can be created in the menu VPN → General → Network rules. LANCOM Systems therefore recommends that VPN rules should be maintained in this menu instead of in the firewall.

Hinweis

If a VPN rule is created in the firewall, ensure that the options This rule is active for the firewall and This rule is used to create VPN network relationships (SAs) are not enabled in a rule at the same time. A rule is either a firewall rule or a VPN rule, but never both

Hinweis

Wenn eine VPN-Regel in der Firewall erstellt wird, dürfen auf keinen Fall die Optionen Diese Regel ist für die Firewall aktiv und Diese Regel wird zum Erzeugen von VPN-Netzbeziehungen (SAs) verwendet gleichzeitig in einer Regel aktiviert werden. Eine Regel ist entweder eine Firewall- oder eine VPN-Regel, aber niemals beides.