AZURE VMs on the same VNET, different subnet can not ping to port other then 3389 - azure

I am very new to the AZURE, and was trying to connect two VM (same network, separate Subset).
I have enabled RDP on both the VM, So I can ping from VM-1 to VM-2 like this:
PS C:\Users\AzureUser> Test-NetConnection 10.0.1.4 -port 3389
ComputerName : 10.0.1.4
RemoteAddress : 10.0.1.4
RemotePort : 3389
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.4
TcpTestSucceeded : True
I guess this is because this port 3389 is used for RDP.
Now in Inbound port rules I have added port 8080 but not able to connect.
PS Output:
PS C:\Users\AzureUser> Test-NetConnection 10.0.1.4 -port 8080
WARNING: TCP connect to 10.0.1.4:8080 failed
WARNING: Ping to 10.0.1.4 failed -- Status: TimedOut
ComputerName : 10.0.1.4
RemoteAddress : 10.0.1.4
RemotePort : 8080
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.4
PingSucceeded : False
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False
Overall Virtual Network connection is like this:
Any help is appreciated.

According to your networking topology, both VMs are in the same VNET, but different SUBNET, it means that traffic between VMs are allowed by default rules in NSG. In order to make sure that everything is correct on Azure network, you can do the following tests.
any chance that VM Windows firewall (10.0.1.4) is blocking traffic on port 8080? Just in case, disable Windows Firewall for this VM and test it again.
from VM 10.0.1.4 run this command, make sure that exists a service listening on port 8080.
netstat -ano | findtr 8080
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 4
TCP [::]:8080 [::]:0 LISTENING 4
you can use Network Watcher to see IP Flow. Select your source VM and put all information about VM destination, local port is a random high port, you can use the same in this image, remote IP and port is your VM 10.0.1.4.
I would say that you have an issue inside your VM 10.0.1.4, based on all information you provided. Let me know if all steps above didn't help and then we can continue working on it.

It's a good idea to see if the port is listening at the destination
netstat -ano | findStr "8080"
Port 3389 is pinging as it is already opened and assigned the RDP application. Similarly, port 8080 should have an application running and in listening mode to ping the port successfully
Thanks,
Manu

You are pinging from one subnet to another. The the traffic must be able to get out of the first subnet and into the second. Therefore, you need to define both inbound and outbound rules.
See: https://learn.microsoft.com/en-us/azure/virtual-network/security-overview#default-security-rules

Related

How to mount Azure File Share in an environment where port 445 is blocked

I'm trying to mount an Azure File Share in an environment where the Proxy settings block port 445 for the global IP address.
As shown in the figure below, port forwarding is done with Azure Virtual Matchine (Linux), connecting to localhost: 1445, and 445 communication to Azure File Share is possible.
However, the mount command cannot use any port other than 445.
I have set the netsh interface portproxy to forward communication on port 445 to localhost: 1445, but the port on 445 does not listen.
$ netsh interface portproxy add v4tov4 listenport = 445 listenaddr = xxx-storage.file.core.windows.net connectport = 1445 connectaddress = 127.0.0.1
$ netstat -ano | findstr: 445
How to mount Azure File Share in an environment where port 445 is blocked?
Also, File Sync cannot be used in my environment.
I have not tried this scenario but you might be able to accomplish this with SSH local port forwarding. The key is if your proxy is blocky localhost connections to port 445.
ssh -L 127.0.0.1:445:FILE_SHARE_URL:445 YOUR_LINUX_BOX_IP
Forwarding (AllowTcpForwarding) needs to be enabled on the Linux SSH server (the jump host).
Server-Side Configuration
I think you also will need to enable the Linux VM IP forwarding but I am not sure.
Since the software will be connecting to port 445 on localhost (127.0.0.1) most firewalls ignore that connection. Then the connection on port 445 is forwarded over SSH which the firewall cannot see. The Linux jump host then opens a connection to the FILE_SHARE_URL.
Local Forwarding

Accessing Azure VM port from Outside of VM

As we know there are simple steps to give access to any VM-port from outside.
Here is the steps I have already covered :
Open VM instance and run the server on port 80 and checked the
localhost is running in the local browse,
added port 80 in the inbound of Network security group,
turned off all three types of firewall from the VM windows.
Still the public ip is not accisible from the outside. Ping ... is resulting "Request timeout" or the port "80" is not accessible from the browser using public IP.
Edit : Surprisingly i have found a Deny tag in the report ! Does it matter ?
Normally, add port 80 to NSG inbound rules and turn off VM's windows firewall, we will access website from outside.
In your scenario, maybe we should check web site work on IPv4 or IPv6 or both?
We can use this command to check it:
C:\Users\jason>netstat -ant
Active Connections
Proto Local Address Foreign Address State Offload State
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING InHost
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING InHost
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING InHost
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING InHost
TCP [::]:80 [::]:0 LISTENING InHost
TCP [::]:135 [::]:0 LISTENING InHost
TCP [::]:445 [::]:0 LISTENING InHost
TCP [::]:3389 [::]:0 LISTENING InHost
We can find web service listen on port 80 and work on IPv4 and IPv6, so we can use IPv4(public IP address) and port 80 to access this web site.
We should make sure web service work on IPv4.
==========================
Update:
Please check your Vnet-->subnet, does this subnet associated with a NSG, if yes, we should modify this NSG's inbound rules, add port 80 to this NSG.
It seems a issue with node server for angular cli, more information please refer to this link below:
https://github.com/angular/angular-cli/issues/1793

Azure VPS not opening any ports no matter what

I'm trying to open several ports on Azure. I have a single VPS with a single network security group with a single virtual network and subnet. Everything seems to be configured correctly, check images:
But trying to ping any port, for instance 8080:
nc -zv 52.166.131.228 8080
nc: connect to 52.166.131.228 port 8080 (tcp) failed: Connection refused
running desperate here, I've followed the guidelines to no avail https://learn.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-nsg-quickstart-portal ...any idea what I'm missing??
According to your error, I think you should check your service firstly. I don’t find 8080 is listening according to your output.
Please ensure port 8080 is listening, you could try to use telnet for test in your VM firstly.
telnet 127.0.0.1 8080
Notes: NSG could associate to VM and subnet.
Please refer to this article about how to manage NSG
I notice that your port 5432 is only listening on 127.0.0.1. I think you should check your configuration. If you want to access port 5432 with public IP, the port should listening on 0.0.0.0

Azure resource manager windows VM accessing endpoints from internet not working

I have installed mirthconnect on windows virtual machine in azure resource manager. I am able to access admin console with http://localhost:8080 .But same is not accessible from internet. I have added endpoints in network security.
Is there any other configuration I am missing here ?
I am able to RDP to the machine . I have tried with source as * and destination as * also . But still no luck.
I am not able to telnet also with the VM public IP and the given ports.
Connect to your Virtual Machine, Open the Firewall Advanced Settings and add an exception for the port 8080 as the EndPoint Configuration doesn't do that for you
Did you allow 8080/TCP from anywhere, for all profiles in Windows Firewall?
Is you daemon listening on 0.0.0.0 or just 127.0.0.1?
netstat -ban
should give you the answer there.
e.g.
[spoolsv.exe]
TCP 0.0.0.0:1540 0.0.0.0:0 LISTENING
[lsass.exe]
TCP 0.0.0.0:2179 0.0.0.0:0 LISTENING
[vmms.exe]
TCP 0.0.0.0:5357 0.0.0.0:0 LISTENING
If you're only listening on localhost (127.0.0.1) you need to address the configuration of your daemon and then restart it.

telnet to azure vm port from outside

I want to telnet virtual machine on port 1234. I have server.exe running on vm which listens to port 1234.
When I run telnet within virtual machine cmd "telnet 127.0.0.1 1234" response is
"ok"
However when I run telnet from outside using "telnet publicIP 1234" response is
Connecting To publicIP...Could not open connection to the host, on
port 1234: Connect failed
I have added endpoints in azure portal and tried switching off the firewall from both virtual machine and my local machine.
Can anyone please suggest?
Two things to consider:
Make sure that your server.exe listens also the VM network adapter, but not only on 127.0.0.1
Make sure that your ISP( Internet Provider) does not block outgoing ports - very common issue.
To avoid (2) change the public port for the VM Endpoint to 80 and try with telnet publicIP 80
To make sure you comply with (1), while on the VM try telnet **localIP** 1234

Resources