How to add direct routes(proto kernel scope link) to non-main table automatically
by linjing from LinuxQuestions.org on (#4W5NJ)
When I add an IP to interface,the kernel will add a direct route to main table,and if I delete the IP,the kernel will delete the direct route from main table.As follows:
Code:root@template:~# ip addr add 192.168.10.1/24 dev eth2
root@template:~# ip route show table main | grep 192.168.10
192.168.10.0/24 dev eth2 proto kernel scope link src 192.168.10.1
root@template:~# ip addr del 192.168.10.1/24 dev eth2
root@template:~# ip route show table main | grep 192.168.10
root@template:~#If add another route table to /etc/iproute2/rt_tables,how to make the new table works like main table add/del direct route automatically?
Thanks!


Code:root@template:~# ip addr add 192.168.10.1/24 dev eth2
root@template:~# ip route show table main | grep 192.168.10
192.168.10.0/24 dev eth2 proto kernel scope link src 192.168.10.1
root@template:~# ip addr del 192.168.10.1/24 dev eth2
root@template:~# ip route show table main | grep 192.168.10
root@template:~#If add another route table to /etc/iproute2/rt_tables,how to make the new table works like main table add/del direct route automatically?
Thanks!