On Linux I can type something like echo 202 my_table >> /etc/iproute2/rt_tables
and voila, I can use my_table in commands like ip route add 1.1.1.1 dev eth0 table my_table
.
But my rooted Android phone doesn't have /etc/iproute2
. And even if I create this directory (mkdir -p /etc/iproute2/
), then echo 202 my_table >> /etc/iproute2/rt_tables
and run ip route add 1.1.1.1 dev eth0 table my_table
I get :
Error: argument "my_table" is wrong: "table" value is invalid
How to create and delete route tables on Android?
/data/misc/net/rt_tables
on Android. But Android's limitedip
command doesn't readrt_tables
at all. You need to buildiproute2
package. Be noted that routing on Android is far complex than normal Linux distros. – Irfan Latif Sep 29 '20 at 2:03