Inspecting one routing table matters when a Linux host uses policy routing, multiple uplinks, or service-specific traffic selection. Looking only at the default main table can miss the route entries that a matching policy rule actually sends traffic through.
The ip route show table form reads a single routing table by numeric ID or by table name. Built-in names such as local, main, and default are available by default, while custom names resolve through the rt_tables mapping under /usr/lib/iproute2 or /etc/iproute2.
A table name in the rt_tables mapping does not guarantee that the kernel currently has routes installed in that table. On current iproute2 builds, looking up a named table with no IPv4 routes can return an explicit FIB table does not exist error, so route-table inspection is most useful when paired with ip rule show.
Steps to show routes from a specific routing table with ip route:
- Show the target table by numeric ID when a routing policy rule or existing documentation refers to a table number.
$ ip route show table 254 default via 172.17.0.1 dev eth0 172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3
The built-in main table uses ID 254. Custom policy-routing tables often use IDs such as 100 or 200.
- Show a built-in table by name when comparing normal forwarding routes with host-local entries.
$ ip route show table local local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1 local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1 broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1 local 172.17.0.3 dev eth0 proto kernel scope host src 172.17.0.3 broadcast 172.17.255.255 dev eth0 proto kernel scope link src 172.17.0.3
Built-in table names include local, main, and default. The local table is maintained by the kernel and contains host and broadcast routes.
- Query a custom table by name after confirming the name is defined in the active rt_tables mapping file.
$ ip route show table isp2 Error: ipv4: FIB table does not exist. Dump terminated
This usually means the table name resolves but the kernel currently has no IPv4 routes installed in that table. Verify that the expected routes were added before treating the lookup as a command failure.
- Check the policy-routing rules if the expected route is present in one table but traffic still follows another path.
$ ip rule show 0: from all lookup local 32766: from all lookup main 32767: from all lookup default
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
