Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an IP address for the eflow VM #14

Closed
Gimly opened this issue Mar 26, 2021 · 15 comments
Closed

Fix an IP address for the eflow VM #14

Gimly opened this issue Mar 26, 2021 · 15 comments
Labels
enhancement New feature or request

Comments

@Gimly
Copy link

Gimly commented Mar 26, 2021

Question Summary
I would like to give the eflow VM (the Linux machine hosted on Hyper-V) a fixed IP address to make it "play nice" with our network structure. Alternatively, is there a way to configure it so that it works as a kind of "NAT" and share the host machine's IP address?

Detailed background
Our IT service wants us to fix the IP address of the eflow VM so that it can have a correct access to the required resources and to the internet. By default the machine gets a DHCP address but it doesn't work correctly with out internal network structure. We therefore need to fix the IP for the VM.

@fcabrera23
Copy link
Contributor

@Gimly ,

Thank you for the detailed question and background. I do not believe this is a scenario that we have implemented so far. We will try to include a way to specify a static IP on our next updates.

@TerryWarwick
Copy link
Contributor

@Gimly,

One change that we are considering is to change the machine name inside the VM to remove the GUID that is appended to the end of the name so that it is predictable. Would simply appending "-EFLOW" to the hose machine name allow it to "play nicer" with your network structure?

Alternatively, as fcabrera23 mentions we can also look into allowing you to specify a static IP address.

Terry Warwick
Microsoft

@Gimly
Copy link
Author

Gimly commented Mar 30, 2021

@TerryWarwick the issue we have with the network is a bit dumb, the Linux VM registers to the DHCP server with the 18 bytes HW-address instead of the more standard MAC address and it doesn't play nice with the DHCP server. The DHCP server is probably too old to manage that kind of things and would require an upgrade which is not easy unfortunately.

We have fixed the issue on our side for now by using the "Default Switch" on hyper-v for the Linux VM.

But being able to change the IP address to a fixed one would also be of great use depending on the network's infrastructure.

@TerryWarwick TerryWarwick added the enhancement New feature or request label Apr 12, 2021
@ngmartins
Copy link

@Gimly,

One change that we are considering is to change the machine name inside the VM to remove the GUID that is appended to the end of the name so that it is predictable. Would simply appending "-EFLOW" to the hose machine name allow it to "play nicer" with your network structure?

Alternatively, as fcabrera23 mentions we can also look into allowing you to specify a static IP address.

Terry Warwick
Microsoft

Is it something you were already implemented?
When I tried EFLOW before this is one of the biggest limitations to our operation: Do not have an predictable host name or a static IP address.

Thanks,

Nuno

@fcabrera23
Copy link
Contributor

fcabrera23 commented Jul 20, 2021

@ngmartins,

As part of the EFLOW GA release, we changed the EFLOW VM host naming. The new naming is generated by the Windows host device name + "-EFLOW". You can check the name of the EFLOW VM following these steps:

  1. Open an elevated PowerShell session
  2. Start an SSH connection to the EFLOW VM using the command Connect-EflowVm
  3. Run the command cat /proc/sys/kernel/hostname to check the hostname.

@fcabrera23
Copy link
Contributor

Hi @Gimly,

We released our latest EFLOW update that supports static IP for ICS Default Switch. For more information on our latest update, check 1.1.2107.0 Release Notes. To set a Static IP, check PowerShell functions for IoT Edge for Linux on Windows.

Thanks,
Francisco

@ngmartins
Copy link

Hello, @fcabrera23 maybe I am missing something very obvious but I wasn't able to access a container web interface using VM_HOSTNAME:port.
VM_IP_ADDRESS:port worked just fine. However, because the IP address is not static use the hostname would be preferable.

@fcabrera23
Copy link
Contributor

Hi @ngmartins,

Have you tried pining the hostname and check the hostname resolution is correct?
Also, we are releasing a new update that supports the static IP this week. Will that work?

Thanks,
Francisco

@fcabrera23 fcabrera23 reopened this Sep 7, 2021
@ngmartins
Copy link

Hello,

I am using the hostame of the EFLOW VM. In fact, by pinging it from the hots machine the address is not resolved.
But at the host machine level, it seems to be the only host that the DNS server isn't able to resolve.
Is this something I need to configure from the VM side?

Use fixed IP would work, but the host is something predictable. Having the chance, the hostname would always be my first choice.

Thanks once again,
Nuno

@fcabrera23
Copy link
Contributor

Hi @ngmartins,

Thanks for your information. I'll look into your issue and will let you know if there's a fix. In the meantime, I would suggest keeping up to date with the latest releases.

Thanks,
Francisco

@Salavertus
Copy link

Salavertus commented Dec 21, 2022

Hello @fcabrera23 , I am having troubles setting an satatic IP address to the Default Switch:

+ FullyQualifiedErrorId : Cannot set Static IP on ICS type virtual switch (Default Switch)

and then

Add-EflowVmEndpoint -vSwitchName "Default Switch" -vEndpointName "EFLOW" -ip4Address "172.17.44.246" -ip4GatewayAddress "255.255.255.240" -ip4PrefixLength "24"

For the installation I have followed the steps in this MS Learn tutorial.

Thank you in advance.

@fcabrera23
Copy link
Contributor

Hi @Salavertus,

The Default Switch does not support Static IP (by design of the virtual switch). For more information, check IoT Edge for Linux on Windows networking.

Thanks,
Francisco

@Salavertus
Copy link

Salavertus commented Dec 21, 2022

Thank you for your fast response, @fcabrera23, I was aware of that limitation but today I read one of your replies more than a year ago:

We released our latest EFLOW update that supports static IP for ICS Default Switch. For more information on our latest update, check 1.1.2107.0 Release Notes. To set a Static IP, check PowerShell functions for IoT Edge for Linux on Windows.

Thanks, Francisco

I'm sure there is something else I don't understand about this, then.

In any case, Is there any way to connect from an IoT Edge module to the host without have an static IP? (I mean If I hardcode the direction and the IP changes that aproximation is not suitable) my plan is to build a C# module that queries an SQL Express DB running in the host (W10 outside que VM) but I am facing a lot of troubles and I cannot find documentation about that use case.

Any help would be very apreciated since I'm a bit lost now for days already. Maybe I should open a new issue or something?

Thank you in advance,
Álvaro.

@fcabrera23
Copy link
Contributor

Hi @Salavertus,

Thanks for the reference, but that seems to be quite old version and we removed that in newer versions. If you are using Default Switch, you can use the EFLOW hostname + "mshome.net". So, if you're Windows host OS hostname is "DESKTOP-TEST", then the EFLOW VM hostname will be "DESKTOP-TEST-EFLOW", and you can use the full address to ping the IP, like "DESKTOP-TEST-EFLOW.mshome.net".

Thanks,
Francisco

@Salavertus
Copy link

Perfect, @fcabrera23. I think it can work.

Since I need to connect to an SQL DB in the W10 host, my custom module should retrieve the EFLOW hostname and then remove the "-EFLOW" part and add the ".mshome.net" and I should be able to query my local Database from the Edge module.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants