iptables -F
iptables -X
/*******开放的端口*******/
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8080 -j ACCEPT
/*******允许访问服务器的IP*******/
iptables -A INPUT -s 192.168.1.162 -j ACCEPT
/*******允许服务器向外的访问*******/
iptables -A OUTPUT -j ACCEPT
/*******禁止其他访问*******/
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
linux服务器端口开放
猜你喜欢
转载自roc-who.iteye.com/blog/2423926
今日推荐
周排行