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       SELECTOR := [ id ID ] [ dev DEV ] [ vrf NAME ] [ master DEV ] [ groups
19               ] [ fdb ]
20
21       NH := { blackhole | [ via ADDRESS ] [ dev DEV ] [ onlink ] [ encap
22               ENCAP ] [ fdb ] | group GROUP [ fdb ] }
23
24       ENCAP := [ ENCAP_MPLS ]
25
26       ENCAP_MPLS := mpls [ LABEL ] [ ttl TTL ]
27
28       GROUP := id[,weight[/...]
29
30

DESCRIPTION

32       ip nexthop is used to manipulate entries in the kernel's nexthop
33       tables.
34
35       ip nexthop add id ID
36              add new nexthop entry
37
38       ip nexthop replace id ID
39              change the configuration of a nexthop or add new one
40
41              via [ FAMILY ] ADDRESS
42                     the address of the nexthop router, in the address family
43                     FAMILY.  Address family must match address family of nex‐
44                     thop instance.
45
46              dev NAME
47                     is the output device.
48
49              onlink pretend that the nexthop is directly attached to this
50                     link, even if it does not match any interface prefix.
51
52              encap ENCAPTYPE ENCAPHDR
53                     attach tunnel encapsulation attributes to this route.
54
55                     ENCAPTYPE is a string specifying the supported encapsula‐
56                     tion type. Namely:
57
58                             mpls - encapsulation type MPLS
59
60                     ENCAPHDR is a set of encapsulation attributes specific to
61                     the ENCAPTYPE.
62
63                             mpls
64                               MPLSLABEL - mpls label stack with labels sepa‐
65                               rated by /
66
67
68                               ttl TTL - TTL to use for MPLS header or 0 to
69                               inherit from IP header
70
71
72              group GROUP
73                     create a nexthop group. Group specification is id with an
74                     optional weight (id,weight) and a '/' as a separator
75                     between entries.
76
77              blackhole
78                     create a blackhole nexthop
79
80              fdb    nexthop and nexthop groups for use with layer-2 fdb
81                     entries.  A fdb nexthop group can only have fdb nexthops.
82                     Example: Used to represent a vxlan remote vtep ip.
83                     layer-2 vxlan fdb entry pointing to an ecmp nexthop group
84                     containing multiple remote vtep ips.
85
86
87       ip nexthop delete id ID
88              delete nexthop with given id.
89
90
91       ip nexthop show
92              show the contents of the nexthop table or the nexthops selected
93              by some criteria.
94
95              dev DEV
96                     show the nexthops using the given device.
97
98              vrf NAME
99                     show the nexthops using devices associated with the vrf
100                     name
101
102              master DEV
103                     show the nexthops using devices enslaved to given master
104                     device
105
106              groups show only nexthop groups
107
108              fdb    show only fdb nexthops and nexthop groups
109
110       ip nexthop flush
111              flushes nexthops selected by some criteria. Criteria options are
112              the same as show.
113
114
115       ip nexthop get id ID
116              get a single nexthop by id
117
118

EXAMPLES

120       ip nexthop ls
121           Show all nexthop entries in the kernel.
122
123       ip nexthop add id 1 via 192.168.1.1 dev eth0
124           Adds an IPv4 nexthop with id 1 using the gateway 192.168.1.1 out
125           device eth0.
126
127       ip nexthop add id 2 encap mpls 200/300 via 10.1.1.1 dev eth0
128           Adds an IPv4 nexthop with mpls encapsulation attributes attached to
129           it.
130
131       ip nexthop add id 3 group 1/2
132           Adds a nexthop with id 3. The nexthop is a group using nexthops
133           with ids 1 and 2 at equal weight.
134
135       ip nexthop add id 4 group 1,5/2,11
136           Adds a nexthop with id 4. The nexthop is a group using nexthops
137           with ids 1 and 2 with nexthop 1 at weight 5 and nexthop 2 at weight
138           11.
139
140       ip nexthop add id 5 via 192.168.1.2 fdb
141           Adds a fdb nexthop with id 5.
142
143       ip nexthop add id 7 group 5/6 fdb
144           Adds a fdb nexthop group with id 7. A fdb nexthop group can only
145           have fdb nexthops.
146

SEE ALSO

148       ip(8)
149
150

AUTHOR

152       Original Manpage by David Ahern <dsahern@kernel.org>
153
154
155
156iproute2                          30 May 2019                    IP-NEXTHOP(8)
Impressum