question

GuptaRagini-0172 avatar image
0 Votes"
GuptaRagini-0172 asked SaiKishor-MSFT answered

Exposing host ethernet port connection to Azure (linux) VM

Hi,

I have setup an Azure VM instance that is running guest OS- Linux (Ubuntu). The host OS (Windows) is connected to a private network (LAN) via the ethernet. I would like to know how can I setup this private network with static IPs (192.168.x.x) on my Azure Virtual Machine. I need to essentially expose the ethernet port to my VM, and not sure how I can do that? Any kind of comment/help is appreciated. Thanks.


Best,
Ragini

azure-virtual-network
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.

learn2skills avatar image
0 Votes"
learn2skills answered

Hi @GuptaRagini-0172

A virtual machine (VM) is automatically assigned a private IP address from a range that you specify, based on the subnet in which the VM is deployed. The VM retains the address until the VM is deleted. Azure dynamically assigns the next available private IP address from the subnet you create a VM in. If you want a specific IP address from the subnet assigned to the VM, assign a static IP address.

Explained step-by-step, refer below url.
https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-static-private-ip-arm-pportal



If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.


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.

GuptaRagini-0172 avatar image
0 Votes"
GuptaRagini-0172 answered GuptaRagini-0172 edited

Hi, thanks for your response. But what I want is that the ethernet (physical hardware) port be exposed to the VM so that VM can communicate via the machine's ethernet connection.

So my computer is connected to a controller via Ethernet connection that creates a local subnet in 192.168.x.x. And I am pulling data from the controller to my computer via this ethernet connection. Now, in order to get the data to my VM, I need to expose the ethernet port to my VM which needs to be in the same local subnet as well (192.168.x.x). Not sure how I can achieve that and pull data from the controller to VM?

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.

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

@GUPTARagini-2188 Thank you for reaching out to Microsoft Q&A.

I understand that you want to connect the Azure VM to your machines ethernet connection so you need Azure to also have a Vnet in the 192.168.x.x range. However, this will lead to overlapping address spaces which will not work.

If a VNet has an address space that overlaps with another Azure VNet or on-premises network, the networks cannot be connected, as the routing of traffic will not work properly.

However, to work-around this, you may use a NVA on Azure which can be found on Azure Marketplace and implement a 1:1 NAT. However, please not that this setup is not supported or guaranteed to work but can be tested out to see if this can work for you. Hope this helps.

Please let us know if you have any further questions/concerns. Thank you!

  • Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

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.