Gappa Gappa - 1 year ago 719
Linux Question

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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download