0

Is it possible to have multiple routing tables with the same ID? the name of the table would still be unique.

I cant find the information about this, seems is focusing on ip rule and add addr to the tables.

The table list at /etc/iproute2/rt_tables

   #
   #reserved values
   # 
   255       local
   254       main
   253       default
   0         unspec
   #
   # local
   #
   #1        inr.ruhep
   7         testA
   7         testB

Does this work? I have been testing and it looks like both tables are use.

Where could i find information about table ID and if it needs to be unique?

user1501127
  • 103
  • 3

1 Answers1

1

Any table name in ip command will be translated to numeric id by lookup inside the rt_tables file. So, you can use non-unique table names, but the numeric id identifies the table uniquely.

In your case don't matter what name of table you're using, same table with id 7 will be used. If you've run ip route add <some-route> table testA, you see this route in output of ip route list table testB.

Anton Danilov
  • 5,082
  • 2
  • 13
  • 23
  • Thanks Anton, I did some testing and it's as you say. The routing will be added to both tables, this will work for my solution. – user1501127 Nov 06 '17 at 06:41