Table of Contents

PFSense - VPN - OpenVPN - Assign a fixed IP to a remote client

By assigning a fixed IP to a client that connects to a VPN allows this IP to be used in firewall rules.

NOTE: It is assumed that an OpenVPN server has already been created and one or more correctly configured users exist.


Identify a fixed IP address for the Client to use

Navigate to VPN → OpenVPN.

In Servers, check the Tunnel Network used by the specific VPN Server.

In this case it is 10.20.30.0/24.

NOTE: The fixed IP address for the client must be a unique IP within this subnet.

For example 10.20.30.69.


Identify the user to whom we want to assign the IP just chosen

Navigate to System → User Manager → Users.

Select the specific user to assign the fixed IP address to.


Allocate the fixed IP to the User

Navigate to VPN → OpenVPN → Client Specific Overrides.

Click Add.

In General Information:

In Client Settings:

NOTE: From now on when peter connects to the OpenVPN Server, he will always be assigned the IP 10.20.30.69,


Test

Connect to the VPN Server from the Client.

Check the IP Address of the Connected Client.

Navigate to Status → OpenVPN.


Configure Firewall Rules for this User

We know that the user, peter, will connect with IP 10.20.30.69.

Firewall rules can therefore be configured using this IP.

By placing the IP 10.20.30.69 in the Source field, we can decide which IPs our VPN user can access and which ports/services.

For example:

NOTE: The last deny rule is not actually needed.

It is only put in to to make explicit the deny which in fact is how the firewall behaves if no rule is applied.


References