适用于DNS的iptables规则

发布时间:2020-08-08 18:27:50 作者:urey_pp
来源:网络 阅读:2921

# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.3.5 on Thu Oct 31 15:53:45 2013    
*filter    
:INPUT ACCEPT [0:0]    
:FORWARD ACCEPT [0:0]    
:OUTPUT ACCEPT [25144:3493694]    
:RH-Firewall-1-INPUT - [0:0]    
-A INPUT -p udp -m udp --sport 53 -j ACCEPT    
-A INPUT -p tcp -m tcp --sport 53 -j ACCEPT

-A INPUT -j RH-Firewall-1-INPUT    
-A FORWARD -j RH-Firewall-1-INPUT    
-A RH-Firewall-1-INPUT -i lo -j ACCEPT    
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT    
-A RH-Firewall-1-INPUT -p esp -j ACCEPT    
-A RH-Firewall-1-INPUT -p ah -j ACCEPT    
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT    
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 20000:20500 -j ACCEPT    
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited    
COMMIT    
# Completed on Thu Oct 31 15:53:45 2013    
# cat /etc/sysconfig/iptables.save
# Firewall configuration written by system-config-securitylevel    
# Manual customization of this file is not recommended.    
*filter    
:FORWARD ACCEPT [0:0]    
:INPUT ACCEPT [0:0]    
:RH-Firewall-1-INPUT - [0:0]    
:OUTPUT ACCEPT [0:0]    
-A INPUT -j RH-Firewall-1-INPUT    
-A FORWARD -j RH-Firewall-1-INPUT    
-A RH-Firewall-1-INPUT -i lo -j ACCEPT    
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT    
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT    
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT    
-A RH-Firewall-1-INPUT -p udp -d 224.0.0.251 --dport 5353 -j ACCEPT    
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 22 --state NEW -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 21 --state NEW -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 80 --state NEW -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 8080 --state NEW -j ACCEPT    
-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 20000:20500 --state NEW -j ACCEPT    
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited    
COMMIT    
#

推荐阅读:
  1. 关于iptables -m选项以及规则的理解
  2. iptables常用规则

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

dns 端口 iptables

上一篇:人工智能技术落地:无人驾驶的机遇和挑战

下一篇:Python的5个顶级异步框架

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》