Nmcli: Difference between revisions

From ICO wiki
Jump to navigationJump to search
No edit summary
Line 31: Line 31:
       }
       }


==OPTIONS==
=Nmcli kasutamine=
      -t, --terse
 
 
              Output is terse.  This mode is designed and suitable for
              computer (script) processing.
 
      -p, --pretty
 
 
              Output is pretty.  This causes nmcli to produce easy readable
              outputs for humans, i.e. values are aligned, headers are
              printed, etc.
 
      -m, --mode tabular | multiline
 
 
              Switch between tabular and multiline output.  If omitted,
              default is tabular for most commands.  For the commands
              producing more structured information, that cannot be displayed
              on a single line, default is multiline. Currenly, they are:
                'nmcli con list id|uuid <name>'
                'nmcli dev list'
              tabular  - Output is a table where each line describes a single
              entry.  Columns define particular properties of the entry.
              multiline - Each entry comprises more lines, each property on
              its own line.  The values are prefixed with the property name.
 
      -f, --fields <field1,field2,...> | all | common
 
 
              This option is used to specify what fields (column names) should
              be printed.  Valid field names differ for specific commands.
              List available fields by providing an invalid value to the
              --fields option.
              all is used to print all valid field values of the command.
              common is used to print common field values of the command.  If
              omitted, default is common.  The option is mandatory when
              --terse is used.  In this case, generic values all and common
              cannot be used.  (This is to maintain compatibility when new
              fields are added in the future).
 
      -e, --escape yes | no
 
 
              Whether to escape ':' and '\' characters in terse tabular mode.
              The escape character is '\'.  If omitted, default is yes.
 
      -v, --version
 
 
              Show nmcli version.
 
      -h, --help
 
 
              Print help information.

Revision as of 18:17, 27 November 2012

Sissejuhatus

nmcli on käsurea tööriist, mille abil saab kontrollida NetworkManageri ja pärida selle staatust. See ei ole mõeldud asendamiseks mõnda nm-applet või muid sarnaseid programme. Pigem on see mõeldud täiendavaks nendele programmidele. Peamiselt leiab nmcli kasutatavust serverites, iseseisvale masinale või lihtsalt edasijõudnud kasutajatele, kes eelistavad kasutada käsurida.

Erinevaid kasutusviise

1) Initskriptit: ifup / ifdown saab kasutada nmcli kaudu Network managerile ligi pääsemiseks, selle asemel, et hallata ühendusi ise ja segada NetworkManageri tööd.


2) Servereid, peata masinaid, millel puudub graafiline liides, siis kasutatakse nmcli-d et rääkida otse NetworkManageri ja kontrollida kogu süsteemi ühendusi.

3) Kristian Kivimägi A22


Käsu süntaks

      nmcli  [ OPTIONS ] OBJECT { COMMAND | help }
      OBJECT := { nm | con | dev }
      OPTIONS := {
      -t[erse]
      -p[retty]
      -m[mode] tabular | multiline
      -f[ields] <field1,field2,...> | all | common
      -e[scape] yes | no
      -v[ersion]
      -h[elp]
      }

Nmcli kasutamine