Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. how to GATEWAY and DNS Setting? in linux
Forum Updated to NodeBB v4.3 + New Features

how to GATEWAY and DNS Setting? in linux

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
commandlinuxqprocess
2 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForestPoem
    wrote on 12 Jan 2016, 00:38 last edited by ForestPoem 1 Dec 2016, 01:40
    #1

    Hi.

    my system linux.

    how to IP and MASK and GATEWAY and DNS Setting?

    I use the QProccess?

    If so, what should I Command?

    my source code

    QString ip = ui->lineEdit->text();
    QString mask = ui->lineEdit_2->text();
    QString cmd = QString("ifconfig eth0 %1 netmask %2 up").arg(ip,mask);

            QProcess *qProc = new QProcess(this);
            qProc->execute(cmd);
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 12 Jan 2016, 21:26 last edited by
      #2

      Hi,

      First thing, you need to check that you have the rights to call ifconfig.

      Then you can grab the output from QProcess and parse it to get the data you want.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      2/2

      12 Jan 2016, 21:26

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved