Forrest logo
back to the ip tool

ip-rule:tldr:ce0c9

ip-rule: Save all rules to a file.
$ ip rule save > ${path-to-ip_rules-dat}
try on your machine

This command is used to save the current IP rules configuration to a file named "ip_rules.dat" or any specified file using the variable ${path-to-ip_rules-dat}.

Here's an explanation of each component of the command:

  • ip rule: This is the command-line tool in Linux used to manage the rules within the IP routing table. The routing table determines how network traffic is directed.

  • save: This is an argument or parameter for the ip rule command. It instructs the command to save the current IP rules configuration.

  • >: This is a shell feature that redirects the output of a command to a file instead of the terminal screen. In this case, it redirects the output of the ip rule save command.

  • ${path-to-ip_rules-dat}: This is a placeholder variable that should be replaced with the actual path to the desired file name for storing the IP rules configuration. For example, if you want to save the configuration to a file called "ip_rules.dat" in the current directory, you would replace ${path-to-ip_rules-dat} with "ip_rules.dat".

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ip tool