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

NAME

6       ip-route - routing table management
7

SYNOPSIS

9       ip [ ip-OPTIONS ] route  { COMMAND | help }
10
11
12       ip route { show | flush } SELECTOR
13
14       ip route save SELECTOR
15
16       ip route restore
17
18       ip route get ROUTE_GET_FLAGS ADDRESS [ from ADDRESS iif STRING  ] [ oif
19               STRING ] [ mark MARK ] [ tos TOS ] [ vrf NAME ] [ ipproto PRO‐
20               TOCOL ] [ sport NUMBER ] [ dport NUMBER ]
21
22       ip route { add | del | change | append | replace } ROUTE
23
24       SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ] [ table
25               TABLE_ID ] [ vrf NAME ] [ proto RTPROTO ] [ type TYPE ] [ scope
26               SCOPE ]
27
28       ROUTE := NODE_SPEC [ INFO_SPEC ]
29
30       NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ] [ table TABLE_ID ] [ proto
31               RTPROTO ] [ scope SCOPE ] [ metric METRIC ] [ ttl-propagate {
32               enabled | disabled } ]
33
34       INFO_SPEC := { NH | nhid ID } OPTIONS FLAGS [ nexthop NH ] ...
35
36       NH := [ encap ENCAP ] [ via [ FAMILY ] ADDRESS ] [ dev STRING ] [
37               weight NUMBER ] NHFLAGS
38
39       FAMILY := [ inet | inet6 | mpls | bridge | link ]
40
41       OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ]
42               rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ] [ window NUM‐
43               BER ] [ cwnd NUMBER ] [ ssthresh NUMBER ] [ realms REALM ] [
44               rto_min TIME ] [ initcwnd NUMBER ] [ initrwnd NUMBER ] [ fea‐
45               tures FEATURES ] [ quickack BOOL ] [ congctl NAME ] [ pref PREF
46               ] [ expires TIME ] [ fastopen_no_cookie BOOL ]
47
48       TYPE := [ unicast | local | broadcast | multicast | throw | unreachable
49               | prohibit | blackhole | nat ]
50
51       TABLE_ID := [ local| main | default | all | NUMBER ]
52
53       SCOPE := [ host | link | global | NUMBER ]
54
55       NHFLAGS := [ onlink | pervasive ]
56
57       RTPROTO := [ kernel | boot | static | NUMBER ]
58
59       FEATURES := [ ecn | ]
60
61       PREF := [ low | medium | high ]
62
63       ENCAP := [ ENCAP_MPLS | ENCAP_IP | ENCAP_BPF | ENCAP_SEG6 |
64               ENCAP_SEG6LOCAL ]
65
66       ENCAP_MPLS := mpls [ LABEL ] [ ttl TTL ]
67
68       ENCAP_IP := ip id TUNNEL_ID dst REMOTE_IP [ src SRC ] [ tos TOS ] [ ttl
69               TTL ]
70
71       ENCAP_BPF := bpf [ in PROG ] [ out PROG ] [ xmit PROG ] [ headroom SIZE
72               ]
73
74       ENCAP_SEG6 := seg6 mode [ encap | inline | l2encap ] segs SEGMENTS [
75               hmac KEYID ]
76
77       ENCAP_SEG6LOCAL := seg6local action SEG6_ACTION [ SEG6_ACTION_PARAM ]
78
79       ROUTE_GET_FLAGS :=  [ fibmatch  ]
80
81

DESCRIPTION

83       ip route is used to manipulate entries in the kernel routing tables.
84
85       Route types:
86
87               unicast - the route entry describes real paths to the destina‐
88               tions covered by the route prefix.
89
90
91               unreachable - these destinations are unreachable. Packets are
92               discarded and the ICMP message host unreachable is generated.
93               The local senders get an EHOSTUNREACH error.
94
95
96               blackhole - these destinations are unreachable. Packets are
97               discarded silently.  The local senders get an EINVAL error.
98
99
100               prohibit - these destinations are unreachable. Packets are dis‐
101               carded and the ICMP message communication administratively pro‐
102               hibited is generated. The local senders get an EACCES error.
103
104
105               local - the destinations are assigned to this host. The packets
106               are looped back and delivered locally.
107
108
109               broadcast - the destinations are broadcast addresses. The pack‐
110               ets are sent as link broadcasts.
111
112
113               throw - a special control route used together with policy
114               rules. If such a route is selected, lookup in this table is
115               terminated pretending that no route was found. Without policy
116               routing it is equivalent to the absence of the route in the
117               routing table. The packets are dropped and the ICMP message net
118               unreachable is generated. The local senders get an ENETUNREACH
119               error.
120
121
122               nat - a special NAT route. Destinations covered by the prefix
123               are considered to be dummy (or external) addresses which
124               require translation to real (or internal) ones before forward‐
125               ing. The addresses to translate to are selected with the
126               attribute via.  Warning: Route NAT is no longer supported in
127               Linux 2.6.
128
129
130               anycast - not implemented the destinations are anycast
131               addresses assigned to this host. They are mainly equivalent to
132               local with one difference: such addresses are invalid when used
133               as the source address of any packet.
134
135
136               multicast - a special type used for multicast routing. It is
137               not present in normal routing tables.
138
139
140       Route tables: Linux-2.x can pack routes into several routing tables
141       identified by a number in the range from 1 to 2^32-1 or by name from
142       the file /etc/iproute2/rt_tables By default all normal routes are
143       inserted into the main table (ID 254) and the kernel only uses this ta‐
144       ble when calculating routes.  Values (0, 253, 254, and 255) are
145       reserved for built-in use.
146
147
148       Actually, one other table always exists, which is invisible but even
149       more important. It is the local table (ID 255). This table consists of
150       routes for local and broadcast addresses. The kernel maintains this ta‐
151       ble automatically and the administrator usually need not modify it or
152       even look at it.
153
154       The multiple routing tables enter the game when policy routing is used.
155
156
157       ip route add
158              add new route
159
160       ip route change
161              change route
162
163       ip route replace
164              change or add new one
165
166              to TYPE PREFIX (default)
167                     the destination prefix of the route. If TYPE is omitted,
168                     ip assumes type unicast.  Other values of TYPE are listed
169                     above.  PREFIX is an IP or IPv6 address optionally fol‐
170                     lowed by a slash and the prefix length. If the length of
171                     the prefix is missing, ip assumes a full-length host
172                     route. There is also a special PREFIX default - which is
173                     equivalent to IP 0/0 or to IPv6 ::/0.
174
175
176              tos TOS
177
178              dsfield TOS
179                     the Type Of Service (TOS) key. This key has no associated
180                     mask and the longest match is understood as: First, com‐
181                     pare the TOS of the route and of the packet. If they are
182                     not equal, then the packet may still match a route with a
183                     zero TOS.  TOS is either an 8 bit hexadecimal number or
184                     an identifier from /etc/iproute2/rt_dsfield.
185
186
187              metric NUMBER
188
189              preference NUMBER
190                     the preference value of the route.  NUMBER is an arbi‐
191                     trary 32bit number, where routes with lower values are
192                     preferred.
193
194
195              table TABLEID
196                     the table to add this route to.  TABLEID may be a number
197                     or a string from the file /etc/iproute2/rt_tables.  If
198                     this parameter is omitted, ip assumes the main table,
199                     with the exception of local, broadcast and nat routes,
200                     which are put into the local table by default.
201
202
203              vrf NAME
204                     the vrf name to add this route to. Implicitly means the
205                     table associated with the VRF.
206
207
208              dev NAME
209                     the output device name.
210
211
212              via [ FAMILY ] ADDRESS
213                     the address of the nexthop router, in the address family
214                     FAMILY.  Actually, the sense of this field depends on the
215                     route type.  For normal unicast routes it is either the
216                     true next hop router or, if it is a direct route
217                     installed in BSD compatibility mode, it can be a local
218                     address of the interface. For NAT routes it is the first
219                     address of the block of translated IP destinations.
220
221
222              src ADDRESS
223                     the source address to prefer when sending to the destina‐
224                     tions covered by the route prefix.
225
226
227              realm REALMID
228                     the realm to which this route is assigned.  REALMID may
229                     be a number or a string from the file
230                     /etc/iproute2/rt_realms.
231
232
233              mtu MTU
234
235              mtu lock MTU
236                     the MTU along the path to the destination. If the modi‐
237                     fier lock is not used, the MTU may be updated by the ker‐
238                     nel due to Path MTU Discovery. If the modifier lock is
239                     used, no path MTU discovery will be tried, all packets
240                     will be sent without the DF bit in IPv4 case or frag‐
241                     mented to MTU for IPv6.
242
243
244              window NUMBER
245                     the maximal window for TCP to advertise to these destina‐
246                     tions, measured in bytes. It limits maximal data bursts
247                     that our TCP peers are allowed to send to us.
248
249
250              rtt TIME
251                     the initial RTT ('Round Trip Time') estimate. If no suf‐
252                     fix is specified the units are raw values passed directly
253                     to the routing code to maintain compatibility with previ‐
254                     ous releases.  Otherwise if a suffix of s, sec or secs is
255                     used to specify seconds and ms, msec or msecs to specify
256                     milliseconds.
257
258
259
260              rttvar TIME (Linux 2.3.15+ only)
261                     the initial RTT variance estimate. Values are specified
262                     as with rtt above.
263
264
265              rto_min TIME (Linux 2.6.23+ only)
266                     the minimum TCP Retransmission TimeOut to use when commu‐
267                     nicating with this destination. Values are specified as
268                     with rtt above.
269
270
271              ssthresh NUMBER (Linux 2.3.15+ only)
272                     an estimate for the initial slow start threshold.
273
274
275              cwnd NUMBER (Linux 2.3.15+ only)
276                     the clamp for congestion window. It is ignored if the
277                     lock flag is not used.
278
279
280              initcwnd NUMBER (Linux 2.5.70+ only)
281                     the initial congestion window size for connections to
282                     this destination.  Actual window size is this value mul‐
283                     tiplied by the MSS (``Maximal Segment Size'') for same
284                     connection. The default is zero, meaning to use the val‐
285                     ues specified in RFC2414.
286
287
288              initrwnd NUMBER (Linux 2.6.33+ only)
289                     the initial receive window size for connections to this
290                     destination.  Actual window size is this value multiplied
291                     by the MSS of the connection.  The default value is zero,
292                     meaning to use Slow Start value.
293
294
295              features FEATURES (Linux3.18+only)
296                     Enable or disable per-route features. Only available fea‐
297                     ture at this time is ecn to enable explicit congestion
298                     notification when initiating connections to the given
299                     destination network.  When responding to a connection
300                     request from the given network, ecn will also be used
301                     even if the net.ipv4.tcp_ecn sysctl is set to 0.
302
303
304              quickack BOOL (Linux 3.11+ only)
305                     Enable or disable quick ack for connections to this des‐
306                     tination.
307
308
309              fastopen_no_cookie BOOL (Linux 4.15+ only)
310                     Enable TCP Fastopen without a cookie for connections to
311                     this destination.
312
313
314              congctl NAME (Linux 3.20+ only)
315
316              congctl lock NAME (Linux 3.20+ only)
317                     Sets a specific TCP congestion control algorithm only for
318                     a given destination.  If not specified, Linux keeps the
319                     current global default TCP congestion control algorithm,
320                     or the one set from the application. If the modifier lock
321                     is not used, an application may nevertheless overwrite
322                     the suggested congestion control algorithm for that des‐
323                     tination. If the modifier lock is used, then an applica‐
324                     tion is not allowed to overwrite the specified congestion
325                     control algorithm for that destination, thus it will be
326                     enforced/guaranteed to use the proposed algorithm.
327
328
329              advmss NUMBER (Linux 2.3.15+ only)
330                     the MSS ('Maximal Segment Size') to advertise to these
331                     destinations when establishing TCP connections. If it is
332                     not given, Linux uses a default value calculated from the
333                     first hop device MTU.  (If the path to these destination
334                     is asymmetric, this guess may be wrong.)
335
336
337              reordering NUMBER (Linux 2.3.15+ only)
338                     Maximal reordering on the path to this destination.  If
339                     it is not given, Linux uses the value selected with
340                     sysctl variable net/ipv4/tcp_reordering.
341
342
343              nexthop NEXTHOP
344                     the nexthop of a multipath route.  NEXTHOP is a complex
345                     value with its own syntax similar to the top level argu‐
346                     ment lists:
347
348                             via [ FAMILY ] ADDRESS - is the nexthop router.
349
350
351                             dev NAME - is the output device.
352
353
354                             weight NUMBER - is a weight for this element of a
355                             multipath route reflecting its relative bandwidth
356                             or quality.
357
358                     The internal buffer used in iproute2 limits the maximum
359                     number of nexthops that may be specified in one go. If
360                     only ADDRESS is given, the current buffer size allows for
361                     144 IPv6 nexthops and 253 IPv4 ones. For IPv4, this
362                     effectively limits the number of nexthops possible per
363                     route. With IPv6, further nexthops may be appended to the
364                     same route via ip route append command.
365
366
367              scope SCOPE_VAL
368                     the scope of the destinations covered by the route pre‐
369                     fix.  SCOPE_VAL may be a number or a string from the file
370                     /etc/iproute2/rt_scopes.  If this parameter is omitted,
371                     ip assumes scope global for all gatewayed unicast routes,
372                     scope link for direct unicast and broadcast routes and
373                     scope host for local routes.
374
375
376              protocol RTPROTO
377                     the routing protocol identifier of this route.  RTPROTO
378                     may be a number or a string from the file
379                     /etc/iproute2/rt_protos.  If the routing protocol ID is
380                     not given, ip assumes protocol boot (i.e. it assumes the
381                     route was added by someone who doesn't understand what
382                     they are doing). Several protocol values have a fixed
383                     interpretation.  Namely:
384
385                             redirect - the route was installed due to an ICMP
386                             redirect.
387
388
389                             kernel - the route was installed by the kernel
390                             during autoconfiguration.
391
392
393                             boot - the route was installed during the bootup
394                             sequence.  If a routing daemon starts, it will
395                             purge all of them.
396
397
398                             static - the route was installed by the adminis‐
399                             trator to override dynamic routing. Routing dae‐
400                             mon will respect them and, probably, even adver‐
401                             tise them to its peers.
402
403
404                             ra - the route was installed by Router Discovery
405                             protocol.
406
407
408                     The rest of the values are not reserved and the adminis‐
409                     trator is free to assign (or not to assign) protocol
410                     tags.
411
412
413              onlink pretend that the nexthop is directly attached to this
414                     link, even if it does not match any interface prefix.
415
416
417              pref PREF
418                     the IPv6 route preference.  PREF is a string specifying
419                     the route preference as defined in RFC4191 for Router
420                     Discovery messages. Namely:
421
422                             low - the route has a lowest priority
423
424
425                             medium - the route has a default priority
426
427
428                             high - the route has a highest priority
429
430
431
432              nhid ID
433                     use nexthop object with given id as nexthop specifica‐
434                     tion.
435
436
437              encap ENCAPTYPE ENCAPHDR
438                     attach tunnel encapsulation attributes to this route.
439
440                     ENCAPTYPE is a string specifying the supported encapsula‐
441                     tion type. Namely:
442
443                             mpls - encapsulation type MPLS
444
445                             ip - IP encapsulation (Geneve, GRE, VXLAN, ...)
446
447                             bpf - Execution of BPF program
448
449                             seg6 - encapsulation type IPv6 Segment Routing
450
451                             seg6local - local SRv6 segment processing
452
453                     ENCAPHDR is a set of encapsulation attributes specific to
454                     the ENCAPTYPE.
455
456                             mpls
457                               MPLSLABEL - mpls label stack with labels sepa‐
458                               rated by /
459
460
461                               ttl TTL - TTL to use for MPLS header or 0 to
462                               inherit from IP header
463
464
465                             ip
466                               id TUNNEL_ID dst REMOTE_IP [ src SRC ] [ tos
467                               TOS ] [ ttl TTL ] [ key ] [ csum ] [ seq ]
468
469
470                             bpf
471                               in PROG - BPF program to execute for incoming
472                               packets
473
474
475                               out PROG - BPF program to execute for outgoing
476                               packets
477
478
479                               xmit PROG - BPF program to execute for trans‐
480                               mitted packets
481
482
483                               headroom SIZE - Size of header BPF program will
484                               attach (xmit)
485
486
487                             seg6
488                               mode inline - Directly insert Segment Routing
489                               Header after IPv6 header
490
491
492                               mode encap - Encapsulate packet in an outer
493                               IPv6 header with SRH
494
495
496                               mode l2encap - Encapsulate ingress L2 frame
497                               within an outer IPv6 header and SRH
498
499
500                               SEGMENTS - List of comma-separated IPv6
501                               addresses
502
503
504                               KEYID - Numerical value in decimal representa‐
505                               tion. See ip-sr(8).
506
507
508                             seg6local
509                               SEG6_ACTION [ SEG6_ACTION_PARAM ] - Operation
510                               to perform on matching packets.  The following
511                               actions are currently supported (Linux 4.14+
512                               only).
513
514                                 End - Regular SRv6 processing as intermediate
515                                 segment endpoint.  This action only accepts
516                                 packets with a non-zero Segments Left value.
517                                 Other matching packets are dropped.
518
519                                 End.X nh6 NEXTHOP - Regular SRv6 processing
520                                 as intermediate segment endpoint.  Addition‐
521                                 ally, forward processed packets to given
522                                 next-hop.  This action only accepts packets
523                                 with a non-zero Segments Left value. Other
524                                 matching packets are dropped.
525
526                                 End.DX6 nh6 NEXTHOP - Decapsulate inner IPv6
527                                 packet and forward it to the specified next-
528                                 hop. If the argument is set to ::, then the
529                                 next-hop is selected according to the local
530                                 selection rules. This action only accepts
531                                 packets with either a zero Segments Left
532                                 value or no SRH at all, and an inner IPv6
533                                 packet. Other matching packets are dropped.
534
535                                 End.B6 srh segs SEGMENTS [ hmac KEYID ] -
536                                 Insert the specified SRH immediately after
537                                 the IPv6 header, update the DA with the first
538                                 segment of the newly inserted SRH, then for‐
539                                 ward the resulting packet. The original SRH
540                                 is not modified. This action only accepts
541                                 packets with a non-zero Segments Left value.
542                                 Other matching packets are dropped.
543
544                                 End.B6.Encaps srh segs SEGMENTS [ hmac KEYID
545                                 ] - Regular SRv6 processing as intermediate
546                                 segment endpoint.  Additionally, encapsulate
547                                 the matching packet within an outer IPv6
548                                 header followed by the specified SRH. The
549                                 destination address of the outer IPv6 header
550                                 is set to the first segment of the new SRH.
551                                 The source address is set as described in ip-
552                                 sr(8).
553
554
555
556              expires TIME (Linux 4.4+ only)
557                     the route will be deleted after the expires time.  Only
558                     support IPv6 at present.
559
560
561              ttl-propagate { enabled | disabled }
562                     Control whether TTL should be propagated from any encap
563                     into the un-encapsulated packet, overriding any global
564                     configuration. Only supported for MPLS at present.
565
566
567       ip route delete
568              delete route
569              ip route del has the same arguments as ip route add, but their
570              semantics are a bit different.
571
572              Key values (to, tos, preference and table) select the route to
573              delete. If optional attributes are present, ip verifies that
574              they coincide with the attributes of the route to delete.  If no
575              route with the given key and attributes was found, ip route del
576              fails.
577
578
579       ip route show
580              list routes
581              the command displays the contents of the routing tables or the
582              route(s) selected by some criteria.
583
584
585              to SELECTOR (default)
586                     only select routes from the given range of destinations.
587                     SELECTOR consists of an optional modifier (root, match or
588                     exact) and a prefix.  root PREFIX selects routes with
589                     prefixes not shorter than PREFIX.  F.e.  root 0/0 selects
590                     the entire routing table.  match PREFIX selects routes
591                     with prefixes not longer than PREFIX.  F.e.  match
592                     10.0/16 selects 10.0/16, 10/8 and 0/0, but it does not
593                     select 10.1/16 and 10.0.0/24.  And exact PREFIX (or just
594                     PREFIX) selects routes with this exact prefix. If neither
595                     of these options are present, ip assumes root 0/0 i.e. it
596                     lists the entire table.
597
598
599              tos TOS
600
601              dsfield TOS
602                     only select routes with the given TOS.
603
604
605              table TABLEID
606                     show the routes from this table(s). The default setting
607                     is to show table main.  TABLEID may either be the ID of a
608                     real table or one of the special values:
609
610                             all - list all of the tables.
611
612                             cache - dump the routing cache.
613
614
615              vrf NAME
616                     show the routes for the table associated with the vrf
617                     name
618
619
620              cloned
621
622              cached list cloned routes i.e. routes which were dynamically
623                     forked from other routes because some route attribute
624                     (f.e. MTU) was updated.  Actually, it is equivalent to
625                     table cache.
626
627
628              from SELECTOR
629                     the same syntax as for to, but it binds the source
630                     address range rather than destinations.  Note that the
631                     from option only works with cloned routes.
632
633
634              protocol RTPROTO
635                     only list routes of this protocol.
636
637
638              scope SCOPE_VAL
639                     only list routes with this scope.
640
641
642              type TYPE
643                     only list routes of this type.
644
645
646              dev NAME
647                     only list routes going via this device.
648
649
650              via [ FAMILY ] PREFIX
651                     only list routes going via the nexthop routers selected
652                     by PREFIX.
653
654
655              src PREFIX
656                     only list routes with preferred source addresses selected
657                     by PREFIX.
658
659
660              realm REALMID
661
662              realms FROMREALM/TOREALM
663                     only list routes with these realms.
664
665
666       ip route flush
667              flush routing tables
668              this command flushes routes selected by some criteria.
669
670
671              The arguments have the same syntax and semantics as the argu‐
672              ments of ip route show, but routing tables are not listed but
673              purged. The only difference is the default action: show dumps
674              all the IP main routing table but flush prints the helper page.
675
676
677              With the -statistics option, the command becomes verbose. It
678              prints out the number of deleted routes and the number of rounds
679              made to flush the routing table. If the option is given twice,
680              ip route flush also dumps all the deleted routes in the format
681              described in the previous subsection.
682
683
684       ip route get
685              get a single route
686              this command gets a single route to a destination and prints its
687              contents exactly as the kernel sees it.
688
689
690              fibmatch
691                     Return full fib lookup matched route. Default is to
692                     return the resolved dst entry
693
694
695              to ADDRESS (default)
696                     the destination address.
697
698
699              from ADDRESS
700                     the source address.
701
702
703              tos TOS
704
705              dsfield TOS
706                     the Type Of Service.
707
708
709              iif NAME
710                     the device from which this packet is expected to arrive.
711
712
713              oif NAME
714                     force the output device on which this packet will be
715                     routed.
716
717
718              mark MARK
719                     the firewall mark (fwmark)
720
721
722              vrf NAME
723                     force the vrf device on which this packet will be routed.
724
725
726              ipproto PROTOCOL
727                     ip protocol as seen by the route lookup
728
729
730              sport NUMBER
731                     source port as seen by the route lookup
732
733
734              dport NUMBER
735                     destination port as seen by the route lookup
736
737
738              connected
739                     if no source address (option from) was given, relookup
740                     the route with the source set to the preferred address
741                     received from the first lookup.  If policy routing is
742                     used, it may be a different route.
743
744
745              Note that this operation is not equivalent to ip route show.
746              show shows existing routes.  get resolves them and creates new
747              clones if necessary. Essentially, get is equivalent to sending a
748              packet along this path.  If the iif argument is not given, the
749              kernel creates a route to output packets towards the requested
750              destination.  This is equivalent to pinging the destination with
751              a subsequent ip route ls cache, however, no packets are actually
752              sent. With the iif argument, the kernel pretends that a packet
753              arrived from this interface and searches for a path to forward
754              the packet.
755
756
757       ip route save
758              save routing table information to stdout
759              This command behaves like ip route show except that the output
760              is raw data suitable for passing to ip route restore.
761
762
763       ip route restore
764              restore routing table information from stdin
765              This command expects to read a data stream as returned from ip
766              route save.  It will attempt to restore the routing table infor‐
767              mation exactly as it was at the time of the save, so any trans‐
768              lation of information in the stream (such as device indexes)
769              must be done first. Any existing routes are left unchanged. Any
770              routes specified in the data stream that already exist in the
771              table will be ignored.
772
773

NOTES

775       Starting with Linux kernel version 3.6, there is no routing cache for
776       IPv4 anymore. Hence ip route show cached will never print any entries
777       on systems with this or newer kernel versions.
778
779

EXAMPLES

781       ip ro
782           Show all route entries in the kernel.
783
784       ip route add default via 192.168.1.1 dev eth0
785           Adds a default route (for all addresses) via the local gateway
786           192.168.1.1 that can be reached on device eth0.
787
788       ip route add 10.1.1.0/30 encap mpls 200/300 via 10.1.1.1 dev eth0
789           Adds an ipv4 route with mpls encapsulation attributes attached to
790           it.
791
792       ip -6 route add 2001:db8:1::/64 encap seg6 mode encap segs
793       2001:db8:42::1,2001:db8:ffff::2 dev eth0
794           Adds an IPv6 route with SRv6 encapsulation and two segments
795           attached.
796
797       ip route add 10.1.1.0/30 nhid 10
798           Adds an ipv4 route using nexthop object with id 10.
799

SEE ALSO

801       ip(8)
802
803

AUTHOR

805       Original Manpage by Michail Litvak <mci@owl.openwall.com>
806
807
808
809iproute2                          13 Dec 2012                      IP-ROUTE(8)
Impressum