Linux常用命令大全之IPTABLES命令操作
命令代码 | 注释说明 |
---|---|
iptables -t filter -L | 显示过滤表的所有链路 |
iptables -t nae -L | 显示nat表的所有链路 |
iptables -t filter -F | 以过滤表为依据清理所有规则 |
iptables -t nat -F | 以nat表为依据清理所有规则 |
iptables -t filter -X | 删除所有由用户创建的链路 |
iptables -t filter -A INPUT -p tcp –dport telnet -j ACCEPT | 允许telnet接入 |
iptables -t filter -A OUTPUT -p tcp –dport telnet -j DROP | 阻止telnet接入 |
iptables -t filter -A FORWARD -p tcp –dport pop3 -j ACCEPT | 允许转发链路上的POP3连接 |
iptables -t filter -A INPUT -j LOG –log-prefix | 记录所有链路中被查封的包 |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | 设置一个PAT(端口地址转换)在eth0掩盖发出包 |
iptables -t nat -A POSTROUTING -d 192.168.0.1 -p tcp -m tcp –dport 22-j DNAT –to-destination 10.0.0.2:22 | 将发往一个主机地址的包转向到其他主机 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 码农浅知!
评论