Linux Iptables防火墙配置语句

Linux Iptables防火墙配置语句 - 1

 

首先拒绝所有链接:

iptables-P INPUT DROP
Iptables -P FORWARD DROP
Iptables -P OUTPUT ACCEPT
然后开放指定端口:
Iptables -A INPUT -p 协议(tcp/udp) –dport 端口号 -j ACCEPT
Iptables -A OUTPUT -p 协议 –sport 端口号 -j ACCEPT
Iptables保存设置语句:
service Iptables save

5 thoughts on “Linux Iptables防火墙配置语句”

Leave a Reply to 灰常记忆 Cancel reply

Your email address will not be published. Required fields are marked *