How do I see what pid/process has modified a linux routing table?
How do I see what pid/process has modified a linux routing table?
Anyone know how to see what pid/process has modified a linux routing table (specifically on Ubuntu )? I have an interesting problem where a route that I have created has been deleted over time, but can't figure out what. I've tried rtmon but seems to only show timestamps of the adds/deletes
The better solution:
sudo apt-get install auditd
Set up watch:
sudo auditctl -w /path/to/your/file -p wa -k file_change_monitor
Check log:
sudo ausearch -k file_change_monitor
Alternative solution:
If you know the file that is being edited you can set up watches with
inotifywait
and log it to a file. This may possibly not work because lsof might not be quick enough.sudo apt-get install inotify-tools
then put this script in autostart
Don't forget to modify the values at the top of the script and make it executable.
They aren't asking about changes to a file describing the routing config, rather the actual in-use routing config. Unless the routing rules are modified through a couple of files (which I doubt), this doesn't answer the question.
Cool commands though.
My bad, I thought in Linux everything is a file