1NETWORKMANAGER-DISPATCHER(8N)etwork management daemonNsETWORKMANAGER-DISPATCHER(8)
2
3
4
6 NetworkManager-dispatcher - Dispatch user scripts for NetworkManager
7
9 NetworkManager [OPTIONS...]
10
12 NetworkManager-dispatcher service is a D-Bus activated service that
13 runs user provided scripts upon certain changes in NetworkManager.
14
15 NetworkManager-dispatcher will execute scripts in the
16 /{etc,usr/lib}/NetworkManager/dispatcher.d directory or subdirectories
17 in alphabetical order in response to network events. Each script should
18 be a regular executable file owned by root. Furthermore, it must not be
19 writable by group or other, and not setuid.
20
21 Each script receives two arguments, the first being the interface name
22 of the device an operation just happened on, and second the action. For
23 device actions, the interface is the name of the kernel interface
24 suitable for IP configuration. Thus it is either VPN_IP_IFACE,
25 DEVICE_IP_IFACE, or DEVICE_IFACE, as applicable. For the hostname
26 action the device name is always "none" and for connectivity-change it
27 is empty.
28
29 The actions are:
30
31 pre-up
32 The interface is connected to the network but is not yet fully
33 activated. Scripts acting on this event must be placed or symlinked
34 into the /etc/NetworkManager/dispatcher.d/pre-up.d directory, and
35 NetworkManager will wait for script execution to complete before
36 indicating to applications that the interface is fully activated.
37
38 up
39 The interface has been activated.
40
41 pre-down
42 The interface will be deactivated but has not yet been disconnected
43 from the network. Scripts acting on this event must be placed or
44 symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d
45 directory, and NetworkManager will wait for script execution to
46 complete before disconnecting the interface from its network. Note
47 that this event is not emitted for forced disconnections, like when
48 carrier is lost or a wireless signal fades. It is only emitted when
49 there is an opportunity to cleanly handle a network disconnection
50 event.
51
52 down
53 The interface has been deactivated.
54
55 vpn-pre-up
56 The VPN is connected to the network but is not yet fully activated.
57 Scripts acting on this event must be placed or symlinked into the
58 /etc/NetworkManager/dispatcher.d/pre-up.d directory, and
59 NetworkManager will wait for script execution to complete before
60 indicating to applications that the VPN is fully activated.
61
62 vpn-up
63 A VPN connection has been activated.
64
65 vpn-pre-down
66 The VPN will be deactivated but has not yet been disconnected from
67 the network. Scripts acting on this event must be placed or
68 symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d
69 directory, and NetworkManager will wait for script execution to
70 complete before disconnecting the VPN from its network. Note that
71 this event is not emitted for forced disconnections, like when the
72 VPN terminates unexpectedly or general connectivity is lost. It is
73 only emitted when there is an opportunity to cleanly handle a VPN
74 disconnection event.
75
76 vpn-down
77 A VPN connection has been deactivated.
78
79 hostname
80 The system hostname has been updated. Use gethostname(2) to
81 retrieve it. The interface name (first argument) is empty and no
82 environment variable is set for this action.
83
84 dhcp4-change
85 The DHCPv4 lease has changed (renewed, rebound, etc).
86
87 dhcp6-change
88 The DHCPv6 lease has changed (renewed, rebound, etc).
89
90 connectivity-change
91 The network connectivity state has changed (no connectivity, went
92 online, etc).
93
94 reapply
95 The connection was reapplied on the device.
96
97 The environment contains more information about the interface and the
98 connection. The following variables are available for the use in the
99 dispatcher scripts:
100
101 NM_DISPATCHER_ACTION
102 The dispatcher action like "up" or "dhcp4-change", identical to the
103 first command line argument. Since NetworkManager 1.12.0.
104
105 CONNECTION_UUID
106 The UUID of the connection profile.
107
108 CONNECTION_ID
109 The name (ID) of the connection profile.
110
111 CONNECTION_DBUS_PATH
112 The NetworkManager D-Bus path of the connection.
113
114 CONNECTION_FILENAME
115 The backing file name of the connection profile (if any).
116
117 CONNECTION_EXTERNAL
118 If "1", this indicates that the connection describes a network
119 configuration created outside of NetworkManager.
120
121 DEVICE_IFACE
122 The interface name of the control interface of the device.
123 Depending on the device type, this differs from DEVICE_IP_IFACE.
124 For example for ADSL devices, this could be 'atm0' or for WWAN
125 devices it might be 'ttyUSB0'.
126
127 DEVICE_IP_IFACE
128 The IP interface name of the device. This is the network interface
129 on which IP addresses and routes will be configured.
130
131 IP4_ADDRESS_N
132 The IPv4 address in the format "address/prefix gateway", where N is
133 a number from 0 to (# IPv4 addresses - 1). gateway item in this
134 variable is deprecated, use IP4_GATEWAY instead.
135
136 IP4_NUM_ADDRESSES
137 The variable contains the number of IPv4 addresses the script may
138 expect.
139
140 IP4_GATEWAY
141 The gateway IPv4 address in traditional numbers-and-dots notation.
142
143 IP4_ROUTE_N
144 The IPv4 route in the format "address/prefix next-hop metric",
145 where N is a number from 0 to (# IPv4 routes - 1).
146
147 IP4_NUM_ROUTES
148 The variable contains the number of IPv4 routes the script may
149 expect.
150
151 IP4_NAMESERVERS
152 The variable contains a space-separated list of the DNS servers.
153
154 IP4_DOMAINS
155 The variable contains a space-separated list of the search domains.
156
157 DHCP4_<dhcp-option-name>
158 If the connection used DHCP for address configuration, the received
159 DHCP configuration is passed in the environment using standard DHCP
160 option names, prefixed with "DHCP4_", like
161 "DHCP4_HOST_NAME=foobar".
162
163 IP6_<name> and DHCP6_<name>
164 The same variables as for IPv4 are available for IPv6, but the
165 prefixes are IP6_ and DHCP6_ instead.
166
167 CONNECTIVITY_STATE
168 The network connectivity state, which can take the values defined
169 by the NMConnectivityState type, from the
170 org.freedesktop.NetworkManager D-Bus API: UNKNOWN, NONE, PORTAL,
171 LIMITED or FULL. Note: this variable will only be set for
172 connectivity-change actions.
173
174 In case of VPN, VPN_IP_IFACE is set, and IP4_*, IP6_* variables with
175 VPN prefix are exported too, like VPN_IP4_ADDRESS_0,
176 VPN_IP4_NUM_ADDRESSES.
177
178 Dispatcher scripts are run one at a time, but asynchronously from the
179 main NetworkManager process, and will be killed if they run for too
180 long. If your script might take arbitrarily long to complete, you
181 should spawn a child process and have the parent return immediately.
182 Scripts that are symbolic links pointing inside the
183 /etc/NetworkManager/dispatcher.d/no-wait.d/ directory are run
184 immediately, without waiting for the termination of previous scripts,
185 and in parallel. Also beware that once a script is queued, it will
186 always be run, even if a later event renders it obsolete. (Eg, if an
187 interface goes up, and then back down again quickly, it is possible
188 that one or more "up" scripts will be run after the interface has gone
189 down.)
190
192 Please report any bugs you find in NetworkManager at the NetworkManager
193 issue tracker[1].
194
196 NetworkManager home page[2], NetworkManager(8),
197
199 1. NetworkManager issue tracker
200 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues
201
202 2. NetworkManager home page
203 https://networkmanager.dev
204
205
206
207NetworkManager-dispatcher 1 NETWORKMANAGER-DISPATCHER(8)