Giving a specific client no access to internet

Scripts to manage certificates or generate config files

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
darellon
OpenVpn Newbie
Posts: 13
Joined: Wed Jun 15, 2016 6:26 pm

Giving a specific client no access to internet

Post by darellon » Tue Mar 07, 2017 7:18 pm

Hi all,
i got a Openvpn server set up and only want access it with two clients. Client #1 is able to access the internet through the server. However, how would i restrict Client #2's access to the internet through the server? i only want Client #2 to access the Network

TiTex
OpenVPN Super User
Posts: 310
Joined: Tue Apr 12, 2011 6:22 am

Re: Giving a specific client no access to internet

Post by TiTex » Mon Mar 20, 2017 12:15 pm

create client configuration for the client that you want to allow to access the internet , specify a "static ip" for him/her , then only allow this IP to NAT
linux example: iptables -t nat -A POSTROUTING -s vpn-client-ip -o eth0 -j MASQUERADE
where vpn-client-ip is the IP you configured for him , and eth0 is the network interface with internet access.

Post Reply