TARGET_UID="10419"
PORTS="80,443,20002,10012"
# 清除现有规则（谨慎操作）
iptables -F
iptables -X
iptables -A OUTPUT -p tcp -m owner --uid-owner $TARGET_UID -m multiport --dports $PORTS -j DROP
iptables -A OUTPUT -p udp -m owner --uid-owner $TARGET_UID -m multiport --dports $PORTS -j DROP
echo "防火墙规则已设置：UID $TARGET_UID 对端口 $PORTS 的访问已被拦截"