You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,7 +47,7 @@ For a device to act as a gateway, it needs to securely connect to its downstream
47
47
48
48
<!-- 1.1 -->
49
49
:::moniker range="iotedge-2018-06"
50
-
A downstream device can be any application or platform that has an identity created with the [Azure IoT Hub](../iot-hub/index.yml) cloud service. These applications often use the [Azure IoT device SDK](../iot-hub/iot-hub-devguide-sdks.md). A downstream device could even be an application running on the IoT Edge gateway device itself. However, an IoT Edge device cannot be downstream of an IoT Edge gateway.
50
+
A downstream device can be any application or platform that has an identity created with the [Azure IoT Hub](../iot-hub/index.yml) cloud service. These applications often use the [Azure IoT device SDK](../iot-hub/iot-hub-devguide-sdks.md). A downstream device could even be an application running on the IoT Edge gateway device itself. However, an IoT Edge device can't be downstream of an IoT Edge gateway.
51
51
:::moniker-end
52
52
<!-- end 1.1 -->
53
53
@@ -66,9 +66,22 @@ The following steps walk you through the process of creating the certificates an
66
66
67
67
## Prerequisites
68
68
69
+
# [IoT Edge](#tab/iotedge)
70
+
69
71
A Linux or Windows device with IoT Edge installed.
70
72
71
-
If you do not have a device ready, you can create one in an Azure virtual machine. Follow the steps in [Deploy your first IoT Edge module to a virtual Linux device](quickstart-linux.md) to create an IoT Hub, create a virtual machine, and configure the IoT Edge runtime.
73
+
If you don't have a device ready, you can create one in an Azure virtual machine. Follow the steps in [Deploy your first IoT Edge module to a virtual Linux device](quickstart-linux.md) to create an IoT Hub, create a virtual machine, and configure the IoT Edge runtime.
74
+
75
+
# [IoT Edge for Linux on Windows](#tab/eflow)
76
+
77
+
>[!WARNING]
78
+
> Because the IoT Edge for Linux on Windows (EFLOW) virtual machine needs to be accessible from external devices, ensure to deploy EFLOW with an _external_ virtual switch. For more information about EFLOW networking configurations, see [Networking configuration for Azure IoT Edge for Linux on Windows](./how-to-configure-iot-edge-for-linux-on-windows-networking.md).
79
+
80
+
A Windows device with IoT Edge for Linux on Windows installed.
81
+
82
+
If you don't have a device ready, you should create one before continuing with this guide. Follow the steps in [Create and provision an IoT Edge for Linux on Windows device using symmetric keys](./how-to-provision-single-device-linux-on-windows-symmetric.md) to create an IoT Hub, create an EFLOW virtual machine, and configure the IoT Edge runtime.
83
+
84
+
---
72
85
73
86
## Set up the device CA certificate
74
87
@@ -89,16 +102,69 @@ Have the following files ready:
89
102
90
103
For production scenarios, you should generate these files with your own certificate authority. For development and test scenarios, you can use demo certificates.
91
104
105
+
### Create demo certificates
106
+
92
107
If you don't have your own certificate authority and want to use demo certificates, follow the instructions in [Create demo certificates to test IoT Edge device features](how-to-create-test-certificates.md) to create your files. On that page, you need to take the following steps:
93
108
94
-
1. To start, set up the scripts for generating certificates on your device.
95
-
2. Create a root CA certificate. At the end of those instructions, you'll have a root CA certificate file:
1. To start, set up the scripts for generating certificates on your device.
110
+
1. Create a root CA certificate. At the end of those instructions, you'll have a root CA certificate file `<path>/certs/azure-iot-test-only.root.ca.cert.pem`.
111
+
1. Create IoT Edge device CA certificates. At the end of those instructions, you'll have a device CA certificate `<path>/certs/iot-edge-device-ca-<cert name>-full-chain.cert.pem` its private key `<path>/private/iot-edge-device-ca-<cert name>.key.pem`.
112
+
113
+
### Copy certificates to device
114
+
115
+
# [IoT Edge](#tab/iotedge)
116
+
117
+
If you created the certificates on a different machine, copy them over to your IoT Edge device then proceed with the next steps. You can use a USB drive, a service like [Azure Key Vault](../key-vault/general/overview.md), or with a function like [Secure file copy](https://www.ssh.com/ssh/scp/). Choose one of these methods that best matches your scenario.
118
+
119
+
# [IoT Edge for Linux on Windows](#tab/eflow)
120
+
121
+
Now, you need to copy the certificates to the Azure IoT Edge for Linux on Windows virtual machine.
122
+
123
+
1. Open an elevated _PowerShell_ session by starting with **Run as Administrator**.
124
+
125
+
Connect to the EFLOW virtual machine.
126
+
127
+
```powershell
128
+
Connect-EflowVm
129
+
```
130
+
131
+
1. Create the certificates directory. You can select any writeable directory. For this tutorial, we'll use the _iotedge-user_ home folder.
132
+
133
+
```bash
134
+
cd~
135
+
mkdir certs
136
+
cd certs
137
+
mkdir certs
138
+
mkdir private
139
+
```
140
+
141
+
1. Exit the EFLOW VM connection.
142
+
143
+
```bash
144
+
exit
145
+
```
146
+
147
+
1. Copy the certificates to the EFLOW virtual machine.
100
148
101
-
If you created the certificates on a different machine, copy them over to your IoT Edge device then proceed with the next steps.
1. Invoke the following commands on the EFLOW VM to grant iotedge permissions to the certificate files since `Copy-EflowVMFile` copies files with root only access permissions.
@@ -107,26 +173,32 @@ If you created the certificates on a different machine, copy them over to your I
107
173
108
174
* Windows: `C:\ProgramData\iotedge\config.yaml`
109
175
* Linux: `/etc/iotedge/config.yaml`
176
+
* IoT Edge for Linux on Windows: `/etc/iotedge/config.yaml`
177
+
178
+
>[!TIP]
179
+
> If you are using IoT Edge for Linux on Windows (EFLOW) you'll have to connect to the EFLOW virtual machine and change the file inside the VM. You can connect to the EFLOW VM using the PowerShell cmdlet `Connect-EflowVm` and then use your preferred editor.
110
180
111
181
1. Find the **Certificate settings** section of the file. Uncomment the four lines starting with **certificates:** and provide the file URIs to your three files as values for the following properties:
112
182
***device_ca_cert**: device CA certificate
113
183
***device_ca_pk**: device CA private key
114
184
***trusted_ca_certs**: root CA certificate
115
185
116
-
Make sure there is no preceding whitespace on the **certificates:** line, and that the other lines are indented by two spaces.
186
+
Make sure there's no preceding whitespace on the **certificates:** line, and that the other lines are indented by two spaces.
117
187
118
188
1. Save and close the file.
119
189
120
190
1. Restart IoT Edge.
121
191
* Windows: `Restart-Service iotedge`
122
192
* Linux: `sudo systemctl restart iotedge`
193
+
* IoT Edge for Linux on Windows: `sudo systemctl restart iotedge`
194
+
123
195
:::moniker-end
124
196
<!-- end 1.1 -->
125
197
126
198
<!-- iotedge-2020-11 -->
127
199
:::moniker range=">=iotedge-2020-11"
128
200
129
-
1. On your IoT Edge device, open the config file: `/etc/aziot/config.toml`
201
+
1. On your IoT Edge device, open the config file: `/etc/aziot/config.toml`. If you're using IoT Edge for Linux on Windows, you'll have to connect to the EFLOW virtual machine using the `Connect-EflowVm` PowerShell cmdlet.
130
202
131
203
>[!TIP]
132
204
>If the config file doesn't exist on your device yet, then use `/etc/aziot/config.toml.edge.template` as a template to create one.
@@ -194,14 +266,43 @@ To deploy the IoT Edge hub module and configure it with routes to handle incomin
194
266
195
267
Standard IoT Edge devices don't need any inbound connectivity to function, because all communication with IoT Hub is done through outbound connections. Gateway devices are different because they need to receive messages from their downstream devices. If a firewall is between the downstream devices and the gateway device, then communication needs to be possible through the firewall as well.
196
268
197
-
For a gateway scenario to work, at least one of the IoT Edge hub's supported protocols must be open for inbound traffic from downstream devices. The supported protocols are MQTT, AMQP, HTTPS, MQTT over WebSockets, and AMQP over WebSockets.
269
+
# [IoT Edge](#tab/iotedge)
270
+
271
+
For a gateway scenario to work, at least one of the IoT Edge Hub's supported protocols must be open for inbound traffic from downstream devices. The supported protocols are MQTT, AMQP, HTTPS, MQTT over WebSockets, and AMQP over WebSockets.
198
272
199
273
| Port | Protocol |
200
274
| ---- | -------- |
201
275
| 8883 | MQTT |
202
276
| 5671 | AMQP |
203
277
| 443 | HTTPS <br> MQTT+WS <br> AMQP+WS |
204
278
279
+
# [IoT Edge for Linux on Windows](#tab/eflow)
280
+
281
+
For a gateway scenario to work, at least one of the IoT Edge Hub's supported protocols must be open for inbound traffic from downstream devices. The supported protocols are MQTT, AMQP, HTTPS, MQTT over WebSockets, and AMQP over WebSockets.
282
+
283
+
| Port | Protocol |
284
+
| ---- | -------- |
285
+
| 8883 | MQTT |
286
+
| 5671 | AMQP |
287
+
| 443 | HTTPS <br> MQTT+WS <br> AMQP+WS |
288
+
289
+
Finally, you must open the EFLOW virtual machine ports. You can open the three ports mentioned above using the following PowerShell cmdlets.
Invoke-EflowVmCommand "sudo iptables-save | sudo tee /etc/systemd/scripts/ip4save"
303
+
```
304
+
---
305
+
205
306
## Next steps
206
307
207
308
Now that you have an IoT Edge device set up as a transparent gateway, you need to configure your downstream devices to trust the gateway and send messages to it. Continue on to [Authenticate a downstream device to Azure IoT Hub](how-to-authenticate-downstream-device.md) for the next steps in setting up your transparent gateway scenario.
0 commit comments