question

AbHimmit-6209 avatar image
0 Votes"
AbHimmit-6209 asked DSPatrick answered

Cannot connect to background rest server using port 5000 on hyper-v windows guest

I have a hyper-v windows 7 guest. I also have a Rest server listening to port 5000 on this guest.
From the windows 10 host I can ping this VM. And I can ping the host from this VM.
I have added a rule to the firewall on this VM.
I'm using nmap to see if port 5000 is open on the VM, but I keep getting the status "filtered".
I cannot get port 5000 to open on this VM.
Any idea why the port 5000 cannot be opened on this VM?

windows-server-hyper-v
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbHimmit-6209 avatar image
0 Votes"
AbHimmit-6209 answered DSPatrick commented

Thanks for your answer, all is good now.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your answer, all is good now.

Since I provided the answer please mark my post as answer.








0 Votes 0 ·
DSPatrick avatar image
0 Votes"
DSPatrick answered

You could try with firewall off as a test to rule out or confirm a firewall problem.

--please don't forget to upvote and Accept as answer if the reply is helpful--


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbHimmit-6209 avatar image
0 Votes"
AbHimmit-6209 answered

Yes, tried that. With firewall disabled, the port is showing to be closed.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered

Sounds like the service either doesn't listen on expected port or possibly some other device in route is blocking.

--please don't forget to upvote and Accept as answer if the reply is helpful--





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ElevenYu-MSFT avatar image
0 Votes"
ElevenYu-MSFT answered

Hi,

There are several links mentioned similar issue as yours. Maybe you could try these solutions to see if any one could help resolve your problem.

Ports refuse to open with firewall on or off
Problem with open ports in Windows Firewall
Why won't windows firewall open port
Firewall rules not working properly

Also, we suggested that you could use Telnet instead of nmap to test if the port is open or not.


Thanks,


If the Answer is helpful, please click "Accept Answer" and upvote it. Thanks.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbHimmit-6209 avatar image
0 Votes"
AbHimmit-6209 answered

Thanks you all,

Some of the links above don't work, others did not give me the solution needed.
I also used, as suggested, telnet, but it didn't help me more than before.
I really have no clue what else to do, this is really a challenge.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered

I'd start with from cmd.exe
netstat -aon
or
netstat -aonb
to confirm the process listens on the correct interface.

--please don't forget to upvote and Accept as answer if the reply is helpful--



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbHimmit-6209 avatar image
0 Votes"
AbHimmit-6209 answered

Done all that. My Rest server is already listening using port 5000 on the guest VM.
But I'm not able to connect to this server from the client side, which is installed on the host computer (w10)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered

That doesn't help us, please post the result.

Also post an unedited ipconfig /all of both



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbHimmit-6209 avatar image
0 Votes"
AbHimmit-6209 answered AbHimmit-6209 published

Netstat result


Active Connections

Proto Local Address Foreign Address State PID
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 3992
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 716
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 3992
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING 412
TCP 0.0.0.0:1026 0.0.0.0:0 LISTENING 764
TCP 0.0.0.0:1027 0.0.0.0:0 LISTENING 968
TCP 0.0.0.0:1028 0.0.0.0:0 LISTENING 512
TCP 0.0.0.0:1029 0.0.0.0:0 LISTENING 520
TCP 0.0.0.0:1069 0.0.0.0:0 LISTENING 1112
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1100
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 712
TCP 0.0.0.0:5357 0.0.0.0:0 LISTENING 4
TCP 10.0.0.9:139 0.0.0.0:0 LISTENING 4
TCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 2324
TCP 127.0.0.1:6379 0.0.0.0:0 LISTENING 1484
TCP [::]:80 [::]:0 LISTENING 3992
TCP [::]:135 [::]:0 LISTENING 716
TCP [::]:443 [::]:0 LISTENING 3992
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:1025 [::]:0 LISTENING 412
TCP [::]:1026 [::]:0 LISTENING 764
TCP [::]:1027 [::]:0 LISTENING 968
TCP [::]:1028 [::]:0 LISTENING 512
TCP [::]:1029 [::]:0 LISTENING 520
TCP [::]:1069 [::]:0 LISTENING 1112
TCP [::]:3306 [::]:0 LISTENING 1100
TCP [::]:3389 [::]:0 LISTENING 712
TCP [::]:5357 [::]:0 LISTENING 4
TCP [::1]:5000 [::]:0 LISTENING 2324
TCP [fe80::b105:599a:77e9:4d3%17]:1077 [fe80::7d39:c3aa:b6e0:24ce%17]:445 ESTABLISHED 4
UDP 0.0.0.0:500 : 968
UDP 0.0.0.0:3702 : 936
UDP 0.0.0.0:3702 : 936
UDP 0.0.0.0:3702 : 2724
UDP 0.0.0.0:3702 : 2724
UDP 0.0.0.0:4500 : 968
UDP 0.0.0.0:5355 : 712
UDP 0.0.0.0:53435 : 2724
UDP 0.0.0.0:53904 : 936
UDP 0.0.0.0:64676 : 936
UDP 10.0.0.9:137 : 4
UDP 10.0.0.9:138 : 4
UDP 10.0.0.9:1900 : 2724
UDP 10.0.0.9:61333 : 2724
UDP 127.0.0.1:1900 : 2724
UDP 127.0.0.1:61334 : 2724
UDP [::]:500 : 968
UDP [::]:3702 : 936
UDP [::]:3702 : 2724
UDP [::]:3702 : 2724
UDP [::]:3702 : 936
UDP [::]:4500 : 968
UDP [::]:5355 : 712
UDP [::]:53436 : 2724
UDP [::]:53905 : 936
UDP [::]:64677 : 936
UDP [::1]:1900 : 2724
UDP [::1]:61332 : 2724
UDP [fe80::b105:599a:77e9:4d3%17]:1900 : 2724
UDP [fe80::b105:599a:77e9:4d3%17]:61331 : 2724


IPConfig result


Windows IP Configuration

Host Name . . . . . . . . . . . . : abhimmit-PC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Mixed
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection 6:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #4
Physical Address. . . . . . . . . : 00-15-5D-F9-E3-04
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::b105:599a:77e9:4d3%17(Preferred)
IPv4 Address. . . . . . . . . . . : 10.0.0.9(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Saturday, July 24, 2021 12:57:37 PM
Lease Expires . . . . . . . . . . : Sunday, July 25, 2021 12:57:35 PM
Default Gateway . . . . . . . . . : 10.0.0.138
DHCP Server . . . . . . . . . . . : 10.0.0.138
DHCPv6 IAID . . . . . . . . . . . : 352327005
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-24-6A-57-82-00-15-5D-F0-D5-01
DNS Servers . . . . . . . . . . . : 10.0.0.138
NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter isatap.{C9B51403-993C-4097-9B8F-2EED09E5D212}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.