iptables添加888放行端口失败
# systemctl status iptables● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
Active: inactive (dead)
May 21 11:38:33 ecs-86921519 systemd: Unit iptables.service cannot be reloaded because it is inactive.
# systemctl status firewalld
● firewalld.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)
# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 22436/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1292/sshd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 23009/mysqld
tcp6 0 0 :::22 :::* LISTEN 1292/sshd
# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all--0.0.0.0/0 0.0.0.0/0
ACCEPT all--0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT tcp--0.0.0.0/0 0.0.0.0/0 tcp dpt:22
ACCEPT tcp--0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp--0.0.0.0/0 0.0.0.0/0 tcp dpt:443
ACCEPT tcp--0.0.0.0/0 0.0.0.0/0 tcp dpt:21
ACCEPT tcp--0.0.0.0/0 0.0.0.0/0 tcp dpt:20
ACCEPT icmp --0.0.0.0/0 0.0.0.0/0 icmptype 8
REJECT all--0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
ACCEPT tcp--0.0.0.0/0 0.0.0.0/0 tcp dpt:888
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all--0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all--0.0.0.0/0 0.0.0.0/0
#
如上代码,iptables添加888放行端口失败是什么原因?请各位大神指点。
用的lnmp1.9稳定版,检查firewalldiptables都是关闭的,打开iptables还是显示iptables无法正常运行, 你这机器上iptables和firewalld都没运行,而且你 netstat -ntlp 结果也显示你机器上没有程序在888端口监听,服务都没起来如果直接访问888端口肯定是不通的
如果是云服务商还可能有安全组之类的,如果有就还需要安全组里放行
页:
[1]