• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Network Tutorials MikroTik

Configure OpenVPN Server on MikroTik Router for Remote Access

neo by neo
August 7, 2025
in MikroTik
0
MikroTik: Remote Access to Headquarter with OpenVPN

MikroTik: Remote Access to Headquarter with OpenVPN

0
SHARES
190
VIEWS
Share on FacebookShare on Twitter
Table of Contents
  • Remote Access to Headquarter via OpenVPN Server
    • About OpenVPN
  • Issue Description: Why Do I Need This Setup?
    • FortiGate Port Forwarding Configuration – Forward Ports to MikroTik Router OpenVPN Server
      • Step 1: Create Port Forwarding (VIP – Virtual IP) Rules
      • Step 2: Assign Port Forwarding to the Policy
    • MikroTik OpenVPN Server Headquarter Configuration
      • Generate Certificates on MikroTik
        • Step 1: Generate Certificate Authority (CA) Certificate
        • Step2: Generate Server Certificate
        • Step 3: Genereate Client Certificate
      • Configure MikroTik OpenVPN Server
        • Step 1: Create a Brdige with Internal Ports
        • Step 2: Configure OpenVPN Server
        • Step 3: Export OpenVPN Configuration and Certificates
    • Configure OpenVPN Client on Windows PC

Remote Access to Headquarter via OpenVPN Server

Remote Access to Headquarter via MikroTik OpenVPN Server or any other device is essential for enabling seamless communication between remote locations and the central network. When implemented with MikroTik’s OpenVPN, this access can be secured and optimized without routing internet traffic through the headquarters. In this guide, we’ll walk you through configuring a secure OpenVPN connection, ensuring that remote users or branch offices can access internal resources at the headquarters while maintaining an efficient and private network setup.

About OpenVPN

OpenVPN is a widely-used VPN protocol that enables secure internet access by encrypting traffic and masking the user’s IP address. By configuring OpenVPN on a MikroTik router, you can route traffic through a specific server location. It uses SSL/TLS encryption to protect data and offers flexible settings to fit various networking needs.

Moreover, OpenVPN works seamlessly across many platforms and adapts well to different network environments. This makes it perfect for creating secure remote access connections. It supports both site-to-site and client-to-server VPN setups, allowing businesses to connect branch offices to headquarters or remote workers to internal resources easily.

In addition, OpenVPN offers strong authentication methods, including certificates and pre-shared keys. It is also highly customizable, which lets administrators tailor the setup for specific needs. Thanks to its reliability, security, and compatibility, OpenVPN is a trusted choice for securing data and ensuring smooth connectivity.

Issue Description: Why Do I Need This Setup?

Benefits of This Approach:

  1. Reduced Internet Usage at the HQ Location
    • By routing only internal traffic through the VPN and keeping internet traffic independent, the headquarters’ internet bandwidth is preserved for critical operations.
  2. Secure Access to HQ Resources
    • Remote users or locations can securely access servers, databases, and other internal resources at the headquarters without exposing them to external threats.
  3. Improved Network Performance
    • Avoiding unnecessary routing of internet traffic through the headquarters reduces latency and improves overall network speed and efficiency.
  4. Cost Efficiency
    • With reduced internet bandwidth usage at the headquarters, companies can lower costs associated with upgrading bandwidth or managing excess traffic.

In many scenarios, remote locations need secure access to resources hosted at the headquarters without routing internet traffic through the central network. This setup is essential to maintain efficient communication while reducing unnecessary bandwidth usage at the headquarters.

By ensuring that only internal traffic is sent through the VPN, this configuration avoids bottlenecks and improves overall performance. Additionally, it strengthens security by allowing controlled access to internal systems without exposing them to direct internet traffic. Such an arrangement is ideal for businesses that want to enable seamless collaboration between remote and central locations while keeping internet usage independent and more efficient.

Remote Access to Headquarter with OpenVPN Schema

FortiGate Port Forwarding Configuration – Forward Ports to MikroTik Router OpenVPN Server

To enable port forwarding on a FortiGate firewall, you need to create and configure Virtual IP (VIP) rules and then assign them to the appropriate firewall policy. You can check the following article for more details.

Step 1: Create Port Forwarding (VIP – Virtual IP) Rules

Start by defining a Virtual IP (VIP) to map the external IP address and port to the internal server and port. This ensures that incoming traffic on the specified external port is redirected to the appropriate internal resource.

At this link you can check how to configure port forwarding on FortiGate device.

Step 2: Assign Port Forwarding to the Policy

After setting up the VIP, apply it to a firewall policy. This policy controls the flow of traffic and ensures that the port-forwarding rule is enforced, allowing external users to access the internal resource securely.

MikroTik OpenVPN Server Headquarter Configuration

Setting up OpenVPN on a MikroTik router at the headquarters involves several key steps, including generating certificates, configuring the server, and exporting the OpenVPN configuration for remote clients. Below is an overview of each stage.

Generate Certificates on MikroTik

Using MikroTik’s built-in certificate manager, you can create and sign these certificates to ensure secure communication between the server and remote clients. Properly setting up the CA is essential, as it validates the identities of the connecting devices.

The first step in securing your OpenVPN connection is generating the necessary certificates. These include the:

Step 1: Generate Certificate Authority (CA) Certificate

Follow the following steps to generate CA Certificate:

ADVERTISEMENT
Generate CA Certificate
Generate CA Certificate
CA Certificate Settings
CA Certificate Settings
Sign Certificate

If you don’t have domain use MikroTik DNS Service:

IP Cloud Service
IP Cloud Service
Step2: Generate Server Certificate

Generate Server Certificate for your OpenVPN Server:

Server Certificate
Create Server Certificate
Server Certificate Settings
Settings for Server Certificate
Sign Server Certificate
Sign Server Certificate
Step 3: Genereate Client Certificate
Client Certificate
Create Client Certificate
Client Certificate Settings
Client Certificate Settings
Client Certificate Sign
Client Certificate Sign

Configure MikroTik OpenVPN Server

Once the certificates are ready, configure the MikroTik router to act as the OpenVPN server. Start by enabling the OpenVPN service and specifying the server’s authentication methods, cipher settings, and port. Define the IP pool that will assign IP addresses to remote clients and create a profile to manage connection settings, such as routes and DNS configuration. This step ensures that remote clients can securely access the HQ network without routing their internet traffic through it.

Configuration on the MikroTik:

Config exported from device:

/interface bridge
add arp=proxy-arp name=bridge_intern
add name=bridge_mt
/ppp profile
set *0 bridge=bridge_intern local-address=192.168.20.113
/interface bridge port
add bridge=bridge_intern interface=ether1
add bridge=bridge_intern interface=ether2
add bridge=bridge_intern interface=ether3
/interface ovpn-server server
set certificate=SERVER enabled=yes port=1234 redirect-gateway=""
/ip address
add address=192.168.19.251/24 interface=bridge_mt network=192.168.19.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add interface=bridge_intern
/ppp secret
add name=defencedev remote-address=192.168.20.123
Step 1: Create a Brdige with Internal Ports

It’s important to create a bridge with internal ports to ensure that OpenVPN traffic is properly routed within your network. The bridge will act as a logical interface that connects multiple physical and virtual interfaces, ensuring seamless communication between the OpenVPN clients and internal network resources. Adding the internal ports (such as LAN interfaces) to the bridge allows remote users to access resources like file servers, printers, or other services available at the headquarters while maintaining network security.

Create Bridge Interface:

Create Bridge Interface

It is very important to select ARP: proxy-arp otherwise communication will not work properly. Please check the following link for more information.

Add ports to bridge interface:

Bridge Ports
Bridge Ports

Enable DHCP Client on bridge Interface:

IP Address on Bridge Interface
IP Address on Bridge Interface
Step 2: Configure OpenVPN Server

Enable OpenVPN Server:

OpenVPN Server Settings
OpenVPN Configuration

I changed port from 1194 to 1234.

Check Profil settings:

OpenVPN Server Profile
OpenVPN Server Profile

I have just one user and didn’t use any Remote Address Pool for my users. It is defining under User configuration.

Create a user:

User Settings
User Settings

IP Address 192.168.20.113 is on a internal bridge interface.

User will have IP Address 192.168.20.123

Step 3: Export OpenVPN Configuration and Certificates

After setting up the MikroTik OpenVPN server, you need to export the required configuration and certificates. This includes the server’s certificates and a client-specific certificate to ensure secure authentication.

Start by generating the necessary certificates and configuration files in MikroTik’s certificate management. Export the client certificate, CA certificate, and client configuration file, which holds the server details, port information, and routing settings.

OpenVPN Config
Export OpenVPN Configuration
Files on MikrtoTik Device
Files on MikrtoTik Device

Once exported, package these files into a configuration bundle. This makes it easy to distribute them to remote clients, enabling a smooth OpenVPN client setup and seamless connection to the HQ network. Be sure to handle these export files securely, as they contain sensitive information needed to establish the VPN connection.

Configure OpenVPN Client on Windows PC

To connect a Windows PC to the MikroTik OpenVPN server, you’ll need to install the OpenVPN client software and configure it using the exported configuration file. Start by downloading and installing the OpenVPN GUI from the official OpenVPN website. After installation, import the configuration file that was exported from your MikroTik router. This file contains the necessary certificates, server details, and connection settings.

ADVERTISEMENT

Once the configuration is imported, launch the OpenVPN GUI, select the server profile, and connect to the HQ network. The client will authenticate using the certificates, establish a secure connection, and provide access to the internal resources on the MikroTik network. Ensure that the OpenVPN service is running on both ends for the connection to be successful.

About The Author

neo

See author's posts

Tags: mikrotik
ADVERTISEMENT
Previous Post

MikroTik: Firmware Update with WinBox Application – Manual Approach

Next Post

Fortinet FortiGate Firmware Upgrade

neo

neo

Related Posts

MikroTik OpenVPN: Sound Alert When VPN Tunnel Fails
MikroTik

MikroTik OpenVPN: Sound Alert When VPN Tunnel Fails

MikroTik: OpenVPN Client Failover Script
MikroTik

MikroTik: OpenVPN Client Failover Script

MikroTik: Check Your Wireless Password
MikroTik

MikroTik: Check Your Wireless Password

MikroTik VLAN Configuration
MikroTik

MikroTik VLAN Configuration

MikroTik: Configure SNMP for Network Monitoring
MikroTik

MikroTik: Configure SNMP for Network Monitoring

MikroTik: Port Forwarding (NAT) Configuration
MikroTik

MikroTik: Port 443 Forwarding to Web Server (NAT) Configuration

Next Post
Fortinet FortiGate Firmware Upgrade

Fortinet FortiGate Firmware Upgrade

Recommended

Fortinet FortiGate: Network Monitoring with Custom Dashboards

Fortinet FortiGate: Network Monitoring with Custom Dashboards

WordPress: Change Port from 433 to 8443

WordPress: Change Port from 433 to 8443

Automating Linux Server Reboot with Ansible

Automating Linux Server Reboot with Ansible

MikroTik OpenVPN: Sound Alert When VPN Tunnel Fails

MikroTik OpenVPN: Sound Alert When VPN Tunnel Fails

MikroTik: OpenVPN Client Failover Script

MikroTik: OpenVPN Client Failover Script

Categories

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos
ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

Automating Linux Server Reboot with Ansible

Automating Linux Server Reboot with Ansible

MikroTik OpenVPN: Sound Alert When VPN Tunnel Fails

MikroTik OpenVPN: Sound Alert When VPN Tunnel Fails

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.