Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的网络上有 3 个 IP 范围,我使用命令行阻止了 Facebook 访问:
iptables -I FORWARD -m string --algo bm --string "facebook.com" -j DROP
我想对网络范围“192.168.0.x”做一个例外
我怎样才能做到这一点?
提前致谢!
您可以简单地使用标记negate源 IP 地址。!
negate
!
iptables -I FORWARD ! -s 192.168.0.0/24 -m string --algo bm --string "facebook.com" -j DROP