I have issue that I cannot reach the 3306 port (mysql) even if I set it in iptables
.
How can I resolve this issue?
root@vps191532:# iptables-save
# Generated by iptables-save v1.4.21 on Thu Oct 22 20:42:38 2015
*filter
:INPUT ACCEPT [695:36753]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [469:37083]
-A INPUT -p tcp -m tcp --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT
COMMIT
# Completed on Thu Oct 22 20:42:38 2015
root@vps191532:# netstat -lnpa | grep mysql
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 8960/mysqld
unix 2 [ ACC ] STREAM LISTENING 42152 8960/mysqld /var/run/mysqld/mysqld.sock
C:\Users>telnet 149.XXX.51.XXX 3306
Connecting To 149.XXX.51.XXX...Could not open connection to the host, on port 3306: Connect failed
root@vps191532:# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql state NEW,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:mysql state ESTABLISHED