25个常用的Linux Iptables规则

发布时间:2018-12-18 16:24:29编辑:丝画阁阅读(1032)

Iptables是与最新的 3.5 版本 Linux内核集成的IP信息包过滤系统。如果 Linux 系统连接到因特网或 LAN、服务器或连接 LAN 和因特网的代理服务器,则该系统有利于在 Linux 系统上更好地控制 IP 信息包过滤和防火墙配置。以下是25个常用的Iptables规则。

# 1. 删除所有现有规则


25个常用的Linux Iptables规则



# 2. 设置默认的 chain 策略

25个常用的Linux Iptables规则



# 3. 阻止某个特定的 IP 地址

25个常用的Linux Iptables规则



# 4. 允许全部进来的(incoming)SSH

25个常用的Linux Iptables规则



# 5. 只允许某个特定网络进来的 SSH

25个常用的Linux Iptables规则



# 6. 允许进来的(incoming)HTTP

25个常用的Linux Iptables规则



# 7. 多端口(允许进来的 SSH、HTTP 和 HTTPS)

25个常用的Linux Iptables规则



# 8. 允许出去的(outgoing)SSH

25个常用的Linux Iptables规则



# 9. 允许外出的(outgoing)SSH,但仅访问某个特定的网络

25个常用的Linux Iptables规则



# 10. 允许外出的(outgoing) HTTPS

25个常用的Linux Iptables规则



# 11. 对进来的 HTTPS 流量做负载均衡

25个常用的Linux Iptables规则



# 12. 从内部向外部 Ping

25个常用的Linux Iptables规则



# 13. 从外部向内部 Ping

25个常用的Linux Iptables规则



# 14. 允许环回(loopback)访问

25个常用的Linux Iptables规则



# 15. 允许 packets 从内网访问外网

25个常用的Linux Iptables规则



# 16. 允许外出的 DNS

25个常用的Linux Iptables规则



# 17. 允许 NIS 连接

25个常用的Linux Iptables规则



# 18. 允许某个特定网络 rsync 进入本机

25个常用的Linux Iptables规则



# 19. 仅允许来自某个特定网络的 MySQL 的链接

25个常用的Linux Iptables规则



# 20. 允许 Sendmail 或 Postfix

25个常用的Linux Iptables规则



# 21. 允许 IMAP 和 IMAPS

25个常用的Linux Iptables规则



# 22. 允许 POP3 和 POP3S

25个常用的Linux Iptables规则



# 23. 防止 DoS 攻击

25个常用的Linux Iptables规则



# 24. 设置 422 端口转发到 22 端口

25个常用的Linux Iptables规则



# 25. 为丢弃的包做日志(Log)

25个常用的Linux Iptables规则



作者:数据库开发来源:http://os.51cto.com/art/201709/551245.htm

关键字