ip-rule
IP routing policy database management. tldr-pages
On Linux
Linux
Display the routing policy
ip [ruIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Create a new generic routing rule with a higher priority than main
sudo ip [ru [a from all lookup table_idIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Add a new rule based on packet source addresses
sudo ip [ru [a from 192.168.178.2/32 lookup table_idIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Add a new rule based on packet destination addresses
sudo ip [ru [a to 192.168.178.2/32 lookup table_idIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Delete a rule based on packet source addresses
sudo ip [ru [d from 192.168.178.2/32IdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Remove all routing rules
sudo ip [ru [fIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Save all rules to a file
ip [ru [s >path/to/ip_rules.datIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Restore all rules from a file
sudo ip <path/to/ip_rules.dat [ru [rIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community