NetworkManager dispatcher scripts let you run local tasks in response to network events. To use them safely, install a root-owned executable in the dispatcher directory, branch on the event and validated inputs, and keep blocking work short. Network events can be delayed or superseded, so check the current connection state before making consequential changes.
Install scripts with the required protections
NetworkManager runs dispatcher scripts from /etc/NetworkManager/dispatcher.d and /usr/lib/NetworkManager/dispatcher.d, including subdirectories. When files in those locations have the same name, the /etc entry takes precedence. Scripts run alphabetically.
The NetworkManager dispatcher reference says each script should be a regular executable file owned by root, must not be writable by group or others, and must not have the setuid bit set. Review the parent directory and any symlink targets as well: they must not let an untrusted user replace code that will run with administrator authority.
- Place the script in a documented dispatcher directory and make it executable.
- Set root ownership, remove group and other write permissions, and ensure setuid is not set.
- Use a distinctive filename; remember that scripts run alphabetically and that an identically named file in
/etcoverrides one in/usr/lib. - Keep credentials out of logs, and handle event values as data rather than interpolating them unsafely into shell commands.
Handle the event and its inputs explicitly
NetworkManager passes two arguments to a dispatcher script: the interface name and the action. The interface argument is not always a conventional device name. Depending on the event, it may be VPN_IP_IFACE, DEVICE_IP_IFACE, or DEVICE_IFACE. For hostname, the device argument is none; for connectivity-change and dns-change, it is empty. Do not assume the first argument is always non-empty.
#1 Best Overall
- Dual band router upgrades to 1200 Mbps high speed internet (300mbps for 2.4GHz plus 900Mbps for 5GHz), reducing buffering and ideal for 4K stream
- Full Gigabit Ports - Gigabit Router with 4 Gigabit LAN ports, ideal for any internet plan and allow you to directly connect your wired devices
- Boosted Coverage - Four external antennas equipped with Beamforming technology extend and concentrate the Wi-Fi signals
- MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
- Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
Documented actions include pre-up, up, pre-down, down, dhcp4-change, dhcp6-change, connectivity-change, reapply, dns-change, hostname, and device-add. The device-add path has a special generic-device handler behavior in which only one script is executed. Branch on the action and validate the values required by that branch rather than assuming every event has identical context.
The environment can include NM_DISPATCHER_ACTION, CONNECTION_UUID, CONNECTION_ID, CONNECTION_DBUS_PATH, CONNECTION_FILENAME, CONNECTION_EXTERNAL, DEVICE_IFACE, and DEVICE_IP_IFACE. VPN events can expose VPN-prefixed address variables. Connection user data is exported as encoded CONNECTION_USER_... variables; for example, the manual maps test.foo-Bar2 to CONNECTION_USER_TEST__FOO_055_BAR2. Values depend on the event, so test whether a variable is unset or empty before using it.
Rank #2
- 【Five Gigabit Ports】1 Gigabit WAN Port plus 2 Gigabit WAN/LAN Ports plus 2 Gigabit LAN Port. Up to 3 WAN ports optimize bandwidth usage through one device.
- 【One USB WAN Port】Mobile broadband via 4G/3G modem is supported for WAN backup by connecting to the USB port. For complete list of compatible 4G/3G modems, please visit TP-Link website.
- 【Abundant Security Features】Advanced firewall policies, DoS defense, IP/MAC/URL filtering, speed test and more security functions protect your network and data.
- 【Highly Secure VPN】Supports up to 20× LAN-to-LAN IPsec, 16× OpenVPN, 16× L2TP, and 16× PPTP VPN connections.
- Security - SPI Firewall, VPN Pass through, FTP/H.323/PPTP/SIP/IPsec ALG, DoS Defence, Ping of Death and Local Management. Standards and Protocols IEEE 802.3, 802.3u, 802.3ab, IEEE 802.3x, IEEE 802.1q
Choose an event that fits the task
Prefer ordinary up and down events unless the task genuinely must happen before activation or disconnection. A pre-event handler delays the network transition while it runs, making it a poor fit for slow or unpredictable work.
Use pre-up or pre-down only for short, necessary work
pre-up runs before NetworkManager reports the interface fully activated, and NetworkManager waits for it to finish. pre-down runs before a cleanly handled disconnection and also delays that transition. It is not emitted for forced disconnects such as carrier loss or a fading wireless signal, so it cannot serve as a guaranteed cleanup hook for every loss of connectivity.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Dual-band Wi-Fi with 5 GHz speeds up to 867 Mbps and 2.4 GHz speeds up to 300 Mbps, delivering 1200 Mbps of total bandwidth¹. Dual-band routers do not support 6 GHz. Performance varies by conditions, distance to devices, and obstacles such as walls.
- Covers up to 1,000 sq. ft. with four external antennas for stable wireless connections and optimal coverage.
- Supports IGMP Proxy/Snooping, Bridge and Tag VLAN to optimize IPTV streaming
- Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
- Advanced Security with WPA3 - The latest Wi-Fi security protocol, WPA3, brings new capabilities to improve cybersecurity in personal networks
Keep ordinary handlers short; offload work that may take a long time
Dispatcher scripts run one at a time, asynchronously from the main NetworkManager process, and are killed if they run too long. The manual recommends starting a child process and letting the dispatcher parent return when work may take an arbitrary amount of time. The documentation does not establish a universal timeout duration; check the target system’s package documentation or configuration rather than relying on a fixed number.
Use no-wait.d only when overlap is safe
Symlinks into /etc/NetworkManager/dispatcher.d/no-wait.d/ run immediately without waiting for preceding scripts and can run in parallel. This can reduce waiting, but changes ordering and allows concurrent invocations. Use it only if the task remains correct under overlap and does not rely on another dispatcher script having already completed.
Rank #4
- DUAL-BAND WIFI 6 ROUTER: Wi-Fi 6(802.11ax) technology achieves faster speeds, greater capacity and reduced network congestion compared to the previous gen. All WiFi routers require a separate modem. Dual-Band WiFi routers do not support the 6 GHz band.
- AX1800: Enjoy smoother and more stable streaming, gaming, downloading with 1.8 Gbps total bandwidth (up to 1200 Mbps on 5 GHz and up to 574 Mbps on 2.4 GHz). Performance varies by conditions, distance to devices, and obstacles such as walls.
- CONNECT MORE DEVICES: Wi-Fi 6 technology communicates more data to more devices simultaneously using revolutionary OFDMA technology
- EXTENSIVE COVERAGE: Achieve the strong, reliable WiFi coverage with Archer AX1800 as it focuses signal strength to your devices far away using Beamforming technology, 4 high-gain antennas and an advanced front-end module (FEM) chipset
- OUR CYBERSECURITY COMMITMENT: TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
Make handlers resilient to repeated and stale events
A queued event may still be delivered after a later event has made its original state obsolete. For instance, an up event may be processed after the interface has gone down again. Treat the action as a notification, not a guaranteed snapshot of current network state.
- Make repeated runs harmless where possible, such as by checking whether the desired change is already in place.
- Before consequential work, verify the current device or connection state instead of relying only on the event arguments.
- If using
no-wait.d, protect shared files and other resources against concurrent runs. - Design for missing or empty event-specific variables and for changes that occur between notification and execution.
Troubleshoot a script that does not run or behaves unexpectedly
- Check installation and permissions. Confirm the exact dispatcher path, regular-file status, root ownership, executable bit, absence of group/other write permissions, and absence of setuid.
- Record the event safely. Log the action and arguments while excluding secrets, then compare them with the event your handler expects. Do not assume an interface argument is present for every action.
- Look for a blocking handler. A
pre-uporpre-downscript can hold activation or disconnection; a long-running handler may be terminated. - Check for stale events or overlap. Compare the current interface state with the triggering event and determine whether a
no-wait.dsymlink allowed another invocation to run at the same time. - Confirm the local version and behavior. Consult the manual for the installed distribution package. The Ubuntu Noble NetworkManager manual identifies its packaged version as 1.46.0-1ubuntu2.8 and describes the general sequential execution, timeout, and no-wait behavior. The RHEL 8 networking guide also directs readers to the NetworkManager manual for dispatcher actions and environment variables.
Distribution packaging and NetworkManager versions can differ. The project reference documents the interface; the installed distribution’s manual is the better check for local version context.
Quick Recap
Best Value
- Next-Gen Gigabit Wi-Fi 6 Speeds: 2402 Mbps on 5 GHz and 574 Mbps on 2.4 GHz bands ensure smoother streaming and faster downloads; support VPN server and VPN client¹
- A More Responsive Experience: Enjoy smooth gaming, video streaming, and live feeds simultaneously. OFDMA makes your Wi-Fi stronger by allowing multiple clients to share one band at the same time, cutting latency and jitter.²
- Expanded Wi-Fi Coverage: 4 high-gain external antennas and Beamforming technology combine to extend strong, reliable, Wi-Fi throughout your home.
- Improved Battery Life: Target Wake Time helps your devices to communicate efficiently while consuming less power.
- Improved Cooling Design: No heat ups, no throttles. A larger heat sink and redefined case design cools the WiFi 6 system and enables your network to stay at top speeds in more versatile environments.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




