That hadn't nothing to do with iptables. It was an issue with my router blocking all ports. I just added a rule to allow incoming connections to VNC ports.
I'm getting literally crazy.
I'm on CentOS 6.6 and I just want to add a simple rule to iptables in order to open port 5901 (vnc server) and allow incoming connections.
Here's how I edited iptables file:
vi /etc/sysconfig/iptables iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
Then I restarted both vncserver and iptables.
Here's the output of
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:vnc-800x600x16
Here is the output of
iptables -v -n -L:
Chain INPUT (policy ACCEPT 4428 packets, 5769K bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5901 –
- If I try to connect with a vnc client (remotely, not within the LAN, where it works), I got a timeout connection error
If I check for open ports with nmap, I got:
port 5901 filtered
Services are running fine.
I also tried to disable SELINUX, without any lucky.