blob: f81a5910bf22a49f667733e0c9512a385aa3941a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
.TH IP\-NEXTHOP 8 "30 May 2019" "iproute2" "Linux"
.SH "NAME"
ip-nexthop \- nexthop object management
.SH "SYNOPSIS"
.sp
.ad l
.in +8
.ti -8
.B ip
.RI "[ " ip-OPTIONS " ]"
.B nexthop
.RI " { " COMMAND " | "
.BR help " }"
.sp
.ti -8
.ti -8
.BR "ip nexthop" " { "
.BR show " | " flush " } "
.I SELECTOR
.ti -8
.BR "ip nexthop" " { " add " | " replace " } id "
.I ID
.IR NH
.ti -8
.BR "ip nexthop" " { " get " | " del " } id "
.I ID
.ti -8
.BI "ip nexthop bucket list " BUCKET_SELECTOR
.ti -8
.BR "ip nexthop bucket get " id
.I ID
.RI "index " INDEX
.ti -8
.IR SELECTOR " := "
.RB "[ " id
.IR ID " ] [ "
.B dev
.IR DEV " ] [ "
.B vrf
.IR NAME " ] [ "
.B master
.IR DEV " ] [ "
.BR groups " ] [ "
.BR fdb " ]"
.ti -8
.IR BUCKET_SELECTOR " := "
.IR SELECTOR
.RB " | [ " nhid
.IR ID " ]"
.ti -8
.IR NH " := { "
.BR blackhole " | [ "
.B via
.IR ADDRESS " ] [ "
.B dev
.IR DEV " ] [ "
.BR onlink " ] [ "
.B encap
.IR ENCAP " ] [ "
.BR fdb " ] | "
.B group
.IR GROUP " [ "
.BR fdb " ] [ "
.B type
.IR TYPE " [ " TYPE_ARGS " ] ] }"
.ti -8
.IR ENCAP " := [ "
.IR ENCAP_MPLS " ] "
.ti -8
.IR ENCAP_MPLS " := "
.BR mpls " [ "
.IR LABEL " ] ["
.B ttl
.IR TTL " ]"
.ti -8
.IR GROUP " := "
.BR id "[," weight "[/...]"
.ti -8
.IR TYPE " := { "
.BR mpath " | " resilient " }"
.ti -8
.IR TYPE_ARGS " := [ "
.IR RESILIENT_ARGS " ] "
.ti -8
.IR RESILIENT_ARGS " := "
.RB "[ " buckets
.IR BUCKETS " ] [ "
.B idle_timer
.IR IDLE " ] [ "
.B unbalanced_timer
.IR UNBALANCED " ]"
.SH DESCRIPTION
.B ip nexthop
is used to manipulate entries in the kernel's nexthop tables.
.TP
ip nexthop add id ID
add new nexthop entry
.TP
ip nexthop replace id ID
change the configuration of a nexthop or add new one
.RS
.TP
.BI via " [ FAMILY ] ADDRESS"
the address of the nexthop router, in the address family FAMILY.
Address family must match address family of nexthop instance.
.TP
.BI dev " NAME"
is the output device.
.TP
.B onlink
pretend that the nexthop is directly attached to this link,
even if it does not match any interface prefix.
.TP
.BI encap " ENCAPTYPE ENCAPHDR"
attach tunnel encapsulation attributes to this route.
.sp
.I ENCAPTYPE
is a string specifying the supported encapsulation type. Namely:
.in +8
.BI mpls
- encapsulation type MPLS
.sp
.in -8
.I ENCAPHDR
is a set of encapsulation attributes specific to the
.I ENCAPTYPE.
.in +8
.B mpls
.in +2
.I MPLSLABEL
- mpls label stack with labels separated by
.I "/"
.sp
.B ttl
.I TTL
- TTL to use for MPLS header or 0 to inherit from IP header
.in -2
.TP
.BI group " GROUP [ " type " TYPE [ TYPE_ARGS ] ]"
create a nexthop group. Group specification is id with an optional
weight (id,weight) and a '/' as a separator between entries.
.sp
.I TYPE
is a string specifying the nexthop group type. Namely:
.in +8
.BI mpath
- Multipath nexthop group backed by the hash-threshold algorithm. The
default when the type is unspecified.
.sp
.BI resilient
- Resilient nexthop group. Group is resilient to addition and deletion of
nexthops.
.sp
.in -8
.I TYPE_ARGS
is a set of attributes specific to the
.I TYPE.
.in +8
.B resilient
.in +2
.B buckets
.I BUCKETS
- Number of nexthop buckets. Cannot be changed for an existing group
.sp
.B idle_timer
.I IDLE
- Time in seconds in which a nexthop bucket does not see traffic and is
therefore considered idle. Default is 120 seconds
.B unbalanced_timer
.I UNBALANCED
- Time in seconds in which a nexthop group is unbalanced and is therefore
considered unbalanced. The kernel will try to rebalance unbalanced groups, which
might result in some flows being reset. A value of 0 means that no
rebalancing will take place. Default is 0 seconds
.in -2
.TP
.B blackhole
create a blackhole nexthop
.TP
.B fdb
nexthop and nexthop groups for use with layer-2 fdb entries.
A fdb nexthop group can only have fdb nexthops.
Example: Used to represent a vxlan remote vtep ip. layer-2 vxlan
fdb entry pointing to an ecmp nexthop group containing multiple
remote vtep ips.
.RE
.TP
ip nexthop delete id ID
delete nexthop with given id.
.TP
ip nexthop show
show the contents of the nexthop table or the nexthops
selected by some criteria.
.RS
.TP
.BI dev " DEV "
show the nexthops using the given device.
.TP
.BI vrf " NAME "
show the nexthops using devices associated with the vrf name
.TP
.BI master " DEV "
show the nexthops using devices enslaved to given master device
.TP
.BI groups
show only nexthop groups
.TP
.BI fdb
show only fdb nexthops and nexthop groups
.RE
.TP
ip nexthop flush
flushes nexthops selected by some criteria. Criteria options are the same
as show.
.TP
ip nexthop get id ID
get a single nexthop by id
.TP
ip nexthop bucket show
show the contents of the nexthop bucket table or the nexthop buckets
selected by some criteria.
.RS
.TP
.BI id " ID "
.in +0
show the nexthop buckets that belong to a nexthop group with a given id
.TP
.BI nhid " ID "
.in +0
show the nexthop buckets that hold a nexthop with a given id
.TP
.BI dev " DEV "
.in +0
show the nexthop buckets using the given device
.TP
.BI vrf " NAME "
.in +0
show the nexthop buckets using devices associated with the vrf name
.TP
.BI master " DEV "
.in +0
show the nexthop buckets using devices enslaved to given master device
.RE
.TP
ip nexthop bucket get id ID index INDEX
get a single nexthop bucket by nexthop group id and bucket index
.SH EXAMPLES
.PP
ip nexthop ls
.RS 4
Show all nexthop entries in the kernel.
.RE
.PP
ip nexthop add id 1 via 192.168.1.1 dev eth0
.RS 4
Adds an IPv4 nexthop with id 1 using the gateway 192.168.1.1 out device eth0.
.RE
.PP
ip nexthop add id 2 encap mpls 200/300 via 10.1.1.1 dev eth0
.RS 4
Adds an IPv4 nexthop with mpls encapsulation attributes attached to it.
.RE
.PP
ip nexthop add id 3 group 1/2
.RS 4
Adds a nexthop with id 3. The nexthop is a group using nexthops with ids
1 and 2 at equal weight.
.RE
.PP
ip nexthop add id 4 group 1,5/2,11
.RS 4
Adds a nexthop with id 4. The nexthop is a group using nexthops with ids
1 and 2 with nexthop 1 at weight 5 and nexthop 2 at weight 11.
.RE
.PP
ip nexthop add id 5 via 192.168.1.2 fdb
.RS 4
Adds a fdb nexthop with id 5.
.RE
.PP
ip nexthop add id 7 group 5/6 fdb
.RS 4
Adds a fdb nexthop group with id 7. A fdb nexthop group can only have
fdb nexthops.
.RE
.PP
ip nexthop add id 10 group 1/2 type resilient buckets 32
.RS 4
Add a resilient nexthop group with id 10 and 32 nexthop buckets.
.RE
.SH SEE ALSO
.br
.BR ip (8)
.SH AUTHOR
Original Manpage by David Ahern <dsahern@kernel.org>
|