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 The environment contains more information about the interface and the
95 connection. The following variables are available for the use in the
96 dispatcher scripts:
97
98 NM_DISPATCHER_ACTION
99 The dispatcher action like "up" or "dhcp4-change", identical to the
100 first command line argument. Since NetworkManager 1.12.0.
101
102 CONNECTION_UUID
103 The UUID of the connection profile.
104
105 CONNECTION_ID
106 The name (ID) of the connection profile.
107
108 CONNECTION_DBUS_PATH
109 The NetworkManager D-Bus path of the connection.
110
111 CONNECTION_FILENAME
112 The backing file name of the connection profile (if any).
113
114 CONNECTION_EXTERNAL
115 If "1", this indicates that the connection describes a network
116 configuration created outside of NetworkManager.
117
118 DEVICE_IFACE
119 The interface name of the control interface of the device.
120 Depending on the device type, this differs from DEVICE_IP_IFACE.
121 For example for ADSL devices, this could be 'atm0' or for WWAN
122 devices it might be 'ttyUSB0'.
123
124 DEVICE_IP_IFACE
125 The IP interface name of the device. This is the network interface
126 on which IP addresses and routes will be configured.
127
128 IP4_ADDRESS_N
129 The IPv4 address in the format "address/prefix gateway", where N is
130 a number from 0 to (# IPv4 addresses - 1). gateway item in this
131 variable is deprecated, use IP4_GATEWAY instead.
132
133 IP4_NUM_ADDRESSES
134 The variable contains the number of IPv4 addresses the script may
135 expect.
136
137 IP4_GATEWAY
138 The gateway IPv4 address in traditional numbers-and-dots notation.
139
140 IP4_ROUTE_N
141 The IPv4 route in the format "address/prefix next-hop metric",
142 where N is a number from 0 to (# IPv4 routes - 1).
143
144 IP4_NUM_ROUTES
145 The variable contains the number of IPv4 routes the script may
146 expect.
147
148 IP4_NAMESERVERS
149 The variable contains a space-separated list of the DNS servers.
150
151 IP4_DOMAINS
152 The variable contains a space-separated list of the search domains.
153
154 DHCP4_<dhcp-option-name>
155 If the connection used DHCP for address configuration, the received
156 DHCP configuration is passed in the environment using standard DHCP
157 option names, prefixed with "DHCP4_", like
158 "DHCP4_HOST_NAME=foobar".
159
160 IP6_<name> and DHCP6_<name>
161 The same variables as for IPv4 are available for IPv6, but the
162 prefixes are IP6_ and DHCP6_ instead.
163
164 CONNECTIVITY_STATE
165 The network connectivity state, which can take the values defined
166 by the NMConnectivityState type, from the
167 org.freedesktop.NetworkManager D-Bus API: UNKNOWN, NONE, PORTAL,
168 LIMITED or FULL. Note: this variable will only be set for
169 connectivity-change actions.
170
171 In case of VPN, VPN_IP_IFACE is set, and IP4_*, IP6_* variables with
172 VPN prefix are exported too, like VPN_IP4_ADDRESS_0,
173 VPN_IP4_NUM_ADDRESSES.
174
175 Dispatcher scripts are run one at a time, but asynchronously from the
176 main NetworkManager process, and will be killed if they run for too
177 long. If your script might take arbitrarily long to complete, you
178 should spawn a child process and have the parent return immediately.
179 Scripts that are symbolic links pointing inside the
180 /etc/NetworkManager/dispatcher.d/no-wait.d/ directory are run
181 immediately, without waiting for the termination of previous scripts,
182 and in parallel. Also beware that once a script is queued, it will
183 always be run, even if a later event renders it obsolete. (Eg, if an
184 interface goes up, and then back down again quickly, it is possible
185 that one or more "up" scripts will be run after the interface has gone
186 down.)
187
189 Please report any bugs you find in NetworkManager at the NetworkManager
190 issue tracker[1].
191
193 NetworkManager home page[2], NetworkManager(8),
194
196 1. NetworkManager issue tracker
197 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues
198
199 2. NetworkManager home page
200 https://networkmanager.dev
201
202
203
204NetworkManager-dispatcher 1 NETWORKMANAGER-DISPATCHER(8)