關於「NetworkManager」的操作使用 [論壇 - Ubuntu 與工具程式及軟體推薦]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
延續『#5 回覆: 關於「resolvconf」的操作使用』這篇討論。

以下對「NetworkManager」探索到的部份,簡單做個紀錄。

以下測試環境是「Xubuntu 16.04 amd64 英文界面」。

================================================================================

## Package

* network-manager

================================================================================

## Manpage

執行


$ dpkg -L network-manager | grep '/man/man.*/' | sort



顯示


/usr/share/man/man1/nmcli.1.gz
/usr/share/man/man1/nm-online.1.gz
/usr/share/man/man1/nmtui.1.gz
/usr/share/man/man1/nmtui-connect.1.gz
/usr/share/man/man1/nmtui-edit.1.gz
/usr/share/man/man1/nmtui-hostname.1.gz
/usr/share/man/man5/NetworkManager.conf.5.gz
/usr/share/man/man5/nm-settings.5.gz
/usr/share/man/man5/nm-settings-keyfile.5.gz
/usr/share/man/man5/nm-system-settings.conf.5.gz
/usr/share/man/man7/nmcli-examples.7.gz
/usr/share/man/man8/NetworkManager.8.gz



* man 1 nmcli
* man 1 nm-online
* man 1 nmtui
* man 1 nmtui-connect
* man 1 nmtui-edit
* man 1 nmtui-hostname
* man 5 NetworkManager.conf
* man 5 nm-settings
* man 5 nm-settings-keyfile
* man 5 nm-system-settings.conf
* man 7 nmcli-examples
* man 8 NetworkManager

================================================================================

## service

執行


$ dpkg -L network-manager | grep service



顯示


/usr/share/dbus-1/system-services
/usr/share/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
/lib/systemd/system/NetworkManager-wait-online.service
/lib/systemd/system/NetworkManager-dispatcher.service
/lib/systemd/system/NetworkManager.service
/lib/systemd/system/network-manager.service



## /lib/systemd/system/NetworkManager.service

執行


$ cat /lib/systemd/system/NetworkManager.service



顯示


[Unit]
Description=Network Manager
Documentation=man:NetworkManager(8)
Wants=network.target
After=network-pre.target dbus.service
Before=network.target

[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
#ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload uint32:0
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/sbin/NetworkManager --no-daemon
Restart=on-failure
# NM doesn't want systemd to kill its children for it
KillMode=process
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
ProtectSystem=true
ProtectHome=read-only

[Install]
WantedBy=multi-user.target
Also=NetworkManager-dispatcher.service



## /lib/systemd/system/network-manager.service

執行


$ cat /lib/systemd/system/network-manager.service



顯示


[Unit]
Description=Network Manager
Documentation=man:NetworkManager(8)
Wants=network.target
After=network-pre.target dbus.service
Before=network.target

[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
#ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload uint32:0
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/sbin/NetworkManager --no-daemon
Restart=on-failure
# NM doesn't want systemd to kill its children for it
KillMode=process
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
ProtectSystem=true
ProtectHome=read-only

[Install]
WantedBy=multi-user.target
Also=NetworkManager-dispatcher.service



================================================================================

## init

執行


$ dpkg -L network-manager | grep init



顯示


/etc/init
/etc/init/network-manager.conf
/etc/init.d
/etc/init.d/network-manager



================================================================================

## 更多相關的套件

執行


$ apt-cache showsrc network-manager | grep '^Binary:' -B 1



顯示


Package: network-manager
Binary: network-manager, network-manager-dev, libnm-glib4, libnm-glib-dev, libnm-glib-vpn1, libnm-glib-vpn-dev, libnm-util2, libnm-util-dev, libnm0, libnm-dev, gir1.2-networkmanager-1.0



================================================================================

執行


$ dpkg -l '*network-manager*'



顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-======
ii network-manager 1.2.6-0ubuntu0.16.0 amd64 network management framework (daemon and userspace tools)
ii network-manager-gnome 1.2.6-0ubuntu0.16.0 amd64 network management framework (GNOME frontend)
un network-manager-kde <none> <none> (no description available)
un network-manager-openconnect <none> <none> (no description available)
un network-manager-openconnect-g <none> <none> (no description available)
ii network-manager-openvpn 1.1.93-1ubuntu1.1 amd64 network management framework (OpenVPN plugin core)
un network-manager-openvpn-gnome <none> <none> (no description available)
ii network-manager-pptp 1.1.93-1ubuntu1 amd64 network management framework (PPTP plugin core)
ii network-manager-pptp-gnome 1.1.93-1ubuntu1 amd64 network management framework (PPTP plugin GNOME GUI)
un network-manager-vpnc <none> <none> (no description available)
un network-manager-vpnc-gnome <none> <none> (no description available)



================================================================================

執行


$ dpkg -l '*libnm*'



顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-======
ii libnm-glib-vpn1:amd64 1.2.6-0ubuntu0.16.0 amd64 network management framework (GLib VPN shared library)
ii libnm-glib4:amd64 1.2.6-0ubuntu0.16.0 amd64 network management framework (GLib shared library)
ii libnm-gtk-common 1.2.6-0ubuntu0.16.0 all library for wireless and mobile dialogs - common files
ii libnm-gtk0:amd64 1.2.6-0ubuntu0.16.0 amd64 library for wireless and mobile dialogs (libnm-glib version)
ii libnm-util2:amd64 1.2.6-0ubuntu0.16.0 amd64 network management framework (shared library)
ii libnm0:amd64 1.2.6-0ubuntu0.16.0 amd64 GObject-based client library for NetworkManager
ii libnma-common 1.2.6-0ubuntu0.16.0 all library for wireless and mobile dialogs - common files
ii libnma0:amd64 1.2.6-0ubuntu0.16.0 amd64 library for wireless and mobile dialogs (libnm version)



================================================================================

待續...

10/6 15:18:35
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
這篇的用法可以對照參考「#2 回覆: 請問mysqld問題」的說明。

================================================================================

## usage

執行


$ /etc/init.d/network-manager



顯示


Usage: /etc/init.d/network-manager {start|stop|restart|force-reload|status}



執行


$ service network-manager



顯示


Usage: /etc/init.d/network-manager {start|stop|restart|force-reload|status}



================================================================================

## status

執行


$ /etc/init.d/network-manager status



或是執行


$ service network-manager status



或是執行


$ systemctl status network-manager.service



會看到類似下面的訊息


● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-10-04 15:07:55 CST; 11min ago
     Docs: man:NetworkManager(8)
 Main PID: 1121 (NetworkManager)
   CGroup: /system.slice/NetworkManager.service
           ├─1121 /usr/sbin/NetworkManager --no-daemon
           ├─1334 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /var/run/dhclient-enp4s0.pid -lf /var/lib/NetworkManager/
           └─1374 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pi

Oct 04 15:08:02 my-host-name dnsmasq[1374]: started, version 2.75 cache disabled
Oct 04 15:08:02 my-host-name dnsmasq[1374]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DN
Oct 04 15:08:02 my-host-name dnsmasq[1374]: DBus support enabled: connected to system bus
Oct 04 15:08:02 my-host-name dnsmasq[1374]: warning: no upstream servers configured
Oct 04 15:08:02 my-host-name NetworkManager[1121]: <info>  [1507100882.9787] device (enp4s0): Activation: successful, device activated.
Oct 04 15:08:02 my-host-name NetworkManager[1121]: <info>  [1507100882.9833] dnsmasq[0xf01100]: dnsmasq appeared as :1.19
Oct 04 15:08:02 my-host-name dnsmasq[1374]: setting upstream servers from DBus
Oct 04 15:08:02 my-host-name dnsmasq[1374]: using nameserver 192.168.1.1#53(via enp4s0)
Oct 04 15:08:04 my-host-name NetworkManager[1121]: <info>  [1507100884.4873] manager: startup complete
Oct 04 15:08:19 my-host-name NetworkManager[1121]: <info>  [1507100899.4403] bluez: use BlueZ version 5





執行


$ ps aux | grep NetworkManager



顯示


root 1121 0.0 0.2 452280 16004 ? Ssl 15:07 0:00 /usr/sbin/NetworkManager --no-daemon
root 1334 0.0 0.0 16120 3768 ? S 15:07 0:00 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /var/run/dhclient-enp4s0.pid -lf /var/lib/NetworkManager/dhclient-fc463c66-37c1-4ab7-91ef-aca74daa6c85-enp4s0.lease -cf /var/lib/NetworkManager/dhclient-enp4s0.conf enp4s0
nobody 1374 0.0 0.0 56048 4128 ? S 15:08 0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d



執行


$ pstree -p 1121




NetworkManager(1121)─┬─dhclient(1334)
                     ├─dnsmasq(1374)
                     ├─{gdbus}(1267)
                     └─{gmain}(1265)



================================================================================

## force-reload

執行


$ sudo /etc/init.d/network-manager force-reload



或是執行


$ sudo service network-manager force-reload



這個在「#5 回覆: 關於「resolvconf」的操作使用」有使用到。

並且可以對照下面的「#3」來看。

================================================================================

## restart

執行


$ sudo /etc/init.d/network-manager restart



顯示


[ ok ] Restarting network-manager (via systemctl): network-manager.service.



或是執行


$ sudo service network-manager restart



或是執行


$ sudo systemctl restart network-manager.service



================================================================================

## start

執行


$ sudo /etc/init.d/network-manager start



顯示


[ ok ] Starting network-manager (via systemctl): network-manager.service.



或是執行


$ sudo service network-manager start



或是執行


$ sudo systemctl start network-manager.service



================================================================================

## stop

執行


$ sudo /etc/init.d/network-manager stop



顯示


[ ok ] Stopping network-manager (via systemctl): network-manager.service.



或是執行


$ sudo service network-manager stop



或是執行


$ sudo systemctl stop network-manager.service



================================================================================

待續...

10/6 15:21:21
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
# Reload NetworkManager's configuration

這裡的用法,使用情境,可以用在「#5 回覆: 關於「resolvconf」的操作使用」的「實驗二」。

================================================================================

執行

$ man NetworkManager


可以找到下面這一段說明


SIGNALS
       NetworkManager process handles the following signals:

       SIGHUP
           The signal causes a reload of NetworkManager's configuration. Note that not all configuration parameters can be changed at
           runtime and therefore some changes may be applied only after the next restart of the daemon. A SIGHUP also involves further
           reloading actions, like doing a DNS update and restarting the DNS plugin. The latter can be useful for example when using the
           dnsmasq plugin and changing its configuration in /etc/NetworkManager/dnsmasq.d. However, it also means this will shortly
           interrupt name resolution. In the future, there may be further actions added. A SIGHUP means to update NetworkManager
           configuration and reload everything that is supported. Note that this does not reload connections from disk. For that there is a
           D-Bus API and nmcli's reload action



執行


$ cat /lib/systemd/system/network-manager.service | grep ExecReload



或是執行


$ cat /lib/systemd/system/NetworkManager.service | grep ExecReload



顯示


#ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload uint32:0
ExecReload=/bin/kill -HUP $MAINPID




================================================================================

## 方式一

先執行下面指令,找到「NetworkManager」的「pid」


$ ps aux | grep NetworkManager



顯示


root 1121 0.0 0.2 452280 16004 ? Ssl 15:07 0:00 /usr/sbin/NetworkManager --no-daemon
...略...



執行下面指令,重新載入「NetworkManager」的「configuration」


$ sudo kill -1 1121



或是執行下面指令,重新載入「NetworkManager」的「configuration」


$ sudo kill -HUP 1121



最後執行


$ sudo /etc/init.d/network-manager status



可以看到類似如下面的訊息


...略...
Oct 04 16:46:39 my-host-name NetworkManager[1121]: <info> [1507106799.0357] reload configuration (signal Hangup)...
Oct 04 16:46:39 my-host-name NetworkManager[1121]: <info> [1507106799.0362] config: signal SIGHUP (no changes from disk)
Oct 04 16:46:39 my-host-name NetworkManager[1121]: <info> [1507106799.0362] dns-mgr: Writing DNS information to /sbin/resolvconf
...略...



也可以在「/var/log/syslog」這個檔案,看到類似的「log」。

例如執行


$ tail /var/log/syslog -n 20



可以看到類似如下面的訊息


...略...
Oct 4 16:46:39 my-host-name NetworkManager[1121]: <info> [1507106799.0357] reload configuration (signal Hangup)...
Oct 4 16:46:39 my-host-name NetworkManager[1121]: <info> [1507106799.0362] config: signal SIGHUP (no changes from disk)
Oct 4 16:46:39 my-host-name NetworkManager[1121]: <info> [1507106799.0362] dns-mgr: Writing DNS information to /sbin/resolvconf
...略...



================================================================================

## 方式二

執行下面指令,重新載入「NetworkManager」的「configuration」


$ sudo /etc/init.d/network-manager force-reload



顯示


[ ok ] Reloading network-manager configuration (via systemctl): network-manager.service.



接著執行


$ sudo /etc/init.d/network-manager status



可以看到類似如下面的訊息


...略...
Oct 04 16:54:28 my-host-name systemd[1]: Reloading Network Manager.
Oct 04 16:54:28 my-host-name NetworkManager[1121]: <info> [1507107268.7520] reload configuration (signal Hangup)...
Oct 04 16:54:28 my-host-name NetworkManager[1121]: <info> [1507107268.7524] config: signal SIGHUP (no changes from disk)
Oct 04 16:54:28 my-host-name NetworkManager[1121]: <info> [1507107268.7525] dns-mgr: Writing DNS information to /sbin/resolvconf
Oct 04 16:54:28 my-host-name systemd[1]: Reloaded Network Manager.
...略...



================================================================================

## 方式三

執行下面指令,重新載入「NetworkManager」的「configuration」


$ sudo dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload uint32:0



顯示


method return time=1507107719.119897 sender=:1.142 -> destination=:1.152 serial=288 reply_serial=2



或是執行下面指令,重新載入「NetworkManager」的「configuration」


$ sudo qdbus --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload 0



或是執行下面指令,重新載入「NetworkManager」的「configuration」


$ sudo gdbus call --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager --method org.freedesktop.NetworkManager.Reload 0



最後執行


$ sudo /etc/init.d/network-manager status



可以看到類似如下面的訊息


...略...
Oct 04 17:01:59 my-host-name NetworkManager[1121]: <info> [1507107719.1095] audit: op="reload" arg="0" pid=10143 uid=0 result="success"
Oct 04 17:01:59 my-host-name NetworkManager[1121]: <info> [1507107719.1099] config: signal SIGHUP (no changes from disk)
Oct 04 17:01:59 my-host-name NetworkManager[1121]: <info> [1507107719.1100] dns-mgr: Writing DNS information to /sbin/resolvconf
...略...



================================================================================

...待續...

10/6 15:27:08
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
接下來紀錄,跟「D-Bus」相關的操作,可以對照『回覆: 關於「dnsmasq」的操作使用』的「#3」,「#4」,「#5」。

上面「#3」的「方式三」,也有使用範例。

================================================================================

執行


$ qdbus --system | grep NetworkManager



顯示


org.freedesktop.NetworkManager
org.freedesktop.NetworkManager.dnsmasq



================================================================================

執行


$ qdbus --system org.freedesktop.NetworkManager



顯示


/
/org
/org/freedesktop
/org/freedesktop/NetworkManager
/org/freedesktop/NetworkManager/DHCP4Config
/org/freedesktop/NetworkManager/DHCP4Config/0
/org/freedesktop/NetworkManager/Settings
/org/freedesktop/NetworkManager/Settings/1
/org/freedesktop/NetworkManager/Settings/0
/org/freedesktop/NetworkManager/IP6Config
/org/freedesktop/NetworkManager/IP6Config/2
/org/freedesktop/NetworkManager/IP6Config/1
/org/freedesktop/NetworkManager/AgentManager
/org/freedesktop/NetworkManager/IP4Config
/org/freedesktop/NetworkManager/IP4Config/2
/org/freedesktop/NetworkManager/IP4Config/1
/org/freedesktop/NetworkManager/Devices
/org/freedesktop/NetworkManager/Devices/1
/org/freedesktop/NetworkManager/Devices/0
/org/freedesktop/NetworkManager/ActiveConnection
/org/freedesktop/NetworkManager/ActiveConnection/0



================================================================================

執行


$ qdbus --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager



顯示


signal void org.freedesktop.DBus.Properties.PropertiesChanged(QString interface_name, QVariantMap changed_properties, QStringList invalidated_properties)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
property read QDBusObjectPath org.freedesktop.NetworkManager.ActivatingConnection
property read QList<QDBusObjectPath> org.freedesktop.NetworkManager.ActiveConnections
property read QList<QDBusObjectPath> org.freedesktop.NetworkManager.AllDevices
property read uint org.freedesktop.NetworkManager.Connectivity
property read QList<QDBusObjectPath> org.freedesktop.NetworkManager.Devices
property readwrite QVariantMap org.freedesktop.NetworkManager.GlobalDnsConfiguration
property read uint org.freedesktop.NetworkManager.Metered
property read bool org.freedesktop.NetworkManager.NetworkingEnabled
property read QDBusObjectPath org.freedesktop.NetworkManager.PrimaryConnection
property read QString org.freedesktop.NetworkManager.PrimaryConnectionType
property read bool org.freedesktop.NetworkManager.Startup
property read uint org.freedesktop.NetworkManager.State
property read QString org.freedesktop.NetworkManager.Version
property readwrite bool org.freedesktop.NetworkManager.WimaxEnabled
property read bool org.freedesktop.NetworkManager.WimaxHardwareEnabled
property readwrite bool org.freedesktop.NetworkManager.WirelessEnabled
property read bool org.freedesktop.NetworkManager.WirelessHardwareEnabled
property readwrite bool org.freedesktop.NetworkManager.WwanEnabled
property read bool org.freedesktop.NetworkManager.WwanHardwareEnabled
signal void org.freedesktop.NetworkManager.CheckPermissions()
signal void org.freedesktop.NetworkManager.DeviceAdded(QDBusObjectPath device_path)
signal void org.freedesktop.NetworkManager.DeviceRemoved(QDBusObjectPath device_path)
signal void org.freedesktop.NetworkManager.PropertiesChanged(QVariantMap properties)
signal void org.freedesktop.NetworkManager.StateChanged(uint state)
method QDBusObjectPath org.freedesktop.NetworkManager.ActivateConnection(QDBusObjectPath connection, QDBusObjectPath device, QDBusObjectPath specific_object)
method QDBusObjectPath org.freedesktop.NetworkManager.AddAndActivateConnection({D-Bus type "a{sa{sv}}"} connection, QDBusObjectPath device, QDBusObjectPath specific_object, QDBusObjectPath& active_connection)
method uint org.freedesktop.NetworkManager.CheckConnectivity()
method void org.freedesktop.NetworkManager.DeactivateConnection(QDBusObjectPath active_connection)
method void org.freedesktop.NetworkManager.Enable(bool enable)
method QList<QDBusObjectPath> org.freedesktop.NetworkManager.GetAllDevices()
method QDBusObjectPath org.freedesktop.NetworkManager.GetDeviceByIpIface(QString iface)
method QList<QDBusObjectPath> org.freedesktop.NetworkManager.GetDevices()
method QString org.freedesktop.NetworkManager.GetLogging(QString& domains)
method QMap<QString,QString> org.freedesktop.NetworkManager.GetPermissions()
method void org.freedesktop.NetworkManager.Reload(uint flags)
method void org.freedesktop.NetworkManager.SetLogging(QString level, QString domains)
method void org.freedesktop.NetworkManager.Sleep(bool sleep)
method uint org.freedesktop.NetworkManager.state()



================================================================================

執行


$ qdbus --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.DBus.Introspectable.Introspect



顯示


<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
                      "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.48.2 -->
<node>
  <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
      <arg type="s" name="interface_name" direction="in"/>
      <arg type="s" name="property_name" direction="in"/>
      <arg type="v" name="value" direction="out"/>
    </method>
    <method name="GetAll">
      <arg type="s" name="interface_name" direction="in"/>
      <arg type="a{sv}" name="properties" direction="out"/>
    </method>
    <method name="Set">
      <arg type="s" name="interface_name" direction="in"/>
      <arg type="s" name="property_name" direction="in"/>
      <arg type="v" name="value" direction="in"/>
    </method>
    <signal name="PropertiesChanged">
      <arg type="s" name="interface_name"/>
      <arg type="a{sv}" name="changed_properties"/>
      <arg type="as" name="invalidated_properties"/>
    </signal>
  </interface>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg type="s" name="xml_data" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Peer">
    <method name="Ping"/>
    <method name="GetMachineId">
      <arg type="s" name="machine_uuid" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.NetworkManager">
    <method name="Reload">
      <arg type="u" name="flags" direction="in"/>
    </method>
    <method name="GetDevices">
      <arg type="ao" name="devices" direction="out"/>
    </method>
    <method name="GetAllDevices">
      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_all_devices"/>
      <arg type="ao" name="devices" direction="out"/>
    </method>
    <method name="GetDeviceByIpIface">
      <arg type="s" name="iface" direction="in"/>
      <arg type="o" name="device" direction="out"/>
    </method>
    <method name="ActivateConnection">
      <arg type="o" name="connection" direction="in"/>
      <arg type="o" name="device" direction="in"/>
      <arg type="o" name="specific_object" direction="in"/>
      <arg type="o" name="active_connection" direction="out"/>
    </method>
    <method name="AddAndActivateConnection">
      <arg type="a{sa{sv}}" name="connection" direction="in"/>
      <arg type="o" name="device" direction="in"/>
      <arg type="o" name="specific_object" direction="in"/>
      <arg type="o" name="path" direction="out"/>
      <arg type="o" name="active_connection" direction="out"/>
    </method>
    <method name="DeactivateConnection">
      <arg type="o" name="active_connection" direction="in"/>
    </method>
    <method name="Sleep">
      <arg type="b" name="sleep" direction="in"/>
    </method>
    <method name="Enable">
      <arg type="b" name="enable" direction="in"/>
    </method>
    <method name="GetPermissions">
      <arg type="a{ss}" name="permissions" direction="out"/>
    </method>
    <method name="SetLogging">
      <arg type="s" name="level" direction="in"/>
      <arg type="s" name="domains" direction="in"/>
    </method>
    <method name="GetLogging">
      <arg type="s" name="level" direction="out"/>
      <arg type="s" name="domains" direction="out"/>
    </method>
    <method name="CheckConnectivity">
      <arg type="u" name="connectivity" direction="out"/>
    </method>
    <method name="state">
      <arg type="u" name="state" direction="out"/>
    </method>
    <signal name="CheckPermissions"/>
    <signal name="StateChanged">
      <arg type="u" name="state"/>
    </signal>
    <signal name="PropertiesChanged">
      <arg type="a{sv}" name="properties"/>
    </signal>
    <signal name="DeviceAdded">
      <arg type="o" name="device_path"/>
    </signal>
    <signal name="DeviceRemoved">
      <arg type="o" name="device_path"/>
    </signal>
    <property type="ao" name="Devices" access="read"/>
    <property type="ao" name="AllDevices" access="read"/>
    <property type="b" name="NetworkingEnabled" access="read"/>
    <property type="b" name="WirelessEnabled" access="readwrite"/>
    <property type="b" name="WirelessHardwareEnabled" access="read"/>
    <property type="b" name="WwanEnabled" access="readwrite"/>
    <property type="b" name="WwanHardwareEnabled" access="read"/>
    <property type="b" name="WimaxEnabled" access="readwrite"/>
    <property type="b" name="WimaxHardwareEnabled" access="read"/>
    <property type="ao" name="ActiveConnections" access="read"/>
    <property type="o" name="PrimaryConnection" access="read"/>
    <property type="s" name="PrimaryConnectionType" access="read"/>
    <property type="u" name="Metered" access="read"/>
    <property type="o" name="ActivatingConnection" access="read"/>
    <property type="b" name="Startup" access="read"/>
    <property type="s" name="Version" access="read"/>
    <property type="u" name="State" access="read"/>
    <property type="u" name="Connectivity" access="read"/>
    <property type="a{sv}" name="GlobalDnsConfiguration" access="readwrite"/>
  </interface>
  <node name="AgentManager"/>
  <node name="Settings"/>
  <node name="IP6Config"/>
  <node name="DHCP4Config"/>
  <node name="IP4Config"/>
  <node name="ActiveConnection"/>
  <node name="Devices"/>
</node>



================================================================================

執行


$ qdbus --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Version



顯示


1.2.6



用法請參考「man qdbus」。

================================================================================

執行


$ gdbus call --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager --method org.freedesktop.DBus.Properties.Get org.freedesktop.NetworkManager Version



顯示


(<'1.2.6'>,)



用法請參考「man gdbus」。

================================================================================

執行


$ dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Get string:org.freedesktop.NetworkManager string:Version



顯示


method return time=1507109475.410199 sender=:1.142 -> destination=:1.185 serial=374 reply_serial=2
variant string "1.2.6"



用法請參考「man dbus-send」。

================================================================================


一些範例,也可以在「network-manager」的「Source Package」找到。

執行


$ apt-get source network-manager



然後執行


$ tree network-manager-1.2.6/examples/shell/



顯示


network-manager-1.2.6/examples/shell/
├── active-wifi.sh
├── disconnect-device.sh
├── get-hostname.sh
├── list-devices.sh
├── Makefile.am
├── Makefile.in
├── nm-logging.sh
└── test-get-hostname.sh

0 directories, 8 files



也可以直接連到「GitHub / NetworkManager / examples」觀看。

================================================================================

...待續...

10/6 15:36:57
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
# config

================================================================================

執行


$ NetworkManager -h



顯示


Usage:
NetworkManager [OPTION...]

NetworkManager monitors all network connections and automatically
chooses the best connection to use. It also allows the user to
specify wireless access points which wireless cards in the computer
should associate with.

Help Options:
-h, --help Show help options

Application Options:
-V, --version Print NetworkManager version and exit
-n, --no-daemon Don't become a daemon
--log-level=INFO Log level: one of [TRACE,DEBUG,INFO,WARN,ERR,OFF,KEEP]
--log-domains=PLATFORM,RFKILL,WIFI Log domains separated by ',': any combination of [DEFAULT,PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6, DHCP,PPP,WIFI_SCAN,IP4,IP6,IP,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS, SETTINGS,SUSPEND,CORE,DEVICE,OLPC,INFINIBAND, FIREWALL,ADSL,BOND,VLAN,BRIDGE,DBUS_PROPS,TEAM,CONCHECK,DCB,DISPATCH,AUDIT,SYSTEMD,ALL]
--g-fatal-warnings Make all warnings fatal
-p, --pid-file=/var/run/NetworkManager/NetworkManager.pid Specify the location of a PID file
--state-file=/var/lib/NetworkManager/NetworkManager.state State file location
--run-from-build-dir Run from build directory
--print-config Print NetworkManager configuration and exit
--config=/etc/NetworkManager/NetworkManager.conf Config file location
--config-dir=/etc/NetworkManager/conf.d Config directory location
--system-config-dir=/usr/lib/NetworkManager/conf.d System config directory location
--intern-config=/var/lib/NetworkManager/NetworkManager-intern.conf Internal config file location
--plugins=ifupdown,ibft List of plugins separated by ','
--configure-and-quit Quit after initial configuration
-d, --debug Don't become a daemon, and log to stderr



================================================================================

## print-config

執行


$ NetworkManager --print-config



顯示


# NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf (etc: default-wifi-powersave-on.conf)

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false

[connection]
wifi.powersave=3



================================================================================

執行


$ dpkg -L network-manager | grep conf | sort



顯示


/etc/dbus-1/system.d/nm-dispatcher.conf
/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf
/etc/init/network-manager.conf
/etc/NetworkManager/conf.d
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
/etc/NetworkManager/NetworkManager.conf
/usr/share/doc/network-manager/examples/server.conf
/usr/share/doc/NetworkManager/examples/server.conf
/usr/share/man/man5/NetworkManager.conf.5.gz
/usr/share/man/man5/nm-system-settings.conf.5.gz




可以找到兩個檔案

* /etc/NetworkManager/NetworkManager.conf
* /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

================================================================================

## /etc/NetworkManager/NetworkManager.conf

執行


$ cat /etc/NetworkManager/NetworkManager.conf



顯示


[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false



================================================================================

## /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

執行


$ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf



顯示


[connection]
wifi.powersave = 3



================================================================================

待續...

10/6 15:39:02
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
# nmcli

關於「nmcli」,請參考另一篇「關於「nmcli」的操作使用」。


...待續...

10/6 15:43:40
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
# Dispatcher scripts

================================================================================

執行

$ man NetworkManager

可以找到下面這一段敘述


DISPATCHER SCRIPTS
       NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d directory or subdirectories in alphabetical order in
       response to network events. Each script should be a regular executable file owned by root. Furthermore, it must not be writable by
       group or other, and not setuid.

       Each script receives two arguments, the first being the interface name of the device an operation just happened on, and second the
       action. For device actions, the interface is the name of the kernel interface suitable for IP configuration. Thus it is either
       VPN_IP_IFACE, DEVICE_IP_IFACE, or DEVICE_IFACE, as applicable. For the hostname action it is always "none".

       The actions are:

...略...

       up
           The interface has been activated.

...略...

       down
           The interface has been deactivated.



================================================================================

執行


$ tree /etc/NetworkManager/dispatcher.d/



顯示


/etc/NetworkManager/dispatcher.d/
├── 01ifupdown
├── no-wait.d
├── pre-down.d
└── pre-up.d

3 directories, 1 file




執行


$ dpkg -L network-manager | grep 'dispatcher.d' | sort



顯示


/etc/NetworkManager/dispatcher.d
/etc/NetworkManager/dispatcher.d/01ifupdown
/etc/NetworkManager/dispatcher.d/no-wait.d
/etc/NetworkManager/dispatcher.d/pre-down.d
/etc/NetworkManager/dispatcher.d/pre-up.d



================================================================================

## /etc/NetworkManager/dispatcher.d/01ifupdown

可以簡單做個小實驗,將「echo $@ > /tmp/test.log」這一行,
加入「/etc/NetworkManager/dispatcher.d/01ifupdown」這個檔案。


然後執行


$ nmcli networking



顯示


enabled



執行


$ nmcli networking off



執行


$ cat /tmp/test.log



顯示


enp4s0 down



執行


$ nmcli networking on



執行


$ cat /tmp/test.log



顯示


enp4s0 up




================================================================================

觀看「/etc/NetworkManager/dispatcher.d/01ifupdown」這個檔案,
可以看到下面一段程式碼


...略...
for i in $ADDRESS_FAMILIES; do

    export ADDRFAM="$i"

    # Run the right scripts
    case "$2" in
        up|vpn-up)
            export MODE="start"
            export PHASE="post-up"
            run-parts /etc/network/if-up.d
            ;;
        down|vpn-down)
            export MODE="stop"
            export PHASE="post-down"
            run-parts /etc/network/if-post-down.d
            ;;
...略...





執行


$ grep 'run-parts' /etc/NetworkManager/dispatcher.d/01ifupdown -n



顯示


49: run-parts /etc/network/if-up.d
54: run-parts /etc/network/if-post-down.d
61:# run-parts /etc/network/if-pre-up.d
66:# run-parts /etc/network/if-down.d



可以找到兩個資料夾

* /etc/network/if-up.d
* /etc/network/if-post-down.d

================================================================================

執行


$ dpkg -S /etc/network/if-up.d/



顯示


openssh-server, ifupdown, openvpn, resolvconf, wpasupplicant, ethtool, avahi-daemon, avahi-autoipd: /etc/network/if-up.d



執行


$ dpkg -S /etc/network/if-post-down.d



顯示


$ ifupdown, wpasupplicant, wireless-tools, avahi-daemon: /etc/network/if-post-down.d



================================================================================

執行


$ dpkg -L resolvconf | grep up.d



顯示


/etc/network/if-up.d
/etc/network/if-up.d/000resolvconf
/etc/ppp/ip-up.d
/etc/ppp/ip-up.d/000resolvconf



執行


$ dpkg -L resolvconf | grep down.d



顯示


/etc/network/if-down.d
/etc/network/if-down.d/resolvconf
/etc/ppp/ip-down.d
/etc/ppp/ip-down.d/000resolvconf



================================================================================

...待續...

10/6 15:48:52
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
# 關於「nm-applet」和「nm-connection-editor」

================================================================================

## nm-applet

執行


$ whereis nm-applet



顯示


nm-applet: /usr/bin/nm-applet /usr/share/nm-applet /usr/share/man/man1/nm-applet.1.gz



執行


$ dpkg -S /usr/bin/nm-applet



顯示


network-manager-gnome: /usr/bin/nm-applet



================================================================================

## nm-connection-editor

執行


$ whereis nm-connection-editor



顯示


nm-connection-editor: /usr/bin/nm-connection-editor /usr/share/man/man1/nm-connection-editor.1.gz



執行


$ dpkg -S /usr/bin/nm-connection-editor



顯示


network-manager-gnome: /usr/bin/nm-connection-editor




================================================================================

## bin

執行


$ dpkg -L network-manager-gnome | grep bin



顯示


/usr/bin
/usr/bin/nm-connection-editor
/usr/bin/nm-applet



================================================================================

## man

執行


$ dpkg -L network-manager-gnome | grep '/man/man.*/'



顯示


/usr/share/man/man1/nm-connection-editor.1.gz
/usr/share/man/man1/nm-applet.1.gz



* man 1 nm-applet
* man 1 nm-connection-editor

================================================================================

## autostart

執行


$ dpkg -L network-manager-gnome | grep 'autostart'



顯示


/etc/xdg/autostart
/etc/xdg/autostart/nm-applet.desktop



執行


$ cat /etc/xdg/autostart/nm-applet.desktop



顯示


[Desktop Entry]
Name=Network
Comment=Manage your network connections
Icon=nm-device-wireless
Exec=nm-applet
Terminal=false
Type=Application
NoDisplay=true
NotShowIn=KDE;GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=NetworkManager
X-GNOME-Bugzilla-Component=nm-applet
X-GNOME-UsesNotifications=true
X-Ubuntu-Gettext-Domain=nm-applet



================================================================================

## ui

執行


$ dpkg -L network-manager-gnome | grep 'ui'



顯示


/usr/share/nm-applet/ce-page-vlan.ui
/usr/share/nm-applet/ce-ppp-auth-methods.ui
/usr/share/nm-applet/gsm-unlock.ui
/usr/share/nm-applet/ce-ip4-routes.ui
/usr/share/nm-applet/ws-leap.ui
/usr/share/nm-applet/ce-new-connection.ui
/usr/share/nm-applet/ce-page-general.ui
/usr/share/nm-applet/eap-method-ttls.ui
/usr/share/nm-applet/ce-ip6-routes.ui
/usr/share/nm-applet/eap-method-simple.ui
/usr/share/nm-applet/ce-page-ethernet.ui
/usr/share/nm-applet/ce-page-wifi.ui
/usr/share/nm-applet/ce-page-ip4.ui
/usr/share/nm-applet/ce-page-team.ui
/usr/share/nm-applet/ce-page-ip6.ui
/usr/share/nm-applet/ws-wpa-eap.ui
/usr/share/nm-applet/ce-page-bond.ui
/usr/share/nm-applet/ws-dynamic-wep.ui
/usr/share/nm-applet/eap-method-peap.ui
/usr/share/nm-applet/ce-page-ppp.ui
/usr/share/nm-applet/ce-page-bridge.ui
/usr/share/nm-applet/nm-connection-editor.ui
/usr/share/nm-applet/ws-wep-key.ui
/usr/share/nm-applet/info.ui
/usr/share/nm-applet/ce-page-bridge-port.ui
/usr/share/nm-applet/ce-page-infiniband.ui
/usr/share/nm-applet/ce-page-mobile.ui
/usr/share/nm-applet/eap-method-fast.ui
/usr/share/nm-applet/ce-page-wifi-security.ui
/usr/share/nm-applet/eap-method-tls.ui
/usr/share/nm-applet/ce-page-bluetooth.ui
/usr/share/nm-applet/ce-page-team-port.ui
/usr/share/nm-applet/ws-wpa-psk.ui
/usr/share/nm-applet/eap-method-leap.ui
/usr/share/nm-applet/8021x.ui
/usr/share/nm-applet/ce-page-dsl.ui
/usr/share/nm-applet/ce-page-dcb.ui




執行


$ glade /usr/share/nm-applet/info.ui




================================================================================

## gsettings

執行


$ dpkg -L network-manager-gnome | grep 'glib'



顯示


/usr/share/glib-2.0
/usr/share/glib-2.0/schemas
/usr/share/glib-2.0/schemas/org.gnome.nm-applet.gschema.xml



執行


$ cat /usr/share/glib-2.0/schemas/org.gnome.nm-applet.gschema.xml



顯示


<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
  <schema id="org.gnome.nm-applet" path="/org/gnome/nm-applet/" gettext-domain="nm-applet">
    <key name="disable-connected-notifications" type="b">
      <default>false</default>
      <summary>Disable connected notifications</summary>
      <description>Set this to true to disable notifications when connecting to a network.</description>
    </key>
    <key name="disable-disconnected-notifications" type="b">
      <default>false</default>
      <summary>Disable disconnected notifications</summary>
      <description>Set this to true to disable notifications when disconnecting from a network.</description>
    </key>
    <key name="disable-vpn-notifications" type="b">
      <default>false</default>
      <summary>Disable VPN notifications</summary>
      <description>Set this to true to disable notifications when connecting to or disconnecting from a VPN.</description>
    </key>
    <key name="suppress-wireless-networks-available" type="b">
      <default>false</default>
      <summary>Suppress networks available notifications</summary>
      <description>Set this to true to disable notifications when Wi-Fi networks are available.</description>
    </key>
    <key name="stamp" type="i">
      <default>0</default>
      <summary>Stamp</summary>
      <description>Used to determine whether settings should be migrated to a new version.</description>
    </key>
    <key name="disable-wifi-create" type="b">
      <default>false</default>
      <summary>Disable WiFi Create</summary>
      <description>Set to true to disable creation of adhoc networks when using the applet.</description>
    </key>
    <key name="show-applet" type="b">
      <default>true</default>
      <summary>Show the applet in notification area</summary>
      <description>Set to FALSE to disable displaying the applet in the notification area.</description>
    </key>
  </schema>
  <schema id="org.gnome.nm-applet.eap">
    <key name="ignore-ca-cert" type="b">
      <default>false</default>
      <summary>Ignore CA certificate</summary>
      <description>Set this to true to disable warnings about CA certificates in EAP authentication.</description>
    </key>
    <key name="ignore-phase2-ca-cert" type="b">
      <default>false</default>
      <summary>Ignore CA certificate</summary>
      <description>Set this to true to disable warnings about CA certificates in phase 2 of EAP authentication.</description>
    </key>
  </schema>
</schemalist>



================================================================================

執行


$ gsettings list-schemas | grep nm-applet



顯示


org.gnome.nm-applet



================================================================================

執行


$ gsettings



顯示


Usage:
  gsettings --version
  gsettings [--schemadir SCHEMADIR] COMMAND [ARGS...]

Commands:
  help                      Show this information
  list-schemas              List installed schemas
  list-relocatable-schemas  List relocatable schemas
  list-keys                 List keys in a schema
  list-children             List children of a schema
  list-recursively          List keys and values, recursively
  range                     Queries the range of a key
  get                       Get the value of a key
  set                       Set the value of a key
  reset                     Reset the value of a key
  reset-recursively         Reset all values in a given schema
  writable                  Check if a key is writable
  monitor                   Watch for changes

Use 'gsettings help COMMAND' to get detailed help.



執行


$ gsettings help list-schemas



顯示


Usage:
  gsettings [--schemadir SCHEMADIR] list-schemas

List the installed (non-relocatable) schemas

Arguments:
  SCHEMADIR A directory to search for additional schemas



================================================================================

執行


$ gsettings list-keys org.gnome.nm-applet



顯示


stamp
disable-disconnected-notifications
disable-vpn-notifications
disable-connected-notifications
suppress-wireless-networks-available
show-applet
disable-wifi-create



================================================================================

執行


$ gsettings list-recursively | grep org.gnome.nm-applet



顯示


org.gnome.nm-applet stamp 0
org.gnome.nm-applet disable-disconnected-notifications true
org.gnome.nm-applet disable-vpn-notifications false
org.gnome.nm-applet disable-connected-notifications true
org.gnome.nm-applet suppress-wireless-networks-available false
org.gnome.nm-applet show-applet true
org.gnome.nm-applet disable-wifi-create false



================================================================================

執行


$ gsettings get org.gnome.nm-applet show-applet



顯示


true



================================================================================

執行


$ gsettings set org.gnome.nm-applet show-applet false



執行


$ gsettings get org.gnome.nm-applet show-applet



顯示


false



================================================================================

執行


$ gsettings reset org.gnome.nm-applet show-applet



執行


$ gsettings get org.gnome.nm-applet show-applet



顯示


true



================================================================================

...待續...

10/6 15:54:21
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
# 關於「network-admin」

================================================================================

## network-admin

執行


$ whereis network-admin



顯示


network-admin: /usr/bin/network-admin /usr/share/man/man1/network-admin.1.gz



執行


$ dpkg -S /usr/bin/network-admin



顯示


$ gnome-system-tools: /usr/bin/network-admin



執行


$ apt-cache showsrc gnome-system-tools | grep '^Binary:'



顯示


Package: gnome-system-tools
Binary: gnome-system-tools, gnome-network-admin, gnome-time-admin



執行


$ apt-cache show gnome-system-tools | grep '^Replaces:'



顯示


Replaces: gnome-network-admin (<< 3.0.0-3ubuntu1), gnome-time-admin (<< 3.0.0-3ubuntu1), ximian-setup-tools



執行


$ dpkg -l gnome-system-tools



顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-======
ii gnome-system-tools 3.0.0-4ubuntu2 amd64 Cross-platform configuration utilities for GNOME


顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-======
un gnome-network-admin <none> <none> (no description available)



執行


$ dpkg -l gnome-time-admin



顯示


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-======
un gnome-time-admin <none> <none> (no description available)




================================================================================

## bin

執行


$ dpkg -L gnome-system-tools | grep bin



顯示


/usr/bin
/usr/bin/users-admin
/usr/bin/network-admin
/usr/bin/shares-admin
/usr/bin/time-admin



================================================================================

## man

執行


$ dpkg -L gnome-system-tools | grep '/man/man.*/' | sort



顯示


/usr/share/man/man1/network-admin.1.gz
/usr/share/man/man1/services-admin.1.gz
/usr/share/man/man1/shares-admin.1.gz
/usr/share/man/man1/time-admin.1.gz
/usr/share/man/man1/users-admin.1.gz



================================================================================

## ui

執行


$ dpkg -L gnome-system-tools | grep 'ui' | sort



顯示


/usr/share/gnome-system-tools/ui
/usr/share/gnome-system-tools/ui/common.ui
/usr/share/gnome-system-tools/ui/network.ui
/usr/share/gnome-system-tools/ui/services.ui
/usr/share/gnome-system-tools/ui/shares.ui
/usr/share/gnome-system-tools/ui/time.ui
/usr/share/gnome-system-tools/ui/users.ui



執行


$ glade /usr/share/gnome-system-tools/ui/network.ui



================================================================================

執行


$ apt-get source gnome-system-tools




執行


$ grep 'NetworkManager' gnome-system-tools-3.0.0/* -R -n



顯示


gnome-system-tools-3.0.0/debian/patches/10_disable_interfaces.patch:27:+ if (!g_file_test ("/usr/sbin/NetworkManager", G_FILE_TEST_IS_EXECUTABLE)) {
gnome-system-tools-3.0.0/src/network/ChangeLog:286: with NetworkManager daemon.
gnome-system-tools-3.0.0/src/network/network-tool.c:155: if (!g_file_test ("/usr/sbin/NetworkManager", G_FILE_TEST_IS_EXECUTABLE)) {
gnome-system-tools-3.0.0/src/network/nm-integration.c:24:#define NM_SERVICE "org.freedesktop.NetworkManager"
gnome-system-tools-3.0.0/src/network/nm-integration.c:25:#define NM_PATH "/org/freedesktop/NetworkManager"
gnome-system-tools-3.0.0/src/network/nm-integration.c:26:#define NM_INTERFACE "org.freedesktop.NetworkManager"
gnome-system-tools-3.0.0/src/common/gst-service-role.c:235: { "NetworkManager", GST_ROLE_NETWORK },



================================================================================

暫告一段落

報告完畢


10/6 16:01:04
應用擴展 工具箱
回覆: 關於「NetworkManager」的操作使用
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 33
HP : 160 / 803
MP : 504 / 13098
EXP: 15
離線
剛在重新檢視「network-manager」這個套件
發現有「nmtui」可以使用,以前沒特別去注意使用它,
剛測試了一下,是在「Terminal」下的「圖形界面」工具。

執行


$ dpkg -L network-manager | grep bin | grep nmtui | sort



顯示


/usr/bin/nmtui
/usr/bin/nmtui-connect
/usr/bin/nmtui-edit
/usr/bin/nmtui-hostname




執行


$ dpkg -L network-manager | grep '/man/man.*/' | grep nmtui | sort



顯示


/usr/share/man/man1/nmtui.1.gz
/usr/share/man/man1/nmtui-connect.1.gz
/usr/share/man/man1/nmtui-edit.1.gz
/usr/share/man/man1/nmtui-hostname.1.gz



## Manpage

* $ man nmtui
* $ man nmtui-connect
* $ man nmtui-edit
* $ man nmtui-hostname

簡單的測試了一下,我的理解,「nmtui」是入口,
而「nmtui-edit」是用來維護「連線設定」,也就是「列表」,「新增」,「編輯」,「刪除」。
編輯好後,則是使用「nmtui-connect」來啟用某一個連線。

================================================================================

執行


$ file /usr/bin/nmtui



顯示


/usr/bin/nmtui: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=8853f7f9a276e7f7c285bb6c04c69c0014a6e274, stripped



================================================================================

執行


$ file /usr/bin/nmtui-connect



顯示


/usr/bin/nmtui-connect: symbolic link to nmtui



================================================================================

執行


$ file /usr/bin/nmtui-edit



顯示


/usr/bin/nmtui-edit: symbolic link to nmtui



================================================================================

執行


$ file /usr/bin/nmtui-hostname



顯示


/usr/bin/nmtui-hostname: symbolic link to nmtui



================================================================================

以上提供參考

報告完畢


10/28 9:32:30
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.