oriolrius.cat

Des del 2000 compartiendo sobre…

OpenVPN between pfSense and Mikrotik

Reading time: 3 – 5 minutes

vpn-pfsense-mikrotik-schemaAssuming previous scenario I’m going to describe the required configurations on pfSense and Mikrotik. Certifcate creation is not part of the scope of this document, if you are not familiar about how to do that it’s a good idea to use the pfSense certificate manager to do it. My last advice is take care with certificates 90% of problems that I found in my life when I was working on VPNs are because of that. Take your time to check it before spend your time playing with other configurations.

In that scenario pfSense will play the role of the VPN server and Mikrotik will be the client, so I’m going to start describing pfSense configurations.

Create OpenVPN server on proper section:

pfsense-openvpn-server

 

Important things to take in account when you set up the parameters are socket has to be a TCP socket in my case I decided to use port 1201:

pfsense-openvpn-server-configNext settings on the same place are about local network and tunnel IP addresses, this is required to create proper routing rules on the server and the client.

pfsense-openvpn-server-config2

 

Last part to configure on this sections is extremly simple, only take care to unmark everything and check “address pool” setting.

pfsense-openvpn-server-config3

 

Remember to open that port on Firewall rules.

pfsense-firewall-rules

 

A VPN user is required to authenticate the process, just go to “User Management” inside the “System” menu:

pfsense-user-manager-oriol

 

pfSense is configured, now it’s time to set-up the OpenVPN client on Mikrotik using Winbox. Remember to import the certificates:

certificates-mikrotik

 

Click on “PPP” this on the left menu:

ppp-mikrotik

 

Add an OVPN Client connection using the “+” button, the parameters for that connection are:

ppp-interface

 

Another required thing to define on “PPP” is the profile, click on the tab “Profile” and using the button with symbol “+” create a new profile like that:

ppp-profile

 

Everything is ready, now it’s time to check if the connection is OK. First go to the OVPN client on Mikrotik, remember this is on “PPP” menu option and inside tab “Interfaces”. Clicking on the interface you’ll see the status details. If it’s disconnect going to pfSense or Mikrotik logs you can see the negotiation details.

Remember usually the problem is with your certificates, but first of all you have to ensure that the negotiation tries to start.

Enjoy it and good luck.

 

7 thoughts on “OpenVPN between pfSense and Mikrotik

  1. Muchas gracias por aportación. Me ha servido de gran ayuda.
    Actualmente, siguiendo su manual, he conseguido conectar dos sedes, usando pfSense como servidor, y mikrotik como cliente. Conectan perfectamente, y desde el cliente, desde cualquiera de las máquinas que forman la sede cliente, puedo acceder a las de la sede servidor sin ningún problema. El tema es que en la parte cliente tengo varias impresoras que quiero compartir con la sede servidor, y en ese sentido, servidor -> cliente, no consigo ver las máquinas ni hacer ping a ninguna de ellas.
    ¿a parte de la configuración que amablemente describe, habría que añadir alguna otra regla al cortafuegos para que esta comunicación se permita?
    Muchas gracias de nuevo.

  2. Gracias por tu comentario, perdona mi retraso pero he estado de vacaciones y no tenía acceso al ordenador. Seguramente tu problema esta en las rutas, o quizá en algún NAT. Prueba ha hacer un “traceroute” y mira donde se pierden tus paquetes.

  3. Muy buenas Oriol,
    finalmente lo he solucionado.
    He vuelto ha crearlo todo desde el prinicipio, siguiendo su manual y vualá!!!
    debía haber algo que no estaba haciendo bien.
    Muchas gracias!

  4. Muy buenas de nuevo Oriol,
    llevo dándole vueltas mucho tiempo a esto y si no le importa, me gustaría preguntarle algo. Al hilo del comentario que le hice, la tasa de transferencia entre sedes es muy baja. Me explico. cada sede tiene switch gigabits, por lo que la tasa de transferencia interna, en cada sede, es muy alta. El problema es que si quiero transferir datos entre sedes, veo que sólo lo hace a unos 7 Mbps (subida y bajada). Indicar que tenemos contratada fibra de Movistar con 300 Mb simétrica (probada) y que los ping de una sede a otra no superan los 33ms y TLS de 126, por lo que he leido está bastante bien, ¿puede darme alguna idea de cual puede ser el motivo por lo que la transferencia de datos en la VPN es tan bajo?

  5. Has mirado si la CPU del equipo va saturada? quizá no es capaz de cifrar tanta información y esta haciendo de cuello de botella. Por otro lado, a parte d eponer una CPU/RAM mayores también podrías contemplar la posibilidad de usar cifrado por hardware.

    Ya me dirás si tiene sentido.

Últimas entradas

Resumen 2023

Reading time: 14 – 22 minutes El 2023 comenzó con una sensación de renovación y optimismo. Tras un período marcado por la pandemia, este año se presentó como un lienzo en blanco, lleno de posibilidades y nuevas experiencias. Aunque el

Leer más »
Archivo