Article 4W5NJ How to add direct routes(proto kernel scope link) to non-main table automatically

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!latest?d=yIl2AUoC8zA latest?i=YJw3kXamUoM:XnIj4X8_AFU:F7zBnMy latest?i=YJw3kXamUoM:XnIj4X8_AFU:V_sGLiP latest?d=qj6IDK7rITs latest?i=YJw3kXamUoM:XnIj4X8_AFU:gIN9vFwYJw3kXamUoM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments