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 [ tos TOS ] [ ttl TTL ]
69
70       ENCAP_BPF := bpf [ in PROG ] [ out PROG ] [ xmit PROG ] [ headroom SIZE
71               ]
72
73       ENCAP_SEG6 := seg6 mode [ encap | inline | l2encap ] segs SEGMENTS [
74               hmac KEYID ]
75
76       ENCAP_SEG6LOCAL := seg6local action SEG6_ACTION [ SEG6_ACTION_PARAM ]
77
78       ROUTE_GET_FLAGS :=  [ fibmatch  ]
79
80

DESCRIPTION

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

NOTES

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

EXAMPLES

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

SEE ALSO

800       ip(8)
801
802

AUTHOR

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