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:

Example environment⁠

The examples in this tutorial use these values:

Setting

Example value

Parent group

Group0

Child group 1

Group1

Child group 2

Group2

Child group 3

Group3

LDAP user 1

brandonuser1

LDAP user 2

brandonuser2

LDAP user 3

brandonuser3

Base DN

CN=Users,DC=brandonldap,DC=net

Replace these values with the corresponding values from your environment.

Placeholder values⁠

The commands in this tutorial use the following placeholders:

Placeholder

Description

<BASE_DN>

The starting point in the LDAP directory tree where searches begin.

<FULL_DN>

The distinguished name (DN) that uniquely identifies a specific LDAP user or group.

<PASSWORD>

The LDAP user's password.

See also⁠