How to Fix Failed to Start Flush Routing Tables in Ubuntu

During system boot or network restart routines on Ubuntu servers and desktop workstations, administrators can encounter a red error banner stating Failed to start Flush Routing Tables, corresponding to the failure of networkd-dispatcher.service or systemd network table teardown scripts. This service is responsible for clearing dynamic kernel IP routing tables during network reconfiguration to prevent packet routing loops and orphaned gateway metrics. When the service crashes, network interfaces can become desynchronised, losing default gateway pointers. This breakdown stems from Netplan syntax errors, duplicate default gateways, or interface name mismatches.

Examine Detailed systemd Failure Journal Logs

Querying the system journal isolates whether the failure is caused by an invalid Netplan YAML parameter, an unreachable next-hop gateway, or permissions errors.

  1. Open a terminal on your Ubuntu system.
  2. Query the status of the network flushing service:
    systemctl status systemd-networkd.service
  3. Inspect journal logs specifically for routing table errors:
    journalctl -b -u systemd-networkd.service --no-pager | grep -i route
  4. Look for failure indicators such as RTNETLINK answers: File exists, Nexthop has invalid gateway, or Failed to configure Route: Network is unreachable.

Audit Netplan Configuration for Duplicate Gateways

In modern Ubuntu installations, defining gateway4 or duplicate default routes across multiple network interfaces in Netplan files causes kernel routing table flush errors.

  1. Navigate to the Netplan directory:
    cd /etc/netplan
  2. Inspect your configuration files:
    cat *.yaml
  3. Ensure that gateway4 (deprecated in modern Netplan) is replaced with canonical routes directives.
  4. Verify that only one interface defines a default route (to: default or to: 0.0.0.0/0). Having two default routes without distinct metric values causes routing conflicts.
  5. Test your Netplan configuration for syntax validity without permanently applying changes:
    sudo netplan try
  6. If no syntax errors are returned, apply the configuration:
    sudo netplan apply

Manually Flush Orphaned Kernel Routing Rules

If transient routing table states have become trapped in the running Linux kernel, flushing the IP route cache manually resets the routing tables.

  1. List current active IPv4 routes:
    ip route show
  2. Flush all cached route entries:
    sudo ip route flush cache
  3. If duplicate default gateways exist, remove the invalid gateway manually:
    sudo ip route del default via [Invalid-IP-Address]
  4. Restart the systemd network daemon:
    sudo systemctl restart systemd-networkd
  5. Verify that the service now passes cleanly without failure banners:
    sudo systemctl status systemd-networkd

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.