Skip to content

Commit 65297fd

Browse files
authored
Merge pull request #204523 from fcabrera23/eflow-multiple-nic
Add How-To Multiple NICS EFLOW
2 parents 82a7fc4 + bc02f8e commit 65297fd

File tree

6 files changed

+115
-0
lines changed

6 files changed

+115
-0
lines changed

articles/iot-edge/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@
219219
href: gpu-acceleration.md
220220
- name: Configure networking
221221
href: how-to-configure-iot-edge-for-linux-on-windows-networking.md
222+
- name: Configure multiple NICs
223+
href: how-to-configure-multiple-nics.md
222224
- name: Develop custom modules
223225
items:
224226
- name: Develop with Visual Studio 2022
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: Configure multiple NICs for Azure IoT Edge for Linux on Windows | Microsoft Docs
3+
description: Configuration for attaching multiple network interfaces to Azure IoT Edge for Linux on Windows virtual machine
4+
author: PatAltimore
5+
ms.reviewer: fcabrera
6+
ms.service: iot-edge
7+
services: iot-edge
8+
ms.topic: conceptual
9+
ms.date: 07/12/2022
10+
ms.author: patricka
11+
---
12+
13+
# Azure IoT Edge for Linux on Windows virtual multiple NIC configurations
14+
15+
[!INCLUDE [iot-edge-version-all-supported](../../includes/iot-edge-version-all-supported.md)]
16+
17+
By default, the Azure IoT Edge for Linux on Windows (EFLOW) virtual machine has a single network interface card (NIC) assigned. However, you can configure the EFLOW VM with multiple network interfaces by using the EFLOW support for attaching multiple network interfaces to the virtual machine. This functionality may be helpful in numerous scenarios where you may have a networking division or separation into different networks or zones. In order to connect the EFLOW virtual machine to the different networks, you may need to attach different network interface cards to the EFLOW virtual machine.
18+
19+
This article describes how to configure the Azure IoT Edge for Linux on Windows VM to support multiple NICs and connect to multiple networks. This process is divided into the following steps:
20+
21+
- Create and assign a virtual switch
22+
- Create and assign a network endpoint
23+
- Check the VM network configurations
24+
25+
For more information about networking concepts and configurations, see [Azure IoT Edge for Linux on Windows Networking](./iot-edge-for-linux-on-windows-networking.md) and [How to configure Azure IoT Edge for Linux on Windows networking](./how-to-configure-iot-edge-for-linux-on-windows-networking.md).
26+
27+
## Prerequisites
28+
- A Windows device with EFLOW already set up. For more information on EFLOW installation and configuration, see [Create and provision an IoT Edge for Linux on Windows device using symmetric keys](./how-to-provision-single-device-linux-on-windows-symmetric.md).
29+
- Virtual switch different from the default one used during EFLOW installation. For more information on creating a virtual switch, see [Create a virtual switch for Azure IoT Edge for Linux on Windows](./how-to-create-virtual-switch.md).
30+
31+
## Create and assign a virtual switch
32+
During the EFLOW VM deployment, the VM had a switched assigned for all the communications between the Windows host OS and the virtual machine. This will always be the switch used for VM lifecycle management communications, and it's not possible to delete it.
33+
34+
The following steps in this section show how to assign a network interface to the EFLOW virtual machine. Ensure that the virtual switch being used and the networking configuration aligns with your networking environment. For more information about networking concepts like type of switches, DHCP and DNS, see [Azure IoT Edge for Linux on Windows networking](./iot-edge-for-linux-on-windows-networking.md).
35+
36+
1. Open an elevated _PowerShell_ session by starting with **Run as Administrator**.
37+
38+
1. Check the virtual switch to be assigned to the EFLOW VM is available.
39+
```powershell
40+
Get-VMSwitch -Name "{switchName}" -SwitchType {switchType}
41+
```
42+
1. Assign the virtual switch to the EFLOW VM.
43+
```powershell
44+
Add-EflowNetwork -vSwitchName "{switchName}" -vSwitchType {switchType}
45+
```
46+
For example, if you wanted to assign the external virtual switch named **OnlineExt**, you should use the following command
47+
```powershell
48+
Add-EflowNetwork -vSwitchName "OnlineExt" -vSwitchType "External"
49+
```
50+
:::image type="content" source="./media/how-to-configure-multiple-nics/ps-cmdlet-add-eflow-network.png" alt-text="EFLOW attach virtual switch":::
51+
52+
1. Check that the virtual switch was correctly assigned to the EFLOW VM.
53+
```powershell
54+
Get-EflowNetwork -vSwitchName "{switchName}"
55+
```
56+
57+
For more information about attaching a virtual switch to the EFLOW VM, see [PowerShell functions for Azure IoT Edge for Linux on Windows](./reference-iot-edge-for-linux-on-windows-functions.md).
58+
59+
60+
## Create and assign a network endpoint
61+
Once the virtual switch was successfully assigned to the EFLOW VM, you need to create a networking endpoint assigned to virtual switch to finalize the network interface creation. If you're using Static IP, ensure to use the appropriate parameters: _ip4Address_, _ip4GatewayAddress_ and _ip4PrefixLength_.
62+
63+
1. Open an elevated _PowerShell_ session by starting with **Run as Administrator**.
64+
65+
1. Create the EFLOW VM network endpoint
66+
67+
- If you're using DHCP, no Static IP parameters are needed.
68+
```powershell
69+
Add-EflowVmEndpoint -vSwitchName "{switchName}" -vEndpointName "{EndpointName}"
70+
```
71+
72+
- If you're using Static IP
73+
```powershell
74+
Add-EflowVmEndpoint -vSwitchName "{switchName}" -vEndpointName "{EndpointName}" -ip4Address "{staticIp4Address}" -ip4GatewayAddress "{gatewayIp4Address}" -ip4PrefixLength "{prefixLength}"
75+
```
76+
77+
For example, if you wanted to create and assign the **OnlineEndpoint** endpoint with the external virtual switch named **OnlineExt**, and Static IP configurations (_ip4Address=192.168.0.103, ip4GatewayAddress=192.168.0.1, ip4PrefixLenght=24_) you should use the following command:
78+
```powershell
79+
Add-EflowVmEndpoint -vSwitchName "OnlineExt" -vEndpointName "OnlineEndpoint" -ip4Address "192.168.0.103" -ip4GatewayAddress "192.168.0.1" -ip4PrefixLength "24"
80+
```
81+
82+
:::image type="content" source="./media/how-to-configure-multiple-nics/ps-cmdlet-add-eflow-endpoint.png" alt-text="EFLOW attach network endpoint":::
83+
84+
1. Check that the network endpoint was correctly created and assigned to the EFLOW VM. You should see the two network interfaces assigned to the virtual machine.
85+
```powershell
86+
Get-EflowVmEndpoint
87+
```
88+
:::image type="content" source="./media/how-to-configure-multiple-nics/ps-cmdlet-get-eflow-vm-endpoint.png" alt-text="EFLOW get attached network interfaces":::
89+
90+
91+
For more information about creating and attaching a network endpoint to the EFLOW VM, see [PowerShell functions for Azure IoT Edge for Linux on Windows](./reference-iot-edge-for-linux-on-windows-functions.md).
92+
93+
94+
## Check the VM network configurations
95+
The final step is to make sure the networking configurations were applied correctly and the EFLOW VM has the new network interface configured. The new interface will show up as _"eth1"_ if it's the first extra interface added to the VM.
96+
97+
1. Open PowerShell in an elevated session. You can do so by opening the **Start** pane on Windows and typing in "PowerShell". Right-click the **Windows PowerShell** app that shows up and select **Run as administrator**.
98+
99+
1. Connect to the EFLOW VM.
100+
```powershell
101+
Connect-EflowVm
102+
```
103+
1. Once inside the VM, check the network interfaces and their configurations using the _ifconfig_ command.
104+
```bash
105+
ifconfig
106+
```
107+
108+
The default interface **eth0** is the one used for all the VM management. You should see another interface, like **eth1**, which is the new interface that was assigned to the VM. Following the examples above, if you previously assigned a new endpoint with the static IP 192.168.0.103 you should see the interface **eth1** with the _inet addr: 192.168.0.103_.
109+
110+
![EFLOW VM network interfaces](./media/how-to-configure-multiple-nics/ps-cmdlet-eflow-ifconfig.png)
111+
112+
## Next steps
113+
Follow the steps in [How to configure networking for Azure IoT Edge for Linux on Windows](./how-to-configure-iot-edge-for-linux-on-windows-networking.md) to make sure all the networking configurations were applied correctly.
364 KB
Loading
191 KB
Loading
83.9 KB
Loading
47.9 KB
Loading

0 commit comments

Comments
 (0)