| 说明 | 命令 |
|---|---|
| iptables -t 表名 -L | 查看对应表中的所有规则 |
| iptables -t 表名 -L 链名 | 查看表的指定链中的规则 |
| iptables -t 表名 -v -L | 查看对应表中的所有规则 -v显示跟详细的信息 |
| iptables -t 表名 -n -L | -n 表示不解析IP地址 |
| iptables --line-numbers -t 表名 -L | –line-numbers 显示规则的序号 |
| iptables -t 表名 -v -x -L | -x 显示计数器的精确值 |
禁止固定端口(例5500)的访问:
命令语法:iptables -t 表名 -A 链名 匹配条件 -j 动作
iptables -t filter -A INPUT -j DROP -p tcp --dport 5500
iptables -t filter -A INPUT -j DROP -p tcp --dport 5000
参考:https://www.cnblogs.com/kcxg/p/10350870.html
本文介绍iptables命令的基本用法,包括如何查看不同表中的规则、显示详细信息及禁止特定端口访问等操作。通过实例演示iptables配置防火墙的具体步骤。
3万+

被折叠的 条评论
为什么被折叠?



