1

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.

7
  • Please post text as text. Pictures are hard to read. Commented Apr 8, 2020 at 9:26
  • Also address 129.168.*.*, 10.*.*.*.*, or 172.16.0.0172.31.255.255 are in any way secret. Commented Apr 8, 2020 at 9:29
  • @ctrl-alt-delor added text instead of the image. Sorry, don't understand your second comment? Commented Apr 8, 2020 at 9:32
  • 1
    The addresses listed in 2nd comment, are local reusable addresses. Don't worry about keeping them secret. They will reveal nothing about who you are, or your organisation. Commented Apr 8, 2020 at 9:36
  • 1
    You can also use address 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. Commented Apr 8, 2020 at 9:45

1 Answer 1

4

127.0.0.1 and ::1, are local loopback addresses. They are only accessible from the same machine. This is why your other machine can not see them.

You will need to change how you launch the server. To tell it to bind on an local-network address (not internal-network address).

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.