Skip to content

Restrict access to the specified IPs and IP ranges on OpenVPN connect

License

Notifications You must be signed in to change notification settings

dmytro/openvpn_restrict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenVPN restrict

This is a script to be used in OpenVPN server to restrict connecting clients to connect only to the specified hosts. List of allowed to connect hosts configured per client, can include hostnames, IP addresses or CIDR blocks.

It uses learn-address feature of the OpenVPN and IP Tables to allow connection to only specified IPs or hosts.

Usage

  1. Place script in OpenVPN directory (in the example below /etc/openvpn/connect ) and add following two lines to the server configuration file:
learn-address /etc/openvpn/connect
client-disconnect /etc/openvpn/connect
  1. Edit file /etc/openvpn/allow_ips and add lines in the format:
cn-name: 192.168.0.0/24 10.8.0.0/16 web01 db02 app01

Here cn-name is name of certificate built by Easy-RSA scripts.

About

Restrict access to the specified IPs and IP ranges on OpenVPN connect

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages