WindowsでLinuxポートに接続できません。

WindowsでLinuxポートに接続できません。

Windowsでクライアントを実行している間、LinuxでgRPCサービスを実行しようとしています。

私のWindowsコンピュータで使用されているLinuxポートをテストできないようです。どちらのコンピュータも同じネットワーク上にあります。 Windows 10とCentOS 8.

これはPowershellが私に与えたものです:

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

私はLinuxについてはわかりませんが、ポートが開いていてそれを使用するサービスが実行されていることを確認しようとしたいくつかのコマンドと、得られた結果は次のとおりです。

[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: 

また、役に立つかどうかを確認するために、WindowsとLinuxでファイアウォールを無効にしてみましたが、役に立ちませんでした。

ベストアンサー1

127.0.0.1::1ローカルループバックアドレス。彼らただ同じマシンからアクセス可能です。これが他のコンピュータがこれを見ることができない理由です。

サーバーの起動方法を変更する必要があります。内部ネットワークアドレスではなくローカルネットワークアドレスにバインドするように指示します。

おすすめ記事