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

Select network interface #960

Closed
amitabhmodak opened this issue Apr 18, 2019 · 3 comments
Closed

Select network interface #960

amitabhmodak opened this issue Apr 18, 2019 · 3 comments
Assignees
Labels

Comments

@amitabhmodak
Copy link

amitabhmodak commented Apr 18, 2019

Hi,
I have a device that has a 2 network interface (ppp0 and eth0). I want the Azure IOT agent to connect to the DPS or IOT hub using a specific network interface. Is it supported in the Azure-iot-sdk-c, that the client code can specify which network interface the agent should bind into?

br
Amitabh

@ewertons
Copy link
Contributor

That can be done for the Azure IoT Hub connection on Linux only.
You would use like this:

char* mac_address = "02-15-86-1D-03-AD"; // change this to your network interface mac address.
IoTHubDeviceClient_SetOption(iothub_deviceclient_handle, OPTION_NET_INT_MAC_ADDRESS, mac_address);

You can check this function we have to retrieve the mac addresses, if you need that to be done dynamically.

We haven't verified that for DPS recently, but it should work as well (using the same option name). The APi to use would be:

char* mac_address = "02-15-86-1D-03-AD"; // change this to your network interface mac address.
Prov_Device_LL_SetOption(prov_device_ll_handle, OPTION_NET_INT_MAC_ADDRESS, mac_address);

@ewertons ewertons self-assigned this Apr 18, 2019
@ewertons
Copy link
Contributor

Hi @amitabhmodak ,
we will close this issue for now, but please feel free to reopen it if you would like to follow up.

Thanks,
Azure IoT SDK Team.

@az-iot-builder-01
Copy link
Collaborator

@amitabhmodak, @ewertons, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

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

No branches or pull requests

3 participants