Score:0

Block internet access in openVPN when connect to vpn

pa flag

I install and config openVPN in my Ubuntu server using this tutorial and everything is work, but i want to block internet access when user active vpn

i use this configuration base on some search in internet but it not work and user still access to internet

in server.conf or base.conf add this lines

script-security 2
up /etc/openvpn/block_internet.sh
down /etc/openvpn/unblock_internet.sh

also create block_internet.sh and make it excutable:

#!/bin/bash
iptables -A FORWARD -s $ifconfig_pool_remote_ip -j DROP

and for unblock_internet.sh:

#!/bin/bash
iptables -D FORWARD -s $ifconfig_pool_remote_ip -j DROP

I run VPN server(vmware) and client in a local network may be this is the problem?

Sebastian avatar
in flag
What is the value of `$ifconfig_pool_remote_ip`?
md.119 avatar
pa flag
It's a placeholder that is automatically replaced with the actual IP address of the connecting client
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.