/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT
/etc/rc.d/init.d/iptables save /etc/rc.d/init.d/iptables restart
/etc/init.d/iptables status # 或 iptables -L -n -v | grep 8000
-I INPUT 插入 INPUT 鏈首部,優先於 DROP 規則。-p tcp --dport 指定協議與目的埠;UDP 用 -p udp。-s 來源IP 限制來源,或使用 firewalld/ufw 等高階工具管理。