Deleting a routing policy rule with ip rule del removes one selector from the routing policy database so matching traffic stops consulting that alternate table. This matters when a temporary source-based rule is no longer needed or when a misapplied rule is overriding the expected path.

Policy-routing rules are evaluated by preference, with lower numeric priorities checked first. The delete command must match the installed rule closely enough for the kernel to remove the intended selector, so the current rule list should be inspected before building the delete command.

Deleting the wrong rule can restore traffic to the main table, bypass a custom path, or remove one of the built-in RPDB lookups if a default rule is targeted by mistake. Remove the same rule from persistent network configuration too if it was created by network scripts, a VPN client, or a network manager profile.

Steps to delete a routing policy rule with ip rule:

  1. Show the current policy-routing rules and identify the exact selector, table, and priority that should be removed.
    $ ip rule show
    0:	from all lookup local
    1000:	from 192.0.2.10 lookup 100
    32766:	from all lookup main
    32767:	from all lookup default

    Lower numeric priorities are evaluated first, so deleting the wrong low-numbered rule can change routing before the main table is reached.

  2. Delete the target rule by matching the installed selector and priority.
    $ sudo ip rule delete from 192.0.2.10/32 table 100 priority 1000

    Do not delete the built-in local, main, or default rules unless that behavior is explicitly intended.

  3. Verify that the rule no longer appears.
    $ ip rule show
    0:	from all lookup local
    32766:	from all lookup main
    32767:	from all lookup default
  4. Remove the same rule from the saved network configuration that would otherwise recreate it.

    Runtime ip rule del changes the live RPDB only, so a saved rule returns after an interface restart or reboot. For a NetworkManager profile, run sudo nmcli connection modify <profile> -ipv4.routing-rules "priority 1000 from 192.0.2.10/32 table 100". For Netplan, delete the matching entry under routing-policy in the YAML file in /etc/netplan/ and run sudo netplan apply. For systemd-networkd, delete the matching [RoutingPolicyRule] section from the .network file in /etc/systemd/network/ and run sudo networkctl reload. For a VPN client, boot script, or automation job, remove the rule from that tool's own settings.

Share this guide