I have two boxes one ubuntu v10.10 (IP: 192.168.12.128) and another centos v5.5 (IP: 192.168.12.131)
I m able to ping centos from ubuntu box and vice versa.
When I telnet UBUNTUIP using port 7000 from centos it works
when I telnet CENTOSIP using port 7000 from ubuntu I get error "Unable to connect to remote host: No route to host"
I tried to open port in centOS using command iptables -A INPUT -p tcp --dport 7000 -j ACCEPT
but I'm still unable to telnet centos on this port.
The reason I want port 7000 open because I'm trying to setup a cassandra cluster.
Please let me know what I'm doing wrong here and what I can do to make it work.
Update
the output of sudo iptables --list
Chain INPUT (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain RH-Firewall-1-INPUT (2 references) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp any ACCEPT esp -- anywhere anywhere ACCEPT ah -- anywhere anywhere ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns ACCEPT udp -- anywhere anywhere udp dpt:ipp ACCEPT tcp -- anywhere anywhere tcp dpt:ipp ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:afs3-fileserver
Output of netstat -putna UPDATED For centOS when cassandra is running
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:800 0.0.0.0:* LISTEN 3586/rpc.statd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3554/portmap tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 4592/java tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3812/cupsd tcp 0 0 192.168.12.131:7000 0.0.0.0:* LISTEN 4592/java tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3835/sendmail: acce tcp 0 0 0.0.0.0:54650 0.0.0.0:* LISTEN 4592/java tcp 0 0 0.0.0.0:59802 0.0.0.0:* LISTEN 4592/java tcp 0 0 127.0.0.1:51116 127.0.0.1:39490 TIME_WAIT - tcp 0 0 192.168.12.131:51779 192.168.12.128:7000 ESTABLISHED 4592/java tcp 0 0 192.168.12.131:52929 192.168.12.128:7000 ESTABLISHED 4592/java tcp 0 0 :::22 :::* LISTEN 3803/sshd udp 0 0 0.0.0.0:33161 0.0.0.0:* 3936/avahi-daemon: udp 0 0 0.0.0.0:794 0.0.0.0:* 3586/rpc.statd udp 0 0 0.0.0.0:797 0.0.0.0:* 3586/rpc.statd udp 0 0 0.0.0.0:68 0.0.0.0:* 3415/dhclient udp 0 0 0.0.0.0:5353 0.0.0.0:* 3936/avahi-daemon: udp 0 0 0.0.0.0:111 0.0.0.0:* 3554/portmap udp 0 0 0.0.0.0:631 0.0.0.0:* 3812/cupsd udp 0 0 :::51370 :::* 3936/avahi-daemon: udp 0 0 :::5353 :::* 3936/avahi-daemon:
UPDATED Output of netstat -putna in Ubuntu box when cassandra sunning on both box
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 865/mysqld tcp 0 0 0.0.0.0:40333 0.0.0.0:* LISTEN 2019/java tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 2019/java tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1675/apache2 tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 942/cupsd tcp 0 0 192.168.12.128:7000 0.0.0.0:* LISTEN 2019/java tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 881/postgres tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1675/apache2 tcp 0 0 0.0.0.0:53412 0.0.0.0:* LISTEN 2019/java tcp 0 0 127.0.0.1:9160 0.0.0.0:* LISTEN 2019/java tcp 1 0 192.168.12.128:37629 203.197.174.87:80 CLOSE_WAIT 1918/clock-applet tcp 1 0 192.168.12.128:37630 203.197.174.87:80 CLOSE_WAIT 1918/clock-applet tcp 0 1 192.168.12.128:49373 192.168.12.131:7000 SYN_SENT 2019/java tcp 0 0 192.168.12.128:7000 192.168.12.131:46356 ESTABLISHED 2019/java tcp 0 0 192.168.12.128:7000 192.168.12.131:56337 ESTABLISHED 2019/java tcp 1 0 192.168.12.128:54117 203.197.174.80:80 CLOSE_WAIT 1918/clock-applet tcp6 0 0 ::1:631 :::* LISTEN 942/cupsd tcp6 0 0 ::1:5432 :::* LISTEN 881/postgres udp 0 0 0.0.0.0:60819 0.0.0.0:* 713/avahi-daemon: r udp 0 0 0.0.0.0:68 0.0.0.0:* 753/dhclient udp 0 0 0.0.0.0:5353 0.0.0.0:* 713/avahi-daemon: r udp6 0 0 ::1:51637 ::1:51637 ESTABLISHED 881/postgres udp6 0 0 :::52390 :::* 713/avahi-daemon: r udp6 0 0 :::5353 :::* 713/avahi-daemon: r
Output of telnet localhost 7000 after stopping iptables service
Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host: Connection refused
The above is output because cassandra just wont start trying to find seed node(ubuntu box), the error is "connection refused" whereas error from ubuntu telnet is "No route to host"
UPDATE
I was able to resolve the issue it was - port blocked by firewall The problem became more so a problem if you add a person like me who has absolutely no knowledge of port bindings (When a port can be accessed - only when some application is listening for it @dyasny, it helped me diagnose and learn few fundamentals) and linux os.
Thanks to you all for helping me.
Sudesh
sudo iptables --list
iptables-save
? here or in pastebin.com