blob: 5a4982dafc75b027a1f8123c88a39fa82c282d0f [file] [log] [blame]
Junxiao Shi6c135622016-11-21 14:30:33 +00001nfdc-route
2==========
3
Davide Pesavento543b1522024-06-25 17:00:32 -04004Synopsis
Junxiao Shi6c135622016-11-21 14:30:33 +00005--------
Junxiao Shi6c135622016-11-21 14:30:33 +00006
Davide Pesavento543b1522024-06-25 17:00:32 -04007| **nfdc route** [**list** [[**nexthop**] *FACEID*\|\ *FACEURI*] [**origin** *ORIGIN*]]
8| **nfdc route** **show** [**prefix**] *PREFIX*
9| **nfdc route** **add** [**prefix**] *PREFIX* [**nexthop**] *FACEID*\|\ *FACEURI* [**origin** *ORIGIN*] \
10 [**cost** *COST*] [**no-inherit**] [**capture**] [**expires** *EXPIRATION*]
11| **nfdc route** **remove** [**prefix**] *PREFIX* [**nexthop**] *FACEID*\|\ *FACEURI* [**origin** *ORIGIN*]
12| **nfdc fib** [**list**]
13
14Description
Junxiao Shi6c135622016-11-21 14:30:33 +000015-----------
Davide Pesavento543b1522024-06-25 17:00:32 -040016
Junxiao Shi6c135622016-11-21 14:30:33 +000017In NFD, the routing information base (RIB) stores static or dynamic routing information
18registered by applications, operators, and NFD itself.
Davide Pesavento543b1522024-06-25 17:00:32 -040019Each route in the RIB indicates that contents under a name prefix may be available via a nexthop.
Junxiao Shi6c135622016-11-21 14:30:33 +000020A route contains a name prefix, a nexthop face, the origin, a cost, and a set of route inheritance flags;
21refer to NFD Management protocol for more information.
22
Junxiao Shi1d62e622017-03-08 22:39:28 +000023The **nfdc route list** command lists RIB routes, optionally filtered by nexthop and origin.
Junxiao Shi6c135622016-11-21 14:30:33 +000024
Junxiao Shi1d62e622017-03-08 22:39:28 +000025The **nfdc route show** command shows RIB routes at a specified name prefix.
Junxiao Shi6c135622016-11-21 14:30:33 +000026
Junxiao Shi918e5d42017-02-25 03:58:21 +000027The **nfdc route add** command requests to add a route.
Junxiao Shi6c135622016-11-21 14:30:33 +000028If a route with the same prefix, nexthop, and origin already exists,
Junxiao Shi918e5d42017-02-25 03:58:21 +000029it is updated with the specified cost, route inheritance flags, and expiration period.
30This command returns when the request has been accepted, but does not wait for RIB update completion.
Davide Pesavento543b1522024-06-25 17:00:32 -040031If no face matching the specified URI is found, :program:`nfdc` will attempt to implicitly create a face
32with this URI before adding the route.
Junxiao Shi6c135622016-11-21 14:30:33 +000033
Junxiao Shi084b7952017-02-26 22:00:53 +000034The **nfdc route remove** command removes a route with matching prefix, nexthop, and origin.
Junxiao Shi6c135622016-11-21 14:30:33 +000035
Junxiao Shi1d62e622017-03-08 22:39:28 +000036The **nfdc fib list** command shows the forwarding information base (FIB),
37which is calculated from RIB routes and used directly by NFD forwarding.
38
Davide Pesavento543b1522024-06-25 17:00:32 -040039Options
Junxiao Shi6c135622016-11-21 14:30:33 +000040-------
Davide Pesavento543b1522024-06-25 17:00:32 -040041
42.. option:: <PREFIX>
43
Junxiao Shi918e5d42017-02-25 03:58:21 +000044 Name prefix of the route.
Junxiao Shi6c135622016-11-21 14:30:33 +000045
Davide Pesavento543b1522024-06-25 17:00:32 -040046.. option:: <FACEID>
47
Junxiao Shi918e5d42017-02-25 03:58:21 +000048 Numerical identifier of the face.
49 It is displayed in the output of **nfdc face list** and **nfdc face create** commands.
Junxiao Shi6c135622016-11-21 14:30:33 +000050
Davide Pesavento543b1522024-06-25 17:00:32 -040051.. option:: <FACEURI>
52
Junxiao Shi918e5d42017-02-25 03:58:21 +000053 An URI representing the remote endpoint of a face.
Junxiao Shi084b7952017-02-26 22:00:53 +000054 In **nfdc route add** command, it must uniquely match an existing face.
55 In **nfdc route remove** command, it must match one or more existing faces.
Junxiao Shi918e5d42017-02-25 03:58:21 +000056
Davide Pesavento543b1522024-06-25 17:00:32 -040057 See the `FaceUri section <https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#FaceUri>`__
58 of the NFD Face Management protocol for more details on the syntax.
59
60.. option:: <ORIGIN>
61
62 Origin of the route, i.e., who is announcing the route.
Junxiao Shi918e5d42017-02-25 03:58:21 +000063 The default is 255, indicating a static route.
64
Davide Pesavento543b1522024-06-25 17:00:32 -040065.. option:: <COST>
66
Junxiao Shi6c135622016-11-21 14:30:33 +000067 The administrative cost of the route.
68 The default is 0.
69
Davide Pesavento543b1522024-06-25 17:00:32 -040070.. option:: no-inherit
Junxiao Shi918e5d42017-02-25 03:58:21 +000071
Davide Pesavento543b1522024-06-25 17:00:32 -040072 Unset ``CHILD_INHERIT`` flag in the route.
Junxiao Shi918e5d42017-02-25 03:58:21 +000073
Davide Pesavento543b1522024-06-25 17:00:32 -040074.. option:: capture
75
76 Set ``CAPTURE`` flag in the route.
77
78.. option:: <EXPIRATION>
79
Junxiao Shi6c135622016-11-21 14:30:33 +000080 Expiration time of the route, in milliseconds.
81 When the route expires, NFD removes it from the RIB.
82 The default is infinite, which keeps the route active until the nexthop face is destroyed.
83
Davide Pesavento543b1522024-06-25 17:00:32 -040084Exit Status
85-----------
Junxiao Shi6c135622016-11-21 14:30:33 +000086
Davide Pesavento543b1522024-06-25 17:00:32 -0400870
88 Success.
Junxiao Shi6c135622016-11-21 14:30:33 +000089
Davide Pesavento543b1522024-06-25 17:00:32 -0400901
91 An unspecified error occurred.
Junxiao Shi918e5d42017-02-25 03:58:21 +000092
Davide Pesavento543b1522024-06-25 17:00:32 -0400932
94 Malformed command line.
Junxiao Shi918e5d42017-02-25 03:58:21 +000095
Davide Pesavento543b1522024-06-25 17:00:32 -0400963
97 Face not found.
Junxiao Shi918e5d42017-02-25 03:58:21 +000098
Davide Pesavento543b1522024-06-25 17:00:32 -0400994
100 FaceUri canonization failed.
Junxiao Shi6c135622016-11-21 14:30:33 +0000101
Davide Pesavento543b1522024-06-25 17:00:32 -04001025
103 Ambiguous: multiple matching faces are found (**nfdc route add** only).
Junxiao Shi1d62e622017-03-08 22:39:28 +0000104
Davide Pesavento543b1522024-06-25 17:00:32 -04001056
106 Route not found (**nfdc route list** and **nfdc route show** only).
107
108Examples
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000109--------
Davide Pesavento543b1522024-06-25 17:00:32 -0400110
111``nfdc route list``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000112 List all routes.
113
Davide Pesavento543b1522024-06-25 17:00:32 -0400114``nfdc route list nexthop 300``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000115 List routes whose nexthop is face 300.
116
Davide Pesavento543b1522024-06-25 17:00:32 -0400117``nfdc route list origin static``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000118 List static routes.
119
Davide Pesavento543b1522024-06-25 17:00:32 -0400120``nfdc route show prefix /localhost/nfd``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000121 List routes with name prefix "/localhost/nfd".
122
Davide Pesavento543b1522024-06-25 17:00:32 -0400123``nfdc route add prefix /ndn nexthop 300 cost 100``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000124 Add a route with prefix "/ndn" toward face 300, with administrative cost 100.
125
Davide Pesavento543b1522024-06-25 17:00:32 -0400126``nfdc route add prefix / nexthop udp://router.example.net``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000127 Add a route with prefix "/" toward a face with the specified remote FaceUri.
128
Davide Pesavento543b1522024-06-25 17:00:32 -0400129``nfdc route remove prefix /ndn nexthop 300 origin static``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000130 Remove the route whose prefix is "/ndn", nexthop is face 300, and origin is "static".
131
Davide Pesavento543b1522024-06-25 17:00:32 -0400132See Also
Junxiao Shi6c135622016-11-21 14:30:33 +0000133--------
Davide Pesavento543b1522024-06-25 17:00:32 -0400134
135:manpage:`nfdc(1)`