Question: How to Delete Duplicate Rules in Routing Policy Database?
Use the IP Rule selector for deleting the specific IP Rule.
The syntax for the command is as follows:
# ip rule del pref [selector]
1. First, list the routing policy database:
# ip rule list 0: from all lookup local 32760: from all to 10.0.0.10 lookup 220. 32761: from 10.0.0.10 lookup 220. 32762: from all to 172.16.0.0/23 lookup 210 32763: from 172.16.0.0/23 lookup 210 32764: from all to 10.0.0.10 lookup 220 32765: from 10.0.0.10 lookup 220 32766: from all lookup main 32767: from all lookup default
2. As you can see from the output above there are 2 dulicate IP rules, 32760 and 32761. Delete these IP rules using the command:
# ip rule del pref 32760 # ip rule del pref 32761
3. Verify the IP rule list again to confirm if the duplicate rules are deleted from the roputing policy database:
# ip rule list 0: from all lookup local 32762: from all to 172.16.0.0/23 lookup 210 32763: from 172.16.0.0/23 lookup 210 32764: from all to 10.0.0.10 lookup 220 32765: from 10.0.0.10 lookup 220 32766: from all lookup main 32767: from all lookup default