`

服务器防火墙配置

 
阅读更多

 

 

 

[root@qs-xept-app bin]# iptables -L

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

 

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

 

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         

 

Chain RH-Firewall-1-INPUT (2 references)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http 

 

 

[root@qs-xept-app bin]# iptables -I RH-Firewall-1-INPUT -p tcp --dport 8080 -j ACCEPT

[root@qs-xept-app bin]# iptables -L

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

 

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

 

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         

 

Chain RH-Firewall-1-INPUT (2 references)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:webcache 

 

[root@qs-xept-app bin]# service iptables save

将当前规则保存到 /etc/sysconfig/iptables:                 [确定]




如果添加失败:
方式二:

 iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
serice iptabels save 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics