How can we check network connection between Azure VM

How can we check network connection between VM?

First, i deploy two Azure VM in same vnet.

I will check network connection 10.0.0.4 => 10.0.0.5:8080
Already i install IIS in 10.0.0.5 and change listen port 80 to 8080.
Usually we can telnet or ping.
But i use powershell command as following.

1
2
3
4
Test-NetConnection [IP Address or ComputerName] -port [Port Number]

# Exmaple
Test-NetConnection 10.0.0.5 -port 80

Oops… I return TcpTestSucceded:False.

1. Check Windows firewall.

First, We open Window Firewall with Advanced Security in Windows.

Right Click on InboundRule in left sidebar, and add a rule.
Click Port then next like under the picture.

Select Protocol(TCP) then type port for open. we should type 8080 in case.

And then we select Allow, Block about rule.
We have to Allow connection, so we select Allow the connection

Select Default value.

And type rule name and description you want.

We checked rule added. left green light means rule enabled.

Ok. we check network connection again.
But.. we can’t reach destination…

2. Using azure trouble shoot

Maybe i think it block in NSG.
If we have under 10 rule in NSG, we find the block rule easily.
But over 10 rule, it’s too hard find it.
Then we use Azure Troble Shoot.

In VM panel, in Azure Portal. > Connection troubleshoot > Use Network Watcher for detailed connectio tracing

Select Specify manually, then type Target IP(10.0.0.5).
Type port 8080 below input box.
Then Click Check

We return result. if you check first time, it’s longer then you think.
Because install network watcher.
Then the status is Unreachable.
We find the problem about status of 10.0.0.4.
Then Click the row about 10.0.0.4.
It blocked rule named 8080-outbound-allow.

3. check azure nsg

We go to NSG cause block problem.
Oops, i added Deny Rule. not Allow. i changed action to Allow

And then i check status, we finally connection succecssful

Share