summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2010-12-01 11:24:58 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-12-01 11:24:58 -0800
commitf4ff11e3e298d457c4f30813e305f7d27d89823a (patch)
tree9a906101fc2213bae70aece7a5b6749452d168be /doc
parent3822cc986cc33751b82a22b91289ef088d94440c (diff)
downloadiproute2-f4ff11e3e298d457c4f30813e305f7d27d89823a.tar.gz
Add ip route save/restore
This patch adds save and restore commands to "ip route". Save dumps the RTNL stream to stdout which can then be passed to restore later. This may be helpful in some normal situations, and will allow C/R to migrate the routing information in userspace. Tweaking of the stream can be done by userspace helpers to convert between versions and adjust things like device indexes when restoring routes in a different environment. By factoring out some of the common bits of print_route() into filter_nlmsg(), the "save" command can use the same selection logic as "list," allowing the caller to save only specific routes as necessary. The only change since the RFC is the addition of manpage and doc material. Signed-off-by: Dan Smith <danms@us.ibm.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/ip-cref.tex35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/ip-cref.tex b/doc/ip-cref.tex
index 056e3bf5..d8fed66e 100644
--- a/doc/ip-cref.tex
+++ b/doc/ip-cref.tex
@@ -1675,6 +1675,41 @@ information about this route is shown:
\item \verb|used| --- the number of lookups of this route since its creation.
\end{itemize}
+\subsection{{\tt ip route save} -- save routing tables}
+\label{IP-ROUTE-SAVE}
+
+\paragraph{Description:} this command saves the contents of the routing
+tables or the route(s) selected by some criteria to standard output.
+
+\paragraph{Arguments:} \verb|ip route save| has the same arguments as
+\verb|ip route show|.
+
+\paragraph{Example:} This saves all the routes to the {\tt saved\_routes}
+file:
+\begin{verbatim}
+dan@caffeine:~ # ip route save > saved_routes
+\end{verbatim}
+
+\paragraph{Output format:} The format of the data stream provided by
+\verb|ip route save| is that of \verb|rtnetlink|. See
+\verb|rtnetlink(7)| for more information.
+
+\subsection{{\tt ip route restore} -- restore routing tables}
+\label{IP-ROUTE-RESTORE}
+
+\paragraph{Description:} this command restores the contents of the routing
+tables according to a data stream as provided by \verb|ip route save| via
+standard input. Note that any routes already in the table are left unchanged.
+Any routes in the input stream that already exist in the tables are ignored.
+
+\paragraph{Arguments:} This command takes no arguments.
+
+\paragraph{Example:} This restores all routes that were saved to the
+{\tt saved\_routes} file:
+
+\begin{verbatim}
+dan@caffeine:~ # ip route restore < saved_routes
+\end{verbatim}
\subsection{{\tt ip route flush} --- flush routing tables}
\label{IP-ROUTE-FLUSH}