QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2574|回复: 0

【资料】iptables的一些规则的中文说明【转贴】

[复制链接]
发表于 2002-12-17 20:57:07 | 显示全部楼层 |阅读模式
iptables -A INPUT -p tcp -s x.x.x.x/x --dport 22 -j ACCEPT // 允许源地址为x.x.x.x/x的主机通过22(ssh)端口.
iptables -A INPUT -p tcp --dport 80 -j ACCEPT // 允许80(http)端口的数据包进入
iptables -A INPUT -p tcp --dport 110 -j ACCEPT // 允许110(pop3)端口的数据包进入如果不加这规则,就只能通过web页面来收信(无法用OE或Foxmail等来收)
iptables -A INPUT -p tcp --dport 25 -j ACCEPT // 允许25(smtp)端口的数据包进入,如果不加这规则,就只能通过web页面来发信(无法用OE或Foxmail等来发)
iptables -A INPUT -p tcp --dport 21 -j ACCEPT  // 允许21(ftp)端口的数据包进入(传数据)     
iptables -A INPUT -p tcp --dport 20 -j ACCEPT  // 允许20(ftp)端口的数据包进入(执行ftp命令,如dir等)
iptables -A INPUT -p tcp --dport 53 -j ACCEPT  // 允许53(dns)端口的数据包进入(tcp)
iptables -A INPUT -p udp --dport 53 -j ACCEPT  // 允许53(dns)端口的数据包进入(udp)
iptables -A INPUT -p icmp -j ACCEPT // 允许ICMP包通过
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT //利用 iptables 对连接状态的支持
iptables -P INPUT DROP //把INPUT链的默认规则设置为DROP
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-4 20:44 , Processed in 0.090683 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表