Search code examples
linuxqtgateway

how to get the network gateway address in Qt?


how to get the network gateway address in Qt?(linux)

I'm trying to get the gateway using the standard Qt library. I'm playing with QHostAddress, QNetworkInterface and so on but I cannot extract the gateway.

Do you have any idea?


Solution

  • I have parsed the route -n command to get the default gateway.