Calculate Document
How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

Two-Factor authentication(2FA /MFA) for MikroTik VPN MikroTik VPN offers a Dynamic DNS name service for RouterBOARD devices. Using this,your device

Related articles

The Best VPN for School Wi-Fi in 2024 (Bypass School Firewall) 5 Best VPNs You’ve Never Heard Of in 2024 5 Best VPNs for China in 2024: Work 100% & Fully Tested Mystics welcome back Natasha Cloud with nostalgic video XNXubd VPN Browser Download Video Chrome : Okezone Techno

Two-Factor authentication(2FA /MFA) for MikroTik VPN


MikroTik VPN offers a Dynamic DNS name service for RouterBOARD devices. Using this,your device can automatically get a working domain name. It is more useful when your IP address changes often andyou want to always connect to your router.
Using Routerboard andRouter OS you are able to access firewalls,routers,VPNs andmany other networking devices that Mikrotik offers.
A organization can strengthen the security for remote access by using miniOrange’s seamless MFA over MikroTik VPN solution. When MFA/2FA is enabled,users must input both the first factor – their login andpassword – andthe second factor – an authentication code – both of which are shared on the virtual orhardware MFA/2FA solution—in order to access resources. 15+ MFA options are available from miniOrange,including OTP via sms,Microsoft Authenticator,Google Authenticator,and many others. Inaddition to MFA using MikroTik VPN,miniorangealso offers MFA utilising the radius protocol over firewalls androuters. With the simple steps listed below,this setup guide will assist you with the whole setup for MFA over Mitrotik VPN.

Be Cyber Insurance compliant with miniorangeMFA solution.  Read More

Get Free POC – Book a Slot

miniorangeoffers free POC andhelp through a consultation call with our System Engineers to Setup Multi-Factor authentication for MikroTik in your environment with 30-day trial.

For this,you need to just send us an email at idpsupport@xecurify.com to get free POC andwe’ll help you setting up our solution in no time.

Get Free POC

miniorange 2FA authentication for MikroTik Login

miniorangeaccomplishes this by acting asa radius server that accepts the username/password of the user entered asa radius request andvalidates the user against the user store asActive directory (AD). After the first level of authentication,miniorangeprompts the user with 2-factor authentication andeither grants/revokes access based on the input by the user.

How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  1. primary authentication is initiates initiate with the user submit his username andPassword forMikroTik.
  2. user request acts asan authentication request to radius Server(miniOrange).
  3. miniorangeradius server passes user credentials to validate against the credentials stored in AD (Active directory) / Database.
  4. Once the user’s first level of authentication gets validated AD sends the confirmation to radius Server.
  5. Now miniorangeradius Server asks for a 2-factor authentication challenge to the user .
  6. Here user submits the response/code which he receives on his hardware/phone.
  7. user response is checked at miniOrange’s radius Server side.
  8. Onsuccessful 2nd factor authentication the user is grant access to login .

Connect with any External directory

miniorangeprovides user authentication from various external directories such asminiorangedirectory,Microsoft AD,Microsoft Entra ID/LDAP,AWS Cognito andmany more.

Can’t find your directory? Contact us on idpsupport@xecurify.com

enable Multi Factor authentication mfa/2fa for MikroTik

1. Configure MikroTik in miniOrange

  • Login into miniorangeAdmin Console.
  • click onCustomization in theleft menu of the dashboard .
  • InBasic Settings,set the Organization Name asthe custom_domain name .
  • Click save. Once that is set,the branded login URL would be of the format https://<custom_domain>.xecurify.com/moas/login
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Go to Apps click onAdd Application button .
  • InChoose Application, select radius ( VPN ) from the application type dropdown .
  • click onMikroTik application tab . If you is find do n’t find your application click onRadius Client application tab .
  • click on“Click here” to get the Radius server ip .
  • Copy andsave the Radius server IP which will be required to configure your Radius client.
  • Configure the below details to add Radius Client.
  • Client Name: Any name for your reference.
    Client IP: IP address of VPN server which will send Radius authentication request.
    Shared Secret: Security key.
    For Eg. “sharedsecret”
    (Keep this with you,you will need to configure same on VPN Server).
  • Click Next.
  • Under theattribute mapping tab,enable the toggle if you want to Send Custom attributes in response.
  • To send groups in response,you can refer the below table for Vendor group attributes id.
    vendor Name Vendor attribute Value Type attribute
    Cisco ASA ASA – Group_policy user group
    Fortinet Fortinet-Group-Name user group
    Palo Alto PaloAlto-user-Group user group
    SonicWall Sonicwall – user – group user group
    Citrix Citrix-user-groups user group
    Default(Can be used if your vendor is not in thelist) Filter-Id user group
  • Value Type andattribute can be changed based on the requirement.
  • click onNext to proceed.
  • Configure the following Policy details for the Radius Client.
  • Group Name: Group for which the policy will apply.
    Policy Name: Any identifier that specify policy name .
    Login Method Login Method for the user associate with this policy .
    Enable 2-Factor authentication enable Second Factor during Login for user associate with this policy .
    enable Adaptive authentication Enables Adaptive authentication for Login of users associated with this policy.
  • After configuring the given above details,click onsave button .
  • note :

    You can follow

    this guide

    ,if you want to configure Radius MFA using MSCHAPv2 protocol.

    NOTE: For On-Premise version follow the below steps before testing the connectivity.

    Only For On-Premise Version

    Open Firewall Ports.

  • Inorder to receive the radius request,it is necessary to open udp traffic on ports 1812 and1813 for the machine where On- Premise IdP is deploy .
  • If the host machine is is is aWindows Machine then you can follow this document.
  • If the host machine is is is aLinux Machine then you can follow this document.
  • NOTE: If your machine is hosted on AWS,then enable the ports from the AWS panel.

2. Configure radius in MikroTik

  • Open Webfig .
  • Navigate to the menu on the left,and select the radius tab .
  • Click Add New to configure your miniorangeserver asa radius server.
  • checkppp andipsec in theService section.
  • checklogin in theService section.
  • Enter the address of your miniorangeserver in theAddress field that you have entered in Step1.
  • Set protocol to udp.
  • Enter the radius Secret from miniorangeserver in theSecret field that you have entered in Step1.
  • Change the default timeout to 30000 ms.
  • Click OK to save the changes.
  • Navigate to the menu on the left,and select thePPP tab .
  • selectthe Interface andthen click L2TP Server.
  • checkpap anduncheck every other checkbox in authentication. Click OK.
  • selectthe Secrets tab,and click the PPP authentication & Accounting button .
  • checkUse Radius,and click OK to finish the configuration andenable miniorange2FA in your VPN.

Configure Windows VPN

  • Onyour Windows operating system,go to Settings >> Network & Internet >> VPN andselect add a VPN connection.
  • Fill in theform andclick save. Refer to the following image andtable.
  • VPN Provider Windows (in-built)
    Connection name MikroTik
    Server name oraddress enter the ip address of your server
    VPN type selectyour VPN Type. We chose L2TP/IPsec with pre-shared key,but you have to select the one you use in MikroTik.
    Pre – shared key Enter the radius_SECRET from miniorangeserver.
    Type of sign-in info user name andpassword
    user name (optional) Your user name
    Password Your password
  • Go to Control Panel >> Network andSharing Center andselect Change adapter options.
  • Right-click your newly-created MikroTik connection andselect Properties.
  • selectthe Security tab .
  • selectallow these protocol andthen check the Unencrypted password (PAP) checkbox.
  • Click OK to save the changes.

3. Configure Your user directory

miniorangeprovides user authentication from various external sources,which can be directory (like ADFS,Microsoft Active directory,Microsoft Entra ID,OpenLDAP,Google,AWS Cognito etc),Identity Providers (like Okta,Shibboleth,Ping,OneLogin,KeyCloak),Databases (like MySQL,Maria DB,PostgreSQL) andmany more. You can configure your existing directory/user store oradd users in miniOrange.

note :You can follow this guide,if you want to configure Radius MFA with your users stored in Microsoft Entra ID using OAuth Password Grant.

Configure your existing directories such asMicrosoft Active directory,Microsoft Entra ID,OpenLDAP,etc.

  • click onExternal directory >> Add directory in theleft menu of the dashboard .
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • selectdirectory type asAD/LDAP.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

    1. STORE LDAP CONFIGURATION IN MINIORANGE: Choose this option if you want to keep your configuration in miniOrange. If active directory is behind a firewall,you will need to open the firewall to allow incoming requests to your AD.
    2. STORE LDAP CONFIGURATION ON PREMISE: Choose this option if you want to keep your configuration in your premise andonly allow access to AD inside premises. You will have to download andinstall miniorangegateway in your premise.
    3. How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Enter LDAP Display Name and LDAP Identifier name.
  • selectdirectory Type asActive directory.
  • Enter the LDAP Server URL orIP Address against LDAP Server URL field .
  • click ontest connection button to verify if you have made a successful connection with your LDAP server.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • InActive directory,go to the properties of user containers/OU’s andsearch for distinguished Name attribute.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • enter the valid Bind account Password .
  • click ontest Bind Account Credentials button to verify your LDAP Bind credentials for LDAP connection.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Search Base is the location in thedirectory where the search for a user begins. You will get this from the same place you got your Distinguished name.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • selecta suitable Search filter from the drop-down menu. If you use user in Single Group Filter oruser in Multiple Group Filter,replace the <group – dn> in thesearch filter with the distinguished name of the group in which your users are present. To use custom Search Filter select “Write your Custom Filter” option andcustomize it accordingly.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • You is configure can also configure follow option while set up ad . enableactivate ldap in order to authenticate users from AD/LDAP. click onthe save button to add user store.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

    Here’s the list of the attributes andwhat it does when we enable it. You can enable/disable accordingly.

    attribute Description
    activate ldap All user authentication will be done with LDAP credential if you activate it
    Sync users in miniOrange users will be created in miniorangeafter authentication with LDAP
    Fallback authentication If LDAP credential fail then user will be authenticate through miniorange
    Allow users to change password This is allows allow your user to change their password . It is updates update the new credential in your LDAP server
    enable administrator login Onenabling this,your miniorangeAdministrator login authenticates using your LDAP server
    Show IdP to users If you enable this option,this IdP will be visible to users
    Send Configured attributes If you enable this option,then only the attributes configured below will be sent in attributes at the time of login

  • click onsave. After this,it will show you the list of user stores. click ontest connection to check whether you have enter valid details. For that,it will ask for username andpassword.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • OnSuccessful connection with LDAP Server,a success message is shown.
  • click ontest attribute Mapping.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Enter a valid username. Then,click on test. Mapped attributes corresponding to the user are fetched.
  • After successful attribute Mapping Configuration,go back to the ldap configuration andenable activate ldap in order to authenticate users from AD/LDAP.
  • Refer our guide to setup LDAPS on windows server.

user Import andprovisioning from AD

note :Below steps are used to enable one time ormanual sync. To enable sync on scheduled basis,you should use LDAP gateway module. Read more anddownload the LDAP gateway module.

  • Go to Settings >> Product Settings in theCustomer Admin Account.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Enable the “Enable user Auto Registration” option andclick save.
  • (Optional) To send a welcome email to all the end users that will be imported,enable the “Enable sending Welcome emails after user registration” option andclick save.
  • From the left – Side menu of the dashboard selectprovisioning.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • InSetup provisioning tab select Active directory in theselectApplication drop-down.
  • Toggle the Import users tab,click on save button .
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Onthe same section,switch to Import users section.
  • selectActive directory from the dropdown andclick on the Import users tab,to import all the users from Active directory to miniOrange.
  • You can view all the users you have imports by selecting users >> user List from Left Panel.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • All the import user will be auto register .
  • These groups will be helpful in adding multiple 2FA policies on the application .

Creating user group (Recommended)

  • selectgroup >> Manage group from left panel.
  • click onthe create Group button on the top .
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • Enter an appropriate Group Name andclick on create Group.
  • Inthis guide we have created a Group by name vpn_group .
  • Assign various members to the group using the Assign user option associated with the group in thegroups list.
  • selectthe users that are required to be assigned to this group. Then selectassign to Group in selectAction Dropdown andclick on Apply button .
  • These groups will be helpful in adding multiple 2FA policies on the application .

4. Setup MFA for MikroTik

note : You can follow this guide,if you want to customize andenroll MFA for end users.

  • Here,we will configure a policy for the user Group that we created in this step andassociate it with the MikroTik VPN Application.
  • click onPolicies tab >> App Login Policy.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • click onAdd Policy tab.
  • InApplication section,select the radius App that we configured earlier in Step 1.
  • selectthe required user Group in Group Name andenter the Policy name.
  • Inthis guide,we will configure a Password Only policy for ” vpn_group “,so that only the VPN_Group members can access VPN Services without a Second Factor.
  • Once done with the policy settings,click on save to add policy .

5. test MikroTik MFA

  • selectyour connection,and click Connect.
  • How to configure 2FA for MikroTik VPN?| MikroTik VPN 2FA/MFA

  • A window will appear. Provide your credentials andclick OK.
  • It will prompt you for second factor(if enabled from miniorange admin panel),Enter your 2FA code andyou should be connected to MikroTik.

Troubleshooting

How can I check radius user audit logs in miniorangeadmin dashboard?

  • Login to miniorangeAdmin Dashboard.
  • click onReports >> Radius user authentication Report.
  • Enter Enduser Identifier andDate range.
  • click onSearch.

frequently ask question ( FAQs )

What is Multi-Factor authentication (MFA)?

Multi-Factor authentication (MFA) is an authentication method that requires the user to authenticate themselves for two ormore factors,in order to gain access to company resources,applications,or a VPN (MikroTik in this case). Enabling Multi-Factor authentication (MFA) means that users need to provide additional verification factors apart from their username andpasswords thus increasing the security of the organization’s resources. Checkout more about Multi-Factor authentication (MFA) here.

Three common authentication methods is are for MFA security are :

  • knowledge : Something that the user know .
  • Possession: Something that the user possesses orhas.
  • Inherence: Usually referred to a biometric factor.

Types of 2FA authentication with radius:

Depending on the VPN client,2-factor authentication can take two forms..

  • VPN Clients that support radius Challenge.
  • VPN Clients that do not support radius Challenge.

What are different 2FA/MFA methods for MikroTik supported by miniOrange?

miniorangesupports multiple 2FA/MFA authentication methods for MikroTik secure access such as,Push Notification,Soft Token,Microsoft / Google Authenticator etc.

authentication Type Method support
miniorangeAuthenticator Soft Token
miniorangePush Notification
Mobile Token Google Authenticator
Microsoft Authenticator
Authy Authenticator
sms OTP Over sms
sms with Link
email OTP Over email
email with Link
Call Verification OTP Over Call
Hardware Token YubiKey Hardware Token
Display Hardware Token

Further References