问题原文
原帖链接 · Jakub Wolski · CC BY-SA 3.0
I want to block access to certain websites/IP's for all clients connected to VPN (pptpd or OpenVPN).
This rule:
iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -d IP_address -j REJECT
is working only locally.
Server (ping test) can't access blocked IP but clients via VPN can.
How can I block all traffic to specified IP for VPN clients?
已采纳解答
原帖链接 · Tero Kilkanen · CC BY-SA 3.0
The OUTPUT chain only applies to locally generated packets. For packets that are routed via the system, one needs to use the FORWARD chain.
So, you need to use this command:
iptables -A FORWARD -m state --state NEW,ESTABLISHED,RELATED -d IP_address -j REJECT
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
