I want to build a TCP connection with my master and slave (Both CentOS 7). For example, my nodes' IPs are IP1 and IP2. I can ping
each other successfully. But I cannot establish the TCP connection. So I used ncat
to test. What I did is as follows
[Node1] ncat -v -u IP2 Port2
Ncat: Connected to IP2:Port2
[Node2] ncat IP2 Port2
Ncat: No route to host
I have no idea whether my operation is correct to test TCP and UDP. If my operation is correct, why I cannot establish a TCP connection. Could you please tell me why?
Thanks.
It seems IP2 drop SYN packet and return ICMP message to IP1 - you should configure firewall. Similar question - https://unix.stackexchange.com/questions/353452/no-route-to-host-with-nc-but-can-ping