linux下防火墙 开启某个端口
直接在/etc/sysconfig/iptables中增加一行:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT
注意添加位置:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-ARH-Firewall-1-INPUT-mstate--stateNEW-mtcp-ptcp--dport11211-jACCEPT(新添加的)
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited//在这下面加没有用 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT(新添加的)
#重启防火墙以便改动生效
/etc/init.d/iptables restart
相关推荐
yshlovelx 2020-05-27
Aveiox 2020-06-25
89284553 2020-07-17
Wepe0 2020-10-30
Lostinthewoods 2020-10-29
hickwu 2020-10-23
focusforce 2020-10-10
summerinsist 2020-08-21
winki 2020-08-19
大老张学编程 2020-07-04
xiaohouye 2020-06-28
lizhengfa 2020-06-26
clamzxf 2020-06-16
kerson 2020-06-16
zhangwentaohh 2020-06-14