Difference between revisions of "Using PFsense on my ESXi server"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
 
(20 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
=Required :=
 
=Required :=
  
- A server from the [https://www.ikoula.com/en/dedicated-server ] range
+
- A server from the family [https://www.ikoula.com/en/dedicated-server AGILE]
  
- An additional IP address
+
- An additional IP address, can be ordered at your [https://commande.ikoula.com/ Client Area]
  
 
- ESXI 6.7 installed on your server
 
- ESXI 6.7 installed on your server
Line 20: Line 20:
  
  
Configuration utilisée pour la création de l’article :  
+
Settings used to create this article:
  
- Serveur Agile S, processeur Intel® Xeon® E3 1220v5(4c/4t), 8Go de ram et 1To de HDD. Avec bien sûr une ip supplémentaire.
+
- Agile S server, Intel® Xeon® E3 1220v5(4c/4t) processor, 8GB ram and 1TB HDD. With of course an additional IP.
  
- Système d’exploitation : ESXI 6.7
+
- Operating system : ESXI 6.7
  
- Configuration réseau :  
+
- Network Settings:
  
Ip principale : 213.246.45.105/24
+
Main IP: 213.246.45.105/24
  
Ip supplémentaire : 213.246.45.104/24
+
Additional IP: 213.246.45.104/24
  
Ip de la passerelle : 213.246.45.1
+
Gateway IP: 213.246.45.1
  
  
  
== Déploiement de la vm routeur sous PfSense==
+
==       Deploying the router vm under PfSense==
  
=== Création du réseau lan virtuel===
+
=== How to create a virtual lan network===
  
Dans un premier temps, nous allons créer notre commutateur virtuel en nous rendant dans la partie « Mise en réseau » et en cliquant sur « Ajouter un commutateur virtuel standard » :
+
First, we will create our virtual switch by going to the "Networking" section and clicking on "Add a standard virtual switch":
  
 
[[Fichier:Pfs1.PNG]]
 
[[Fichier:Pfs1.PNG]]
  
Ensuite vous allez avoir cette fenêtre, nous vous conseillons de sélectionner les paramètres comme sur la capture ci-jointe :
+
In the the next open window, we advise you to select the parameters as show in the picture:
  
 
[[Fichier:Pfs2.PNG]]
 
[[Fichier:Pfs2.PNG]]
  
Ici nous avons décidé de nommer notre commutateur LAN.
+
We've decided to name our Switch "LAN".
Une fois le commutateur créé, nous allons assigner un groupe de port.
+
Once the switch is created, we will assign a port group.
Il faut se rendre l’onglet « groupes de ports » et cliquer sur Ajouter un groupe de ports comme indiqué ici :
+
We need to go to the "port groups" tab and click on Add a port group as shown here :
 
 
  
 
[[Fichier:Pfs3.PNG]]
 
[[Fichier:Pfs3.PNG]]
  
Une fois que vous aurez cliquer sur ajouter un groupe de ports, vous aurez cette fenêtre qui apparaitra :
+
Once you click on "add a port group", this window will appear:
 
 
 
[[Fichier:Pfs4.PNG]]
 
[[Fichier:Pfs4.PNG]]
  
  
Nous avons donc nommé notre groupe de ports « Groupe-Ports-LAN » et nous avons sélectionné notre vswitch LAN.
+
So we named our port group "LAN-Ports-Group" and selected our LAN vswitch.
  
 +
=== How to Create the PfSense VM in ESXI===
  
=== Création de la VM PfSense sur notre ESXI===
+
We create the virtual machine, with this parameters:
 
 
On créé la machine virtuelle, voici les paramètres que l’on a choisi :
 
 
 
  
 
[[Fichier:Pfs5.PNG]]
 
[[Fichier:Pfs5.PNG]]
  
Voici les caractéristiques que nous avons choisies pour notre PfSense :
+
Here are the characteristics we have chosen for our PfSense :
  
 
[[Fichier:Pfs6.PNG]]
 
[[Fichier:Pfs6.PNG]]
  
A ce niveau, il faut que l’on ajoute une carte réseau, qui servira à connecter nos machines virtuelles au travers de notre réseau virtuel LAN .
+
At this level, we need to add a network card, which will be used to connect our virtual machines through our virtual LAN.
 
+
To do this we must click on add a network adapter:
Pour ce faire nous devons cliquer sur ajouter un adaptateur réseau :
 
 
 
  
 
[[Fichier:Pfs7.PNG]]
 
[[Fichier:Pfs7.PNG]]
  
Lors de l’ajout de cette carte réseau, il faudra bien veiller à lui attribuer notre réseau LAN :
+
When adding this network adapter, please make sure to assign it the our LAN network:
  
 
[[Fichier:Pfs8.PNG]]
 
[[Fichier:Pfs8.PNG]]
  
Enfin il ne vous restera plus qu’à sélectionner l’image ISO de PfSense au niveau du lecteur virtuel . Vous pourrez ainsi débuter l’installation de PfSense .  
+
Finally, you will have to select the ISO image of PfSense in the virtual drive. You can then start the installation of PfSense. By default the keyboard is qwerty but you can change this by clicking on the flag as explained here :
Par défaut le clavier est en qwerty mais vous avez la possibilité de modifier cela en cliquant sur le drapeau comme expliqué ici :
 
  
  
 
[[Fichier:Pfs9.PNG]]
 
[[Fichier:Pfs9.PNG]]
  
===installation est paramétrage pfSense===
+
===pfSense settings and installation===
  
Ensuite pour l’installation choisissiez les options par défaut, Pour le formatage, nous avons choisi cela :
+
At pfSense Installer choose the default options, For the partitioning, we've pick the following  :
  
 
[[Fichier:Pfs10.PNG]]
 
[[Fichier:Pfs10.PNG]]
  
Une fois que vous aurez terminé l’installation de PfSense et que vous aurez redémarré votre vm, vous aurez accès à l’interface de Votre PfSense qui devrait se présenter comme ceci :
+
 
 +
Once you have finished installing PfSense and restarted your vm, you will have access to the PfSense interfacen which should look like this:
  
 
[[Fichier:Pfs11.PNG]]
 
[[Fichier:Pfs11.PNG]]
  
Dans la capture suivante, vous pouvez remarquer que nous avons ceci :
+
In the following screenshot, you can check the following:
 
 
-La patte wan -> Em0 -> 213.246.45.104(qui est l’ip supplémentaire).
 
Dans votre cas, il faudra donc bien attribuer l’ip supplémentaire à l’interface Wan en utilisant l’option 2.
 
  
-La patte LAN quant à elle correspond à l’interface Em1 que nous avions ajoutée lors de la création de la VM PfSense.
+
-The wan tab -> Em0 -> 213.246.45.104 (which is the additional IP).
Voici à ce que cela correspond au niveau de la vm sur ESXI :
+
In your case, you will have to assign the additional IP to the Wan interface using option 2.
  
 +
-The LAN tab corresponds to the Em1 interface that we added when we created the PfSense VM.
 +
Here is what it corresponds to at the vm level on ESXI :
  
 
[[Fichier:Pfs12.PNG]]
 
[[Fichier:Pfs12.PNG]]
  
===Configuration internet pour le LAN ===
+
===How to configure the internet connexion in the LAN ===
 
 
Maintenant pour que les machines virtuelles puissent avoir accès à internet il va falloir lancer des commandes depuis le shell de votre PfSense.
 
  
 +
In order to the virtual machines can connect to the internet you need to performe the following commands in the PfSense Shell.
  
 
[[Fichier:Pfs13.PNG]]
 
[[Fichier:Pfs13.PNG]]
  
Pour accéder au shell, sélectionnez le en entrant l’option 8.
+
To access the shell, select the option 8.
  
Une fois dans le shell, la première commande sera de supprimer la route existante par defaut en saisissant ceci :
+
Once in the shell, the first thing to do, is to delete  default route by entering this command:
  
 
<code>route del default</code>
 
<code>route del default</code>

Latest revision as of 14:46, 11 October 2022

en:Using PFsense on my ESXi server fr:Utiliser PFsense sur mon serveur ESXi

INTRODUCTION

In this article we will explain how to set up a PfSense Virtual Machine on an ESXI hypervisor with a server rented from IKOULA with an additional IP.

This will allow you to have multiple virtual machines accessible from the internet using your PfSense firewall NAT rules.


Required :

- A server from the family AGILE

- An additional IP address, can be ordered at your Client Area

- ESXI 6.7 installed on your server

We will assume that ESXI is already installed on your server and functional.


Settings used to create this article:

- Agile S server, Intel® Xeon® E3 1220v5(4c/4t) processor, 8GB ram and 1TB HDD. With of course an additional IP.

- Operating system : ESXI 6.7

- Network Settings:

Main IP: 213.246.45.105/24

Additional IP: 213.246.45.104/24

Gateway IP: 213.246.45.1


Deploying the router vm under PfSense

How to create a virtual lan network

First, we will create our virtual switch by going to the "Networking" section and clicking on "Add a standard virtual switch":

Fichier:Pfs1.PNG

In the the next open window, we advise you to select the parameters as show in the picture:

Fichier:Pfs2.PNG

We've decided to name our Switch "LAN". Once the switch is created, we will assign a port group. We need to go to the "port groups" tab and click on Add a port group as shown here :

Fichier:Pfs3.PNG

Once you click on "add a port group", this window will appear: Fichier:Pfs4.PNG


So we named our port group "LAN-Ports-Group" and selected our LAN vswitch.

How to Create the PfSense VM in ESXI

We create the virtual machine, with this parameters:

Fichier:Pfs5.PNG

Here are the characteristics we have chosen for our PfSense :

Fichier:Pfs6.PNG

At this level, we need to add a network card, which will be used to connect our virtual machines through our virtual LAN. To do this we must click on add a network adapter:

Fichier:Pfs7.PNG

When adding this network adapter, please make sure to assign it the our LAN network:

Fichier:Pfs8.PNG

Finally, you will have to select the ISO image of PfSense in the virtual drive. You can then start the installation of PfSense. By default the keyboard is qwerty but you can change this by clicking on the flag as explained here :


Fichier:Pfs9.PNG

pfSense settings and installation

At pfSense Installer choose the default options, For the partitioning, we've pick the following :

Fichier:Pfs10.PNG


Once you have finished installing PfSense and restarted your vm, you will have access to the PfSense interfacen which should look like this:

Fichier:Pfs11.PNG

In the following screenshot, you can check the following:

-The wan tab -> Em0 -> 213.246.45.104 (which is the additional IP). In your case, you will have to assign the additional IP to the Wan interface using option 2.

-The LAN tab corresponds to the Em1 interface that we added when we created the PfSense VM. Here is what it corresponds to at the vm level on ESXI :

Fichier:Pfs12.PNG

How to configure the internet connexion in the LAN

In order to the virtual machines can connect to the internet you need to performe the following commands in the PfSense Shell.

Fichier:Pfs13.PNG

To access the shell, select the option 8.

Once in the shell, the first thing to do, is to delete default route by entering this command:

route del default


Fichier:Pfs14.PNG

Maintenant il faudra créer une route sur l’interface Wan ici em0, l’ip ici correspond à la passerelle de notre ESXI et qui est la même que celle de l’ip supplémentaire (propre au réseau IKOULA) à savoir 213.246.45.1 :


route add 213.246.45.1 /32 -link -iface em0


Pour finir on devra créer la route par défaut pour pfSense via cette commande :


route add default 213.246.45.1


Une fois cela fait, toutes vos VM reliée au réseau LAN auront accès à internet.

Cependant, celles-ci ne seront pas accessibles depuis l'extérieur depuis des connexions RDP ou SSH par exemple.

Pour que vos VM soient accessibles , il faudra créer des règles de pare-feu au niveau de votre PfSense.

Nous verrons cela dans un autre article.