1IP-NEXTHOP(8)                        Linux                       IP-NEXTHOP(8)
2
3
4

NAME

6       ip-nexthop - nexthop object management
7

SYNOPSIS

9       ip [ ip-OPTIONS ] nexthop  { COMMAND | help }
10
11
12       ip nexthop { show | flush } SELECTOR
13
14       ip nexthop { add | replace } id ID NH
15
16       ip nexthop { get | del } id ID
17
18       ip nexthop bucket list BUCKET_SELECTOR
19
20       ip nexthop bucket get id ID index INDEX
21
22       SELECTOR := [ id ID ] [ dev DEV ] [ vrf NAME ] [ master DEV ] [ groups
23               ] [ fdb ]
24
25       BUCKET_SELECTOR := SELECTOR  | [ nhid ID ]
26
27       NH := { blackhole | [ via ADDRESS ] [ dev DEV ] [ onlink ] [ encap EN‐
28               CAP ] [ fdb ] | group GROUP [ fdb ] [ type TYPE [ TYPE_ARGS ] ]
29               }
30
31       ENCAP := [ ENCAP_MPLS ]
32
33       ENCAP_MPLS := mpls [ LABEL ] [ ttl TTL ]
34
35       GROUP := id[,weight[/...]
36
37       TYPE := { mpath | resilient }
38
39       TYPE_ARGS := [ RESILIENT_ARGS ]
40
41       RESILIENT_ARGS := [ buckets BUCKETS ] [ idle_timer IDLE ] [ unbal‐
42               anced_timer UNBALANCED ]
43
44

DESCRIPTION

46       ip nexthop is used to manipulate entries in the kernel's nexthop ta‐
47       bles.
48
49       ip nexthop add id ID
50              add new nexthop entry
51
52       ip nexthop replace id ID
53              change the configuration of a nexthop or add new one
54
55              via [ FAMILY ] ADDRESS
56                     the address of the nexthop router, in the address family
57                     FAMILY.  Address family must match address family of nex‐
58                     thop instance.
59
60              dev NAME
61                     is the output device.
62
63              onlink pretend that the nexthop is directly attached to this
64                     link, even if it does not match any interface prefix.
65
66              encap ENCAPTYPE ENCAPHDR
67                     attach tunnel encapsulation attributes to this route.
68
69                     ENCAPTYPE is a string specifying the supported encapsula‐
70                     tion type. Namely:
71
72                             mpls - encapsulation type MPLS
73
74                     ENCAPHDR is a set of encapsulation attributes specific to
75                     the ENCAPTYPE.
76
77                             mpls
78                               MPLSLABEL - mpls label stack with labels sepa‐
79                               rated by /
80
81
82                               ttl TTL - TTL to use for MPLS header or 0 to
83                               inherit from IP header
84
85
86              group GROUP [ type TYPE [ TYPE_ARGS ] ]
87                     create a nexthop group. Group specification is id with an
88                     optional weight (id,weight) and a '/' as a separator be‐
89                     tween entries.
90
91                     TYPE is a string specifying the nexthop group type.
92                     Namely:
93
94                             mpath - Multipath nexthop group backed by the
95                             hash-threshold algorithm. The default when the
96                             type is unspecified.
97
98                             resilient - Resilient nexthop group. Group is re‐
99                             silient to addition and deletion of nexthops.
100
101
102                     TYPE_ARGS is a set of attributes specific to the TYPE.
103
104                             resilient
105                               buckets BUCKETS - Number of nexthop buckets.
106                               Cannot be changed for an existing group
107
108
109                               idle_timer IDLE - Time in seconds in which a
110                               nexthop bucket does not see traffic and is
111                               therefore considered idle. Default is 120 sec‐
112                               onds
113
114                               unbalanced_timer UNBALANCED - Time in seconds
115                               in which a nexthop group is unbalanced and is
116                               therefore considered unbalanced. The kernel
117                               will try to rebalance unbalanced groups, which
118                               might result in some flows being reset. A value
119                               of 0 means that no rebalancing will take place.
120                               Default is 0 seconds
121
122
123              blackhole
124                     create a blackhole nexthop
125
126              fdb    nexthop and nexthop groups for use with layer-2 fdb en‐
127                     tries.  A fdb nexthop group can only have fdb nexthops.
128                     Example: Used to represent a vxlan remote vtep ip.
129                     layer-2 vxlan fdb entry pointing to an ecmp nexthop group
130                     containing multiple remote vtep ips.
131
132
133       ip nexthop delete id ID
134              delete nexthop with given id.
135
136
137       ip nexthop show
138              show the contents of the nexthop table or the nexthops selected
139              by some criteria.
140
141              dev DEV
142                     show the nexthops using the given device.
143
144              vrf NAME
145                     show the nexthops using devices associated with the vrf
146                     name
147
148              master DEV
149                     show the nexthops using devices enslaved to given master
150                     device
151
152              groups show only nexthop groups
153
154              fdb    show only fdb nexthops and nexthop groups
155
156       ip nexthop flush
157              flushes nexthops selected by some criteria. Criteria options are
158              the same as show.
159
160
161       ip nexthop get id ID
162              get a single nexthop by id
163
164
165       ip nexthop bucket show
166              show the contents of the nexthop bucket table or the nexthop
167              buckets selected by some criteria.
168
169              id ID
170                     show the nexthop buckets that belong to a nexthop group
171                     with a given id
172
173              nhid ID
174                     show the nexthop buckets that hold a nexthop with a given
175                     id
176
177              dev DEV
178                     show the nexthop buckets using the given device
179
180              vrf NAME
181                     show the nexthop buckets using devices associated with
182                     the vrf name
183
184              master DEV
185                     show the nexthop buckets using devices enslaved to given
186                     master device
187
188
189       ip nexthop bucket get id ID index INDEX
190              get a single nexthop bucket by nexthop group id and bucket index
191
192

EXAMPLES

194       ip nexthop ls
195           Show all nexthop entries in the kernel.
196
197       ip nexthop add id 1 via 192.168.1.1 dev eth0
198           Adds an IPv4 nexthop with id 1 using the gateway 192.168.1.1 out
199           device eth0.
200
201       ip nexthop add id 2 encap mpls 200/300 via 10.1.1.1 dev eth0
202           Adds an IPv4 nexthop with mpls encapsulation attributes attached to
203           it.
204
205       ip nexthop add id 3 group 1/2
206           Adds a nexthop with id 3. The nexthop is a group using nexthops
207           with ids 1 and 2 at equal weight.
208
209       ip nexthop add id 4 group 1,5/2,11
210           Adds a nexthop with id 4. The nexthop is a group using nexthops
211           with ids 1 and 2 with nexthop 1 at weight 5 and nexthop 2 at weight
212           11.
213
214       ip nexthop add id 5 via 192.168.1.2 fdb
215           Adds a fdb nexthop with id 5.
216
217       ip nexthop add id 7 group 5/6 fdb
218           Adds a fdb nexthop group with id 7. A fdb nexthop group can only
219           have fdb nexthops.
220
221       ip nexthop add id 10 group 1/2 type resilient buckets 32
222           Add a resilient nexthop group with id 10 and 32 nexthop buckets.
223

SEE ALSO

225       ip(8)
226
227

AUTHOR

229       Original Manpage by David Ahern <dsahern@kernel.org>
230
231
232
233iproute2                          30 May 2019                    IP-NEXTHOP(8)
Impressum