Tutorial: Configure LDAP Filters in Access Server to Restrict VPN Access by Active Directory Group
Overview
OpenVPN Access Server supports LDAP filter syntax to control which users can authenticate through LDAP. You can use LDAP filters to restrict VPN access to members of specific Microsoft Active Directory (AD) groups.
This tutorial covers several common group-membership scenarios using the Active Directory memberOf attribute:
Allow members of one specific group.
Allow members of multiple groups.
Allow direct and indirect members of a parent group through nested groups.
Allow members of selected nested groups while excluding others.
The examples use the Base DN, which defines the starting point in the LDAP directory tree where Access Server begins searching for users and groups.
For nested group membership, the tutorial uses LDAP_MATCHING_RULE_IN_CHAIN, identified by OID 1.2.840.113556.1.4.1941. This Active Directory matching rule enables recursive nested-group membership lookups without requiring multiple LDAP queries from the application.
You'll also use Access Server's authcli tool to test LDAP authentication directly from the command line without establishing a VPN connection.
Group-based LDAP filters can also support least-privilege access policies used in Zero Trust Network Access deployments.
Prerequisites
Before you begin, ensure you have:
An installed Access Server with LDAP authentication configured. If LDAP isn't configured yet, complete Tutorial: Set Up Access Server with Active Directory via LDAP for VPN Integration.
Admin Web UI access or console access with root privileges.
A Windows Active Directory server with LDAP configured.
Existing AD users and groups you can use to test the filters.
Example environment
The examples in this tutorial use these values:
Setting | Example value |
|---|---|
Parent group |
|
Child group 1 |
|
Child group 2 |
|
Child group 3 |
|
LDAP user 1 |
|
LDAP user 2 |
|
LDAP user 3 |
|
Base DN |
|
Replace these values with the corresponding values from your environment.
Placeholder values
The commands in this tutorial use the following placeholders:
Placeholder | Description |
|---|---|
| The starting point in the LDAP directory tree where searches begin. |
| The distinguished name (DN) that uniquely identifies a specific LDAP user or group. |
| The LDAP user's password. |