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               ]
20
21       NH := { blackhole | [ via ADDRESS ] [ dev DEV ] [ onlink ] [ encap
22               ENCAP ] | group GROUP }
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
81       ip nexthop delete id ID
82              delete nexthop with given id.
83
84
85       ip nexthop show
86              show the contents of the nexthop table or the nexthops selected
87              by some criteria.
88
89              dev DEV
90                     show the nexthops using the given device.
91
92              vrf NAME
93                     show the nexthops using devices associated with the vrf
94                     name
95
96              master DEV
97                     show the nexthops using devices enslaved to given master
98                     device
99
100              groups show only nexthop groups
101
102       ip nexthop flush
103              flushes nexthops selected by some criteria. Criteria options are
104              the same as show.
105
106
107       ip nexthop get id ID
108              get a single nexthop by id
109
110

EXAMPLES

112       ip nexthop ls
113           Show all nexthop entries in the kernel.
114
115       ip nexthop add id 1 via 192.168.1.1 dev eth0
116           Adds an IPv4 nexthop with id 1 using the gateway 192.168.1.1 out
117           device eth0.
118
119       ip nexthop add id 2 encap mpls 200/300 via 10.1.1.1 dev eth0
120           Adds an IPv4 nexthop with mpls encapsulation attributes attached to
121           it.
122
123       ip nexthop add id 3 group 1/2
124           Adds a nexthop with id 3. The nexthop is a group using nexthops
125           with ids 1 and 2 at equal weight.
126
127       ip nexthop add id 4 group 1,5/2,11
128           Adds a nexthop with id 4. The nexthop is a group using nexthops
129           with ids 1 and 2 with nexthop 1 at weight 5 and nexthop 2 at weight
130           11.
131

SEE ALSO

133       ip(8)
134
135

AUTHOR

137       Original Manpage by David Ahern <dsahern@kernel.org>
138
139
140
141iproute2                          30 May 2019                    IP-NEXTHOP(8)
Impressum