連接到 VPN 時阻止 openVPN 中的互聯網訪問

連接到 VPN 時阻止 openVPN 中的互聯網訪問

我使用本教程在我的 Ubuntu 伺服器中安裝並配置 openVPN,一切正常,但我想在用戶活動 VPN 時阻止互聯網訪問

我根據互聯網上的一些搜尋使用此配置,但它不起作用,用戶仍然可以訪問互聯網

在 server.conf 或 base.conf 中加入以下行

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

也建立 block_internet.sh 並使其可執行:

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

對於 unblock_internet.sh:

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

我在本地網路中運行 VPN 伺服器(vmware)和客戶端,這可能是問題所在?

相關內容