Azure Sphere Application API - How to read the current default gateway.

James Higgins 336 Reputation points
2021-08-11T15:36:05.267+00:00

Our application requires that IP address of the active default gateway be displayed to the end user.

Please provide an C language example of how to read the active default gateway IP address from the Sphere Application context.

Azure Sphere
Azure Sphere
An Azure internet of things security solution including hardware, operating system, and cloud components.
167 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,271 Reputation points
    2021-08-13T00:05:38.65+00:00

    Hello @James Higgins Maybe the below response is helpful, which was posted a few months ago.? but the below post only talks about the MAC address, I have to check on the gateway details.

    https://learn.microsoft.com/en-us/answers/questions/44265/get-wifi-mac-address-using-api-on-azure-sphere.html

    May be this SO post help: https://stackoverflow.com/questions/29249665/how-to-get-gateway-ip-and-nameserver-ip-using-ioctl-in-linux?noredirect=1&lq=1


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.