question

ScottS-1067 avatar image
0 Votes"
ScottS-1067 asked DSPatrick answered

Hyper-V machines always take host IP

Without setting a local static IP in each machine, the machine will first take the host IP. Even though, I have a) set a static IP in host adapter and in router admin.

My issue with this is that with one particular machine, I cannot set the IP within its adapter (hass.io for Home Assistant). I can only assign such in the router admin. Still, when it starts, it takes my host IP.

How can I stop this from occurring?

msc-virtual-machine-manager
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.

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

Hi,

To avoid any misunderstanding, could you share more details about the problem? For example, what's the environment? SCVMM or pure Hyper-V? If Hyper-V, how did we create the virtual switch? And how did we configure the IP address of the host?
84831-hyper-v-virtual-switch.png

when we convert a physical adapter to a virtual switch, the IP configuration will move to the virtual switch.
84812-hyper-v-virtual-switch-02.png

And for the physical adapter, only Hyper-V Extensible Virtual Switch is left.
84823-hyper-v-virtual-switch-01.png

Besides, what is the guest OS? Linux or Windows? And what does it takes host IP mean? The guest OS occupies the host IP and host IP is lost?

Regards,

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



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.

ScottS-1067 avatar image
0 Votes"
ScottS-1067 answered ScottS-1067 edited

Thanks @AlexZhu-MSFT for the reply. Setup is pure Hyper-V (as I did no other type of setup or configuration). Pardon, I did initially add a screenshot of my virtual adapter, but didn't save. Please see below.

Host OS: Windows Pro x64 2004
Guest OS: Home Assistant hass.io running in a docker... no access to adapter

When the hassio guest VM runs, it takes the host IP. The host remains connected with the same/entered IP, but I cannot reach the hassio guest.

Hyper-V Adapter Setup:
84974-hyperv-adapter.jpg

Host network panel:
84992-win-network-panel.jpg

Host adapter:
84984-adapter-host.jpg

Virtual adapter:
85001-adapter-1.jpg

Bridge (MAC Bridge, LLDP Protocol, Hyper-V Extensible VS checked)
85002-bridge.jpg



hyperv-adapter.jpg (78.0 KiB)
adapter-host.jpg (77.3 KiB)
adapter-1.jpg (26.5 KiB)
bridge.jpg (58.8 KiB)
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

Please 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.

ScottS-1067 avatar image
0 Votes"
ScottS-1067 answered

Interestingly enough, I've started my hassio VM multiple times and it now is using the correct IP. I don't get it.

Below is a screenshot of both. Note, for hassio, the screen you see is the only screen I have showing the IP.

Host:
85031-host-ip.jpg

HASSIO VM:
85041-ha-vm.jpg



host-ip.jpg (202.8 KiB)
ha-vm.jpg (57.7 KiB)
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

Ok, this must be some problem or anomaly with the operating system (home assistant) This would never happen with a windows guest. Either avoid the issue by setting a static address or I'd try asking for assistance on this one in their forums located here.
https://community.home-assistant.io/

--please don't forget to 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.

ScottS-1067 avatar image
0 Votes"
ScottS-1067 answered ScottS-1067 published

I discovered a means of setting a static IP for HA via the below article.

However, the issue still persists, and it's not an isolated case with the HA code. For a test, I created a Ubuntu-based VM, set a static IP in the router using the MAC I created in the Virtual adapter for the VM and same thing. When it starts, it will typically take the IP of the host. It's not until I set a static IP in the guest OS that it will boot and connect using the proper IP.

I must have an incorrect host setting related to the adapters that is causing this.

HA static IP article: https://tech.borpin.co.uk/2018/10/18/using-nmcli-to-set-a-static-ipv4-address-in-hass-io/


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

it will typically take the IP of the host

It will get whatever the DHCP server hands out. What are you using for DHCP?

set a static IP in the router using the MAC

Sounds like something problematic with the hardware or configuration. I'd try asking the vendor about this issue.


--please don't forget to 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.