I've been working with custom route tables on Linux, and I'm a bit confused by some of the documentation and behavior of the "ip route" command. It seems that the only valid values should be 0-255 plus the names defined in /etc/iproute2/rt_tables:

255 local
254 main
253 default
0   unspec

This would leave 1-252 for custom tables. Attempting to use an undefined table name gives an error:

$ ip route show table kermit
Error: argument "kermit" is wrong: table id value is invalid

However, it seems that I can use numbers far higher than 255 without error:

$ ip route show table 1000
[no output]
$ ip route add dev eth0 table 1000
[no output]
$ ip route show table 1000 dev eth0  scope link

At some point, things get even weirder. Right at maxint (2^31), it "overflows" into the local table (255):

$ ip route show table 2147483647
[no output]
$ ip route show table 2147483648
[exact output of table 255 (local)]

Can anyone explain what is happening? Are there actually maxint custom routing tables that can be used?

1 Answer 1


As far as the 2.6 kernel is concerned, the max table is 0xFFFFFFFF (from rtnetlink.h). However, iproute2 uses a signed integer in it's filter to do the lookup so at 2^31 it thinks you specified an invalid table and defaults to showing you table 255.

  • So, an invalid name gives you an error, but an invalid integer gives you 255? Also, I assume that 255 was the previous max (in 2.4 maybe?) but was increased to a 32-bit number in kernel 2.6?
    – Bob
    Sep 27, 2011 at 18:07
  • Yes, the max in 2.4 and 2.2 was 255.
    – Ciclamino
    Sep 27, 2011 at 19:36
  • Also, always showing table 255 for values with the 32nd bit doesn't appear to be any sort of planned behaviour, just a bug. With a one line patch to iproute I was able to create and show a table with number 4294967290. However, it may not be as simple as that, there may other pieces that still don't deal with 2^32 tables.
    – Ciclamino
    Sep 27, 2011 at 20:02
  • Accepted, thanks. Maybe you should submit your patch :)
    – Bob
    Oct 6, 2011 at 11:41
  • 1
    More recent tools tend to allow table values up to 2^32-1 (eg: $ ip -V ip utility, iproute2-ss180813 $ ip route list table 4294967296 Error: argument "4294967296" is wrong: table id value is invalid $ ip route list table 4294967295 (no output). The previous behaviour might have been to show the "unspec" table 0 (not 255), but 0 will include 255 (and any other table).
    – A.B
    Sep 29, 2018 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .