How to analyse traffic from another VM in Azure using UDR - azure

Scenario
In Azure, I have the following configuration:
1 VNET (address space) - 10.10.0.0/24
Subnet 1 - 10.10.0.0/28
Subnet 2 - 10.10.0.16/28
VM 1 (in subnet 1) - has IP# of 10.10.0.1
VM 2 (in subnet 2) - has IP# of 10.10.0.17
Problem
I need to create a UDR (a custom route) that allows VM1 to receive all packets from VM2.
What would that route be?
I cannot seem to find any links on the internet explaining this scenario.

I have tested in my environment.
By default, the VM1 in subnet1 is allowed to receive all data packets from VM2 in subnet2 if both subnet1 and subnet2 are in the same Virtual Network. We do not need to create any custom route (User Defined Route) for this
For this to work, the firewall for the private networks needs to be turned off inside both the VMs. Then both the VMs will be able to receive data packets from each other
I created VM1 (10.0.0.4) in subnet1 (10.0.0.0/24) and VM2 (10.0.1.4) in subnet2 (10.0.1.0/24)
I turned the firewall off for private networks in both the VMs VM1 and VM2
I can receive data packets from each other
I pinged VM2 private IP address from VM1 and able to receive the data packets from VM2

Related

How to access private VM IIS from internet in AZURE?

Please below image: subnetimage
I have below things:
3 VM inside 3 subnet all are in Vnet1.
VM1 has enable IIS and it's private access through subnet B.
Is there any ways to allow traffic from VM2 to VM1? I have tried multiple time but didn't worked.
I have followed below MS Docs, but it allows only internally(private) in network, it's not working for internet.
https://learn.microsoft.com/en-us/azure/virtual-network/tutorial-create-route-table-portal
I've custom template of this scenarios, You have just apply it and all configuration will be created.
you can access from below link:
https://www87.zippyshare.com/v/bEcvSVnC/file.html
I'm new Here , Please help me out from this issue.
Update :
VM1 has assign public IP and I need all traffic from public IP of vm1 from VM2.
Please check below image for more info.
• I would suggest you to please attach one more NIC (Network Interface Card) to the VM1 in subnet A and enable IP forwarding in that NIC along with enabling the same setting in VM2 in subnet B. Since, VM2 is exposed to the internet and has a public IP address but VM1 doesn’t, thus when you configure the NSG (Network Security Group) of both the NICs, ensure that you are creating inbound as well as outbound rules for ensuring traffic flow smoothly over port 80 and 443 through both the NICs. This will ensure that internet traffic over the designated ports is only forwarded from the VM2 to the VM1 and vice versa.
• Also, if you want to, you can attach the additional NIC to VM1 and associate it in some other subnet, i.e., subnet C or any other subnet. This will ensure that the subnet level NSG in effect can be configured for the related subnets only, i.e., subnet in which the additional NIC for VM1 is added and the subnet for VM2. For more information, kindly refer to the below documentation links on attaching additional NICs to the VMs: -
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/multiple-nics
https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface-vm#view-network-interfaces-for-a-vm
Snapshots for reference: -
Update : - Yes, you can surely browse the IIS page by accessing the public IP address of the VM1 in local system through chrome browser. But you will need to open the ports 80 and 443 for inbound traffic access on the VM1's NSG. Also, if you want the VM1 to have a publicly accessible DNS name/label, then you will have to configure the desired DNS name in the VM1 settings. To do the above said configurations, kindly refer to the link below: - https://social.msdn.microsoft.com/Forums/expression/en-US/98da3ab5-3909-4048-b935-95d5f7667ab5/accessing-azure-virtual-machine-iis-website-publicly?forum=WAVirtualMachinesforWindows#:~:text=1-%20Click%20on%20the%20VM,Click%20on%20Save.

Unable to send ping request from one virtual machine to another placed in different subnets but on the same virtual network

I am facing an issue in sending the ping request from one virtual machine to another that are placed in different subnets in a same virtual network
Eg Let the 2 virtual machines are HPCES001 and HPCMG001. These 2 machines are having 2 NIC cards and ip addresses includes and are placed in 2 subnets
HPCES001 - One nic card (172.16.168.45) is connected to A subnet and its other nic is connected to subnet B
HPCMG001 - One nic (10.20.30.50) is connected to subnet C and its other interface 172.16.4.50 is connected to subnet B
I am able to send ping request to 172.16.168.45 from HPCMG001 and the opposite is not working. I am unable to ping 10.20.30.50 from HPCES001. I have enabled routing in all the machines, enabled outbound and inbound rules in firewall. Enabled Routing services and ip routing registry but still I am unable to ping to 10.20.30.50 from HPCES001 and its showing as connection timed out. What could be the reason and how can I fix it
Could you please help ?

Inbound and Outbound Rules Confusion Azure

I am using same NSG for two subnets in a VM. Now i have created a Custom rule where VM1 cannot accept packets from VM2. But default NSG rule allows VM2 to send packets to VM1.
Here are the pictures - Vm2 to Vm1 outbound default rule created by NSG
Vm1 custom inbound rule set by me
Does VM2 communicate with VM1 or can VM1 receive packets from VM2?
As your screenshot displayed, VM2 can send packages to VM1 but VM1 can not receive packages from VM2 because the inbound traffic from VM2 is blocked.
For a short test. VM1 is VMb and VM2 is VMc in my example.
The NSG setting of both subnets
From VMb to VMC
From VMC to VMb

Virtual network peering connection azure

I have the following three virtual networks: - VNETa - VNETb - VNETc All the network traffic between the three virtual networks will be routed through VNET1a.
need to create the virtual networks, and then to ensure that all the Azure virtual machines can connect to other virtual machines by using their private IP address.
The solutions must NOT require any virtual gateways and must minimize the number of peerings. What should you do from the Azure portal before you configuring IP routing?
You could make peering between VNETa and VNETb, peering between VNETa and VNETc. Without a virtual network gateway and without a separate peering connection between those spokes VNETb and VNETc, to make the spoke connectivity, you need to deploy a virtual appliance as the hub in the network VNETa, then make two UDRs in each spoke VNets VNETb and VNETc to route traffic from one spoke network to another spoke network via NVA. In this scenario, you must configure the peering connections to allow forwarded traffic. see the explanation link.
For more details of UDR configuration, you could refer to this blog about Azure Networking - Hub-Spoke with NVA and Azure Firewall
The key to answering this question is to understand that the question is indicating that an IP routing solution will be configured after you have provisioned the necessary resources and configured appropriately: "...before you configure IP routing".
You do not need a gateway subnet or virtual gateways to implement a hub and spoke topology assuming that you are going to provision, for example, a VM with IP Forwarding enabled on the vNIC to act as a router.
Create your 3 subnets, in your example VNETa, VNETb and VNETc
From VNETa, create a peering with VNETb using the Resource Manager Deployment Model
Ensure "Allow forwarded traffic from VNETa to VNETb" is enabled
Repeat steps 2 & 3, substituting VNETb for VNETc
And that's it. Now when you configure IP routing you will provision a router VM or some other Network Virtual Appliance (NVA) in the hub network and create a Route Table for later application to VNETb and VNETc specifying the router VM's internal IP as the next hop.
Jamie.

Vnet to Vnet machines not pinging

I have the following scenario.
2 vnets (same location/location, but different resource groups)
vnetA: Address space 10.1.0.0/16
Gateway subnet 10.1.1.0/24
VM 10.1.0.5
vnetB: Address space 10.0.0.0/16
Gateway subnet 10.0.2.0/24
VM 10.0.1.7
They are both peered through vnet to vnet gateways, but machines cannot ping each other.
Could anyone please guide to documentation or give advice to this please?
You should check the Network Security Groups rules associated to the VNet's Subnets or to the VM's NICs. Unfortunately there is no a specific rule for ICMP protocol, but TCP and UDP only. You have to come up with a rule that suites your needs with the 'any' protocol (i.e. '*').
Instead of using ICMP, when you want to test network connectivity I would suggest to use some TCP protocol based tool like Test-NetConnection and create proper rules in the NSG to let the network traffic pass.

Resources