I'm trying to run a gRPC service on Linux while running a client on Windows.
I seem to be unable to test the Linux port that I use from my Windows machine. Both machines are in the same network. Windows 10 and CentOS 8.
Here's what Powershell gives me:
PS C:\WINDOWS\system32> tnc server_ip -p 55555 -Debug
DEBUG: TCP connect to (server_ip : 55555) threw exception: Exception
calling "GetResult" with "0" argument(s): "No connection
could be made because the target machine actively refused it
server_ip :55555"
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is
"Y"): y
WARNING: TCP connect to (server_ip : 55555) failed
ComputerName : server_ip
RemoteAddress : server_ip
RemotePort : 55555
InterfaceAlias : Ethernet
SourceAddress : client_ip
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False
I don't know much about Linux, but here are some commands that I tried to check that the port is open and the service that uses it is running, and the results that I got:
[user@localhost ~]$ grep -w 55555 /etc/services
test 55555/tcp # TestService
[user@localhost ~]$ sudo lsof -i -P -n | grep LISTEN
[sudo] password for user:
GrpcServi 10933 user 166u IPv4 1090871 0t0 TCP 127.0.0.1:55555 (LISTEN)
GrpcServi 10933 user 167u IPv6 1090874 0t0 TCP [::1]:55555 (LISTEN)
[user@localhost ~]$ sudo netstat -tulpn | grep LISTEN
tcp 0 0 127.0.0.1:55555 0.0.0.0:* LISTEN 10933/./GrpcService
tcp6 0 0 ::1:55555 :::* LISTEN 10933/./GrpcService
[user@localhost ~]$ sudo netstat -tulpn | grep :55555
tcp 0 0 127.0.0.1:55555 0.0.0.0:* LISTEN 10933/./GrpcService
tcp6 0 0 ::1:55555 :::* LISTEN 10933/./GrpcService
[user@localhost ~]$ sudo ss -tulpn | grep LISTEN
tcp LISTEN 0 128 127.0.0.1:55555 0.0.0.0:* users:
(("GrpcService",pid=10933,fd=166))
tcp LISTEN 0 128 [::1]:55555 [::]:* users:
(("GrpcService",pid=10933,fd=167))
[user@localhost ~]$ sudo ss -tulpn | grep ':55555'
tcp LISTEN 0 128 127.0.0.1:55555 0.0.0.0:* users:
(("GrpcService",pid=10933,fd=166))
tcp LISTEN 0 128 [::1]:55555 [::]:* users:
(("GrpcService",pid=10933,fd=167))
[user@localhost ~]$ sudo lsof -i -P -n | grep LISTEN
GrpcServi 10933 user 166u IPv4 1090871 0t0 TCP 127.0.0.1:55555 (LISTEN)
GrpcServi 10933 user 167u IPv6 1090874 0t0 TCP [::1]:55555 (LISTEN)
[user@localhost ~]$ sudo firewall-cmd --zone=public --list-all
[sudo] password for user:
public (active)
target: default
icmp-block-inversion: no
interfaces: enp2s0
sources:
services: cockpit dhcpv6-client ssh
ports: 3389/tcp 3389/udp 55555/tcp
protocols:
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
I also tried disabling firewalls on both Windows and Linux to check if that might help, but to no avail.
129.168.*.*,10.*.*.*.*, or172.16.0.0–172.31.255.255are in any way secret.0.0.0.0, it means listen on all addresses. As well as being easier (you don't have to lookup the address), will avoid some gotchas, such as loopback address will also keep working.