Setting up a SNAT

A SNAT or source NAT lets you redirect packets that are beeing sent to a specific IP and Port.

Lets say wo want to have a server in your internal network that you want to be able to ssh into using your Public IP on port 2022.

In the Policy Manager go to Edit > Add Policy...

There go to Manage Custom... > New... > Add... > Server Port: 2022

This way you define a template for a firewall rule that is looking at traffic inbound on port 2022.

Select this new template and select Add Policy...
Here you choose Any-External in the From field and at the to field click on Add... > Add SNAT... > Add... > Add... >

At IP Address or Interface you define the external IP that you want to connect to. At host the IP in your local network.

Now check the box that says set internal port to a different port to redirect traffic incomming on port 2022 to port 22.

Cheers,
Ori


SNAT anlegen

Eine Source NAT ermöglicht es euch Pakete die an eine bestimme IP und einen bestimmten Port gehen umzuleiten.
Wollt Ihr beispielsweise, dass ein Server im internen Netz über Port 2022 eurer öffentlichen IP über SSH erreichbar ist, könnt Ihr das folgendermaßen einrichten.

Geht im Policy Manager auf Edit > Add Policy...

Dort dann auf Manage Custom... > New... > Add... > Server Port: 2022
So definiert ihr erstmal ein Template für eine Regel, die Traffic auf Port 2022 annimmt.

Wählt dann dieses angelegte Template aus und wählt Add Policy...
Hier wählt ihr dann als From "Any-External" und geht bei to auf Add... > Add SNAT... > Add... > Add... >

Bei IP Address or Interface nehmt ihr die externe IP auf der Ihr den Server ansprechen wollt, bei host die IP aus dem lokalen Netz.
Setzt jetzt noch den Haken um die Anfrage die Extern auf Port 2022 eingeht intern auf port 22 zu lenken.

Cheers,
Ori


Using aliases

Aliases are awesome.
You do want to have them.
Period.

Aliases in WatchGuard can stand for an IP address or a range of IP addresses.
Those aliases can then be used in firewall rules.

In case you make a change at one of those aliases at a later point, all the rules using this alias will be changed.
Especially if you work on a lot of machines with thousands of rules, you definitely do want this.

Go to Setup > Aliases... to manage the aliases on the WatchGuard.

I create a new alias named Gravityzone and use DNS lookup to fill that alias with a buch of IPs related to the BitDefender GravityZone Cloud.

Confirm the creation of the new alias by clicking on ok.

This new alias can now be used in firewall rules. This rule for example gets used to enable clients to talk to the GravityZone, that are not supposed to be able to surf the web.

Just place the following before the deny rule and it works.

Cheers,
Ori


Aliase nutzen

Aliase sind toll.
Ihr wollt Aliase haben. Punkt.

Hinter eines Aliases können bei WatchGuard eine IP oder eine Range von IPs stehen.
Die Aliase könnt Ihr dann beim Erstellen von Firewallregeln verwenden.

Wenn Ihr dann irgendwann mal eine Änderung an einem Alias vornehmt, werden gleich alle Regeln geändert in dem dieser Alias verwendet wurde. Grade wenn ihr sehr viele Firewalls mit tausenden von Regeln administriert, wollt ihr nicht jede Regel anfassen müssen, wenn sich etwas verändert. (!)

Unter Setup > Aliases... könnt ihr die Aliases auf der WatchGuard verwalten.

Ich lege jetzt einen Alias mit dem Namen Gravityzone an und sage, dass er die IPs über DNS lookup selbst auflösen soll.

Wenn ihr diesen Dialog mit OK bestätigt, füttert die WatchGuard euren Alias mit den IPs der BitDefender Gravity Zone.

Mit einem klick auf OK ist der neue Alias "Gravityzone" erstellt.
Dieser Alias kann jetzt in einer Firewallregel verwendet werden.
Diese Regel verwende ich zum Beispiel um Geräte, deren Zugang zum Internet blockiert ist, mit der Bitdefender Gravityzone sprechen zu lassen.
Folgendes einfach vor die Deny Regel schieben und schon funktioniert es.

Cheers,
Ori


Connect OpenVPN with WatchGuard SSL-VPN

To connect a Linux client with WatchGuard SSL-VPN you can use OpenVPN.
I am going to demonstrate this using Ubuntu 18.04 Desktop.

First login to https://WatchGuard-IP:Port/ssl-vpn.html and download the Mobile VPN with SSL client profile.

Then install OpenVPN, the OpenVPN network manager and the Gnome desktop integration.

sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome

After the installation has completed move the downloaded file client.ovpn to /etc/openvpn/

sudo mv ~/Downloads/client.ovpn /etc/openvpn/

Now go to Network > VPN and add a new VPN.

Select Import from file ...

... and select the .ovpn config that you moved to /etc/openvpn.

This will openin he Add VPN window.
Add the IP:Port of the WatchGuard as well as the User Credentials and then klick Add.

You can now go to Network > VPN or more comfortably select the Network in the upper right screen corner to enable the VPN.

If you have successfully connected, you will find a new tun interface.

ip address show

IPs from the internal target network should now be reachable.

You can disable the VPN the same way you enabled it.

Cheers,
Ori


OpenVPN mit WatchGuard SSL-VPN verbinden

Um eine Verbindung mit einem WatchGuard SSL-VPN von Linux aus herzustellen könnt ihr OpenVPN benutzen.
Ich zeige euch das in diesem Beispiel anhand von Ubuntu 18.04.

Zunächst meldet ihr euch an https://WatchGuard-IP:Port/ssl-vpn.html an und ladet euch das Mobile VPN with SSL client profile herunter.

Anschließend installiert ihr Open VPN, den Open VPN Network manager und die Gnome Desktop Integration.

sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome

Nach der Installation verschiebt Ihr die heruntergeladene Datei client.ovpn nach /etc/openvpn/

sudo mv ~/Downloads/client.ovpn /etc/openvpn/

Danach geht ihr zu Network VPN und fügt ein neues VPN hinzu.

Wählt hier jetzt Import from file ...

... und wählt eure .ovpn config, die Ihr unter /etc/openvpn abgelegt habt aus.

Das öffnet das Add VPN Fenster.
Gebt ihr als Gateway die IP:Port der WatchGuard and sowie die User Credentials und klickt dann auf Add.

Jetzt könnt ihr über Network > VPN oder komfortabel über die Schaltfläche am oberen rechten Bildschirmrand die VPN Verbindung herstellen.

Wenn die Verbindung aktiviert wurde werdet ihr feststellen, dass Ihr nun ein neues tun interface habt.

ip address show

Interne IPs aus dem Zielnetz sollten jetzt erreichbar sein.

Auf dem gleiche Weg, wie Ihr das VPN aktiviert habt, könnt Ihr es auch wieder deaktivieren.

Cheers,
Ori


Setting up QOS

In this article I want to demonstrate how you can setup QoS on a WatchGuard firewall.
QoS means Quality of Service and means reserving a certain amount of bandwidth for certain types of traffic.

Configuration

First we have to enable QoS on the firewall.
Since QoS is a quite resource heavy feature it is disabled by default.

Go to Setup > Global Settings...

Here you change to the Networking tab and select Enable all traffic management and QoS Features

When defining a new firewall rule, lets say a Any rule, we can change to the Advanced tab and define Traffic Management Actions.
Here we can choose Maximum bandwidth, think of a rule only triggered by YouTube, or Guaranteed bandwidth for things like voice.

 

Cheers,
Ori


QOS einrichten

In diesem Artikel möchte ich zeigen, wie man QoS auf einer WatchGuard Firewall anwenden kann.
QoS steht für Quality of Service und beschreibt eine Technik bei der Bandbreite für bestimmten Traffic reserviert wird.

Umsetzung

Als erstes müssen wir auf der Firewall generell erstmal QoS aktivieren.
Da es sich um ein CPU-lastiges Feature handelt, ist es im Default deaktiviert.

Geht hierzu auf Setup > Global Settings...

Hier setzt ihr dann im Reiter Networking einen Haken bei Enable all traffic management and QoS Features

Wenn wir jetzt eine neue Firewallregel, z.b. von Typ Any anlegen, haben wir im Reiter Advanced die Möglichkeit Traffic Management Actions zu definieren.
Hier können wir sowohl Maximum Bandwidth definieren, denkt hier an eine Regel für YouTube, oder Guaranteed Bandwidth für Dinge wie Voice.

 

Cheers,
Ori


BOVPN Virtual Interfaces

In this article I will show you how can configure a branch office VPN tunnel with virtual interfaces on a WatchGuard Firewall.

BOVPN-Vif is also called Route Based VPN and normal BOVPN is called policy based VPN.
On normal VPN Packets are beeing generated by the kernel and there is no ingress interface in both directions.
A packet beeing sent from a branch office to the HQ travels like this:

At BOVPN-Vif however Traffic gets another layer of encapsulations and travels like this:

 

This makes it possible for example to run TCPDUMP against this virtual interface.
Trubelshooting gets a lot easier.

Generally one can say that virtual interfaces are the newer technology.

BOVPN:

  • Is simple and very solid
  • Connects Network to Network
  • Only allows for 1:1 NAT
  • The networks have to be routed explicitly

BOVPN-Vif:

  • There is a 0.0.0.0/0 wildcard, that allows all traffic
  • There is a virtual interface and you can write Inbound-Firewallrules
  • Supports failover
  • Supports NAT
  • Supports dynamic routing

Interface configuration:

In this example I will show you a BOVPN-Vif test setup with two WatchGuards.

At first you should facory reset the devices and connect to both of the firewalls.
Configure then with 10.0.1.1, 10.0.1.2 and hook them up to a swtich.

This way you can connect to both firewalls simultaneously using the WatchGuard System Manager.
This will make configuration and comparison a lot easier.

Next we will configure a internal network on ETH3 of both boxes.
These networks later on will be connected with a BOVPN-Vif Tunnel and promoted via dinamic routing.

The interface configuration on the firewalls should look like this:

 

Afterwards we will define ETH2 on both firewalls as an external interface and give it an IP address.
In this case I choose 213.73.97.113 and 213.73.97.114.

You can choose a private class C address as well.
It just feels wierd to me defining a class C address of type external but it makes no difference.
And since you are not conecting the devices to the internet it makes no difference really.

Note that the default gateway has to be the other firewall in this specific case.
In a real world envoirement you would provide the next-hop, eg. router or ISP Gateway.

 

Preparing the BOVPN

Now that the interfaces are configured we will setup the BOVPN.
You should be clear on the following parameters prior to setting up the tunnel.

This setup is only one possible example.

General:

  • Tunnel Endpoints
  • Gateway IDs

IKEv1 / IKEv2:

  • IKE version
  • Authentication algorithm
  • Encryption algorithm
  • Diffie-hellmann-group
  • Lifetime
  • Encryption scheme
  • Negotioation mode
  • DPD traffic idle timeout
  • DPD max retries
  • IKE keep alive

IPSEC:

  • Encryption protocol
  • Authentication algorithm
  • Encryption algorithm
  • Encapsulation Mode
  • Perfect foreword security
  • PFS group
  • Key expiration time
  • Key expiration traffic

Setting up the BOVPN-VIf

At first you set up VPN > BOVPN Virtual Interfaces...  in the Policy Manager

Here you will see right away that the setup of the BOVPN with virtual interfaces is way more intutitive and structured then the normal BOVP setup process.
In the top we will provide a name for the virutal interface and define what type of device is on the other end of the tunnel.

Then we change the following settings in the Gateway Settings section:

  • Pre-Shared Key: must be the same on both devices
  • Interface Physical: VPN traffic will be sent over this interface
  • Gateway ID: IP address of the lokalen gateway
  • Remote Gateway IP Address
  • Remote Gateway ID

On the other firewall we configure these settings exaclty the other way arround:

In the VPN Routes section we coud define static routes into the networks 10.0.10.0/24 and 10.0.20.0/24.
In this example however I would like to use dynamic routing.
This however we will configure later.

Here you can also give an address to the virutal interface.
I use 10.0.99.1 and 10.0.99.2 for the firewalls in this setup.

The we switch to Phase 1 Settings.
Here we configure the following:

  • IKE Version: 2
  • Transform: Sha2-256-AES
  • Key Group

Then we configure the Phase 2 Settings:

  • Perfect Forward Security (PFS): Enabled
  • DF Group
  • IPSec Proposal: AES256-SHA256

We do not need to touch the Multicast Settings.

Now we look at the routing.
I use BGP in this example, you can use another protocol if you want.
I will not explain this configuration since this is not what this article is about.

Go to Network > Dynamic Routing... activate dynamic routing and switch to BGP.
Here you enter the following:

Please choose another AS Nummer, in this case 34001 und 34002, that is above 65000.
Your test-setup should be disconnected from the internet.
If you somehow are forwaring traffic to the internet however you should know that BGP is the protocol that carriers use to exchange routingtables.
The AS numbers above 65000 are unused and free, everyhing below could be the number of an Autonomen Systems of an ISP...

Next we need to configure Multi-WAN since we now have more then one external interfaces.
If we dont do that the interfaces are in state FAILED per default and will be ignored.

Select Network > Configuration... in the Policy Manager and change to the Multi-WAN settings in the top right.
We will now configure a pingcheck against the other firewall on the VPN Interface.

In order for this to work and the interface not beeing in the state of FAILED we will have to add the other firewall on both devices to the ICMP firewall rule.

Afterwards you write the config to both devices, attach the cables of the vpn interface and the tunnel should come online after a moment.
To test if everything worked fine you can hook up a client to the neworks 10.0.10.0/24 and 10.0.20.0/24.

If the clients can reach each other it means that the tunnel has been established successfully and the routes have been learned dynamicly.

Cheers,
Ori


BOVPN-Vif einrichten

In diesem Artikel geht es darum, wie man auf einer WatchGuard Firewall einen Branch Office VPN Tunnel mit Virtuellen Interfaces einrichten kann.

Man bezeichnet BOVPN-Vif auch als Route based VPN und (normales) BOVPN als Policy based VPN.
Bei Normalem BOVPN werden die Pakete vom Kernel generiert und es gibt somit kein eingehendes Interface.
Ein Paket, das von einer Zweigstelle zur Zentrale geschickt wird, würde sich dann so bewegen:

Bei BOVPN-Vif hingehen wird der Traffic nochmal verkapselt und es sieht dann folgendermaßen aus:

 

Das ermöglich z.b. einen TCPDUMP an dem Virtual Interface zu machen.
Das erleichtert das Troubleshooting ungemein.

Grundsätzlich kann man sagen, dass Virtuelle Interfaces die neuere Technologie sind.

Bei BOVPN gilt:

  • Es ist einfach und sehr solide
  • Verbindet Netz zu Netz
  • Ermöglicht nur 1:1 Nat
  • Die Netze müssen explizit geroutet werden

Bei BOVPN-Vif gilt:

  • Es gibt eine 0.0.0.0/0 wildcard, die allen Traffic erlaubt
  • Es gibt ein Interface und es lassen sich Inbound-Firewallregeln schreiben
  • Kann Failover
  • Kann Natting
  • Kann Dynamisches Routing

Interfacekonfiguration:

Ich zeige in diesem Beispiel, wie eine BOVPN-Vif Konfiguration mit zwei Watchguards in einem Testsetup gebaut werden kann.

Als erstes solltet ihr die Geräte Factory resetten und euch mit beiden Firewalls verbinden.
Anschließend vergebt Ihr den Geräten die 10.0.1.1, die 10.0.1.2 und hängt sie an einen Switch.

So ist es möglich, dass ihr euch mit dem WSM zu beiden Firewalls gleichzeitig verbinden könnt.
Das macht das Konfigurieren und abgleichen von Parametern wesentlich einfacher.

Als nächstes richten wir auf beiden Firewalls jeweils auf ETH3 ein internes Netz mit aktivem DHCP ein.
Dieses Netz wird wird später über dynamisches Routing und einem BOVPN-Vif miteinander verbunden.

Die Interface Konfiguration auf den Firewalls sollte etwa so aussehen:

 

Anschließend wollen wir ETH 2 auf beiden Firewalls als externes Interface definieren und eine IP Adresse geben.
Ich habe in diesem Beispiel die Adressen 213.73.97.113 und 213.73.97.114 gewählt.

Ihr könntet natürlich auch private Adressen aus dem Klasse C Netz nutzen.

Da das Setup aber eh nicht ans Internet gelassen wird, macht es für uns keinen Unterschied.
Beachtet auch, dass als Default Gateway die andere Firewall eingetragen wird, in einer Produktivumgebung würde hier der Next-Hop eingetragen werden.

 

BOVPN vorbereiten

Jetzt wo die Interfaces konfiguriert sind, geht es daran das BOVPN aufzusetzen.
Generell gilt, ihr solltet euch über folgende Parameter vorab im Klaren sein.

Dieses Setup ist nur eine Beispiel, wie es eingerichtet werden kann.

Allgemein:

  • Tunnel Endpunkte
  • Gateway IDs

IKEv1 / IKEv2:

  • IKE Version
  • Authentifizierungsalgorithmus
  • Verschlüsselungsalgorithmus
  • Diffie-Hellmann Gruppe
  • Lifetime
  • Encryption Scheme
  • Negotioation Mode
  • DPD traffic idle timeout
  • DPD max retries
  • IKE keep alive

IPSEC:

  • Verschlüsselungprotokoll
  • Authentifizierungsalgorythmus
  • Verschlüsselungsalgorithmus
  • Encapsulation Mode
  • Perfect Foreword Security
  • PFS Gruppe
  • Key expiration time
  • Key expiration traffic

BOVPN-VIf aufsetzen

Als wählt ihr im Policy Manager VPN > BOVPN Virtual Interfaces...  

Hier wird euch direkt auffallen, dass die Einrichtung des BOVPN mit virtuellen Interfaces wesentlich intuitiver ist als das Normale BOVPN Setup.
In der Kopfzeile geben wir dem Virtuellen Interface auf der Firewall einen Namen und legen fest, um welchen Gerätetyp es sich bei dem anderen Endpunkt handelt.

Dann passen wir im Reiter Gateway Settings folgende Einstellungen an:

  • Pre-Shared Key: Muss auf beiden Geräten selbstredend der Selbe sein
  • Interface Physical: Das physische Interface über welches der VPN Traffic geschickt werden soll
  • Gateway ID: IP Adresse des lokalen Gateways
  • Remote Gateway IP Address: IP Adresse des Tunnel Endpunkts, die andere Firewall
  • Remote Gateway ID: IP Adresse des Gateways am Tunnel Endpunkt

Auf der anderen Firewall konfigurieren wir das ganze genau andersherum:

Im Reiter VPN Routes könnten wir jetzt über Statische Routen die Netze 10.0.10.0/24 und 10.0.20.0/24 eintragen.
In diesem Beispiel möchte ich aber dynamisches Routing verwenden, dazu später mehr.

Hier könnt ihr dem virtuellen Interface noch eine Adresse geben, ich verwende 10.0.99.1 und 10.0.99.2 für die beiden Firewalls.

Den nächsten Reiter den wir anpassen ist Phase 1 Settings.
Hier passen wir folgende Einstellungen an:

  • IKE Version: 2
  • Transform: Sha2-256-AES
  • Key Group

Dann kümmern wir uns um die Phase 2 Settings.
Hier sind wichtig:

  • Perfect Forward Security (PFS): Enabled
  • DF Group
  • IPSec Proposal: AES256-SHA256

Die Multicast Settings müssen wir nicht anfassen.

Jetzt nehmen wir uns dem Routing an.
Ich nehme in diesem Beispiel BGP, ihr könnt aber auch ein anderes Protokoll verwenden wenn ihr dies möchtet.
Ich erkläre die Konfiguration explizit nicht in diesem Artikel, da das Augenmerk auf der Einrichtung des Tunnels liegen soll.

Geht im Policy Manager auf Network > Dynamic Routing... aktiviert dynamisches Routing und wählt den Reiter BGP.
Tragt hier folgendes ein:

Bitte verwendet eine AS Nummer, in diesem Fall 34001 und 34002 über 65000.
Euer Testsetup sollte zwar vom Internet getrennt sein.
Falls ihr allerdings irgendwie doch ins Internet Routet, solltet ihr wissen, dass BGP das Protokoll ist mit dem Carrier ihre Routen austauschen.
Die AS Nummern über 65000 sind frei, alles darunter könnte die Nummer eine Autonomen Systems eines ISPs sein...

Als Nächstes müssen wir Multi-WAN konfigurieren, da wir nun mehr als ein externes Interface haben.
Wenn wir dies nicht machen steht das Interface per Default auf FAILED und wird ignoriert.

Dazu wählen wir im Policy Manager nochmals Network > Configuration... und wechseln hier zu dem Multi-WAN Reiter.
Wir definieren nun einen Pingcheck gegen die jeweils andere Firewall auf dem VPN Interface.

Damit dieser Pingcheck auch funktioniert und das Interface nicht im Status FAILED steht, müssen wir noch die ICMP Firewallregel auf den Geräten anpassen.

Anschließend speichert ihr auf beiden Firewalls die Config, verkabelt die Geräte und euer Tunnel sollte sollte online kommen.
Zum testen könnt ihr jeweils einen Client mit den Netzen 10.0.10.0/24 und 10.0.20.0/24 verbinden.

Wenn sich die Clients erreichen können, ist der Tunnel erfolgreich aufgebaut und die Routen gelernt worden.

Cheers,
Ori