2 * Copyright (C) 2002 Kunihiro Ishiguro
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
33 #include "zebra/zserv.h"
34 #include "zebra/zebra_vrf.h"
35 #include "zebra/zebra_rnh.h"
36 #include "zebra/redistribute.h"
37 #include "zebra/zebra_routemap.h"
39 extern int allow_delete
;
41 static int do_show_ip_route(struct vty
*vty
, const char *vrf_name
, safi_t safi
);
42 static void vty_show_ip_route_detail (struct vty
*vty
, struct route_node
*rn
,
45 /* General function for static route. */
47 zebra_static_ipv4 (struct vty
*vty
, safi_t safi
, int add_cmd
,
48 const char *dest_str
, const char *mask_str
,
49 const char *gate_str
, const char *flag_str
,
50 const char *tag_str
, const char *distance_str
,
51 const char *vrf_id_str
)
60 struct zebra_vrf
*zvrf
= NULL
;
61 unsigned int ifindex
= 0;
62 const char *ifname
= NULL
;
64 ret
= str2prefix (dest_str
, &p
);
67 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
71 /* Cisco like mask notation. */
74 ret
= inet_aton (mask_str
, &mask
);
77 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
80 p
.prefixlen
= ip_masklen (mask
);
83 /* Apply mask for given prefix. */
86 /* Administrative distance. */
88 distance
= atoi (distance_str
);
90 distance
= ZEBRA_STATIC_DISTANCE_DEFAULT
;
97 zvrf
= zebra_vrf_list_lookup_by_name (vrf_id_str
);
101 vty_out (vty
, "%% vrf %s is not defined%s", vrf_id_str
, VTY_NEWLINE
);
105 /* Null0 static route. */
106 if ((gate_str
!= NULL
) && (strncasecmp (gate_str
, "Null0", strlen (gate_str
)) == 0))
110 vty_out (vty
, "%% can not have flag %s with Null0%s", flag_str
, VTY_NEWLINE
);
114 static_add_ipv4 (safi
, &p
, NULL
, ifindex
, ifname
, ZEBRA_FLAG_BLACKHOLE
, tag
, distance
, zvrf
);
116 static_delete_ipv4 (safi
, &p
, NULL
, ifindex
, tag
, distance
, zvrf
);
122 switch(flag_str
[0]) {
125 SET_FLAG (flag
, ZEBRA_FLAG_REJECT
);
129 SET_FLAG (flag
, ZEBRA_FLAG_BLACKHOLE
);
132 vty_out (vty
, "%% Malformed flag %s %s", flag_str
, VTY_NEWLINE
);
137 if (gate_str
== NULL
)
140 static_add_ipv4 (safi
, &p
, NULL
, ifindex
, ifname
, flag
, tag
, distance
, zvrf
);
142 static_delete_ipv4 (safi
, &p
, NULL
, ifindex
, tag
, distance
, zvrf
);
147 /* When gateway is A.B.C.D format, gate is treated as nexthop
148 address other case gate is treated as interface name. */
149 ret
= inet_aton (gate_str
, &gate
);
152 struct interface
*ifp
= if_lookup_by_name_vrf (gate_str
, zvrf
->vrf_id
);
155 vty_out (vty
, "%% Unknown interface: %s%s", gate_str
, VTY_NEWLINE
);
156 ifindex
= IFINDEX_DELETED
;
159 ifindex
= ifp
->ifindex
;
164 static_add_ipv4 (safi
, &p
, ifindex
? NULL
: &gate
, ifindex
, ifname
, flag
, tag
, distance
, zvrf
);
166 static_delete_ipv4 (safi
, &p
, ifindex
? NULL
: &gate
, ifindex
, tag
, distance
, zvrf
);
171 /* Static unicast routes for multicast RPF lookup. */
172 DEFUN (ip_mroute_dist
,
174 "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255>",
176 "Configure static unicast route into MRIB for multicast RPF lookup\n"
177 "IP destination prefix (e.g. 10.0.0.0/8)\n"
179 "Nexthop interface name\n"
182 return zebra_static_ipv4 (vty
, SAFI_MULTICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, NULL
, argc
> 2 ? argv
[2] : NULL
, NULL
);
185 ALIAS (ip_mroute_dist
,
187 "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE)",
189 "Configure static unicast route into MRIB for multicast RPF lookup\n"
190 "IP destination prefix (e.g. 10.0.0.0/8)\n"
192 "Nexthop interface name\n")
194 DEFUN (no_ip_mroute_dist
,
195 no_ip_mroute_dist_cmd
,
196 "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255>",
198 "Configure static unicast route into MRIB for multicast RPF lookup\n"
199 "IP destination prefix (e.g. 10.0.0.0/8)\n"
201 "Nexthop interface name\n"
204 return zebra_static_ipv4 (vty
, SAFI_MULTICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, NULL
, argc
> 2 ? argv
[2] : NULL
, NULL
);
207 ALIAS (no_ip_mroute_dist
,
209 "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE)",
212 "Configure static unicast route into MRIB for multicast RPF lookup\n"
213 "IP destination prefix (e.g. 10.0.0.0/8)\n"
215 "Nexthop interface name\n")
217 DEFUN (ip_multicast_mode
,
218 ip_multicast_mode_cmd
,
219 "ip multicast rpf-lookup-mode (urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix)",
221 "Multicast options\n"
222 "RPF lookup behavior\n"
223 "Lookup in unicast RIB only\n"
224 "Lookup in multicast RIB only\n"
225 "Try multicast RIB first, fall back to unicast RIB\n"
226 "Lookup both, use entry with lower distance\n"
227 "Lookup both, use entry with longer prefix\n")
230 if (!strncmp (argv
[0], "u", 1))
231 multicast_mode_ipv4_set (MCAST_URIB_ONLY
);
232 else if (!strncmp (argv
[0], "mrib-o", 6))
233 multicast_mode_ipv4_set (MCAST_MRIB_ONLY
);
234 else if (!strncmp (argv
[0], "mrib-t", 6))
235 multicast_mode_ipv4_set (MCAST_MIX_MRIB_FIRST
);
236 else if (!strncmp (argv
[0], "low", 3))
237 multicast_mode_ipv4_set (MCAST_MIX_DISTANCE
);
238 else if (!strncmp (argv
[0], "lon", 3))
239 multicast_mode_ipv4_set (MCAST_MIX_PFXLEN
);
242 vty_out (vty
, "Invalid mode specified%s", VTY_NEWLINE
);
249 DEFUN (no_ip_multicast_mode
,
250 no_ip_multicast_mode_cmd
,
251 "no ip multicast rpf-lookup-mode (urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix)",
254 "Multicast options\n"
255 "RPF lookup behavior\n"
256 "Lookup in unicast RIB only\n"
257 "Lookup in multicast RIB only\n"
258 "Try multicast RIB first, fall back to unicast RIB\n"
259 "Lookup both, use entry with lower distance\n"
260 "Lookup both, use entry with longer prefix\n")
262 multicast_mode_ipv4_set (MCAST_NO_CONFIG
);
266 ALIAS (no_ip_multicast_mode
,
267 no_ip_multicast_mode_noarg_cmd
,
268 "no ip multicast rpf-lookup-mode",
271 "Multicast options\n"
272 "RPF lookup behavior\n")
279 "Display RPF information for multicast source\n")
281 return do_show_ip_route(vty
, VRF_DEFAULT_NAME
, SAFI_MULTICAST
);
284 DEFUN (show_ip_rpf_addr
,
285 show_ip_rpf_addr_cmd
,
286 "show ip rpf A.B.C.D",
289 "Display RPF information for multicast source\n"
290 "IP multicast source address (e.g. 10.0.0.0)\n")
293 struct route_node
*rn
;
297 ret
= inet_aton (argv
[0], &addr
);
300 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
304 rib
= rib_match_ipv4_multicast (addr
, &rn
);
307 vty_show_ip_route_detail (vty
, rn
, 1);
309 vty_out (vty
, "%% No match for RPF lookup%s", VTY_NEWLINE
);
314 /* Static route configuration. */
317 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
319 "Establish static routes\n"
320 "IP destination prefix (e.g. 10.0.0.0/8)\n"
321 "IP gateway address\n"
322 "IP gateway interface name\n"
325 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, NULL
,
331 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535>",
333 "Establish static routes\n"
334 "IP destination prefix (e.g. 10.0.0.0/8)\n"
335 "IP gateway address\n"
336 "IP gateway interface name\n"
338 "Set tag for this route\n"
341 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, argv
[2],
345 DEFUN (ip_route_flags
,
347 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
349 "Establish static routes\n"
350 "IP destination prefix (e.g. 10.0.0.0/8)\n"
351 "IP gateway address\n"
352 "IP gateway interface name\n"
353 "Emit an ICMP unreachable when matched\n"
354 "Silently discard pkts when matched\n")
356 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], NULL
,
360 DEFUN (ip_route_flags_tag
,
361 ip_route_flags_tag_cmd
,
362 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
364 "Establish static routes\n"
365 "IP destination prefix (e.g. 10.0.0.0/8)\n"
366 "IP gateway address\n"
367 "IP gateway interface name\n"
368 "Emit an ICMP unreachable when matched\n"
369 "Silently discard pkts when matched\n"
370 "Set tag for this route\n"
374 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], argv
[3],
378 DEFUN (ip_route_flags2
,
380 "ip route A.B.C.D/M (reject|blackhole)",
382 "Establish static routes\n"
383 "IP destination prefix (e.g. 10.0.0.0/8)\n"
384 "Emit an ICMP unreachable when matched\n"
385 "Silently discard pkts when matched\n")
387 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], NULL
,
391 DEFUN (ip_route_flags2_tag
,
392 ip_route_flags2_tag_cmd
,
393 "ip route A.B.C.D/M (reject|blackhole) tag <1-65535>",
395 "Establish static routes\n"
396 "IP destination prefix (e.g. 10.0.0.0/8)\n"
397 "Emit an ICMP unreachable when matched\n"
398 "Silently discard pkts when matched\n"
399 "Set tag for this route\n"
403 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], argv
[2],
407 /* Mask as A.B.C.D format. */
408 DEFUN (ip_route_mask
,
410 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
412 "Establish static routes\n"
413 "IP destination prefix\n"
414 "IP destination prefix mask\n"
415 "IP gateway address\n"
416 "IP gateway interface name\n"
419 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
,
423 DEFUN (ip_route_mask_tag
,
424 ip_route_mask_tag_cmd
,
425 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535>",
427 "Establish static routes\n"
428 "IP destination prefix\n"
429 "IP destination prefix mask\n"
430 "IP gateway address\n"
431 "IP gateway interface name\n"
433 "Set tag for this route\n"
437 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3],
441 DEFUN (ip_route_mask_flags
,
442 ip_route_mask_flags_cmd
,
443 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
445 "Establish static routes\n"
446 "IP destination prefix\n"
447 "IP destination prefix mask\n"
448 "IP gateway address\n"
449 "IP gateway interface name\n"
450 "Emit an ICMP unreachable when matched\n"
451 "Silently discard pkts when matched\n")
453 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
,
457 DEFUN (ip_route_mask_flags_tag
,
458 ip_route_mask_flags_tag_cmd
,
459 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
461 "Establish static routes\n"
462 "IP destination prefix\n"
463 "IP destination prefix mask\n"
464 "IP gateway address\n"
465 "IP gateway interface name\n"
466 "Emit an ICMP unreachable when matched\n"
467 "Silently discard pkts when matched\n"
468 "Set tag for this route\n"
472 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4],
476 DEFUN (ip_route_mask_flags2
,
477 ip_route_mask_flags2_cmd
,
478 "ip route A.B.C.D A.B.C.D (reject|blackhole)",
480 "Establish static routes\n"
481 "IP destination prefix\n"
482 "IP destination prefix mask\n"
483 "Emit an ICMP unreachable when matched\n"
484 "Silently discard pkts when matched\n")
486 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
,
490 DEFUN (ip_route_mask_flags2_tag
,
491 ip_route_mask_flags2_tag_cmd
,
492 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535>",
494 "Establish static routes\n"
495 "IP destination prefix\n"
496 "IP destination prefix mask\n"
497 "Emit an ICMP unreachable when matched\n"
498 "Silently discard pkts when matched\n"
499 "Set tag for this route\n"
502 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3],
506 /* Distance option value. */
507 DEFUN (ip_route_distance
,
508 ip_route_distance_cmd
,
509 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
511 "Establish static routes\n"
512 "IP destination prefix (e.g. 10.0.0.0/8)\n"
513 "IP gateway address\n"
514 "IP gateway interface name\n"
516 "Distance value for this route\n")
518 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, NULL
,
522 DEFUN (ip_route_tag_distance
,
523 ip_route_tag_distance_cmd
,
524 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
526 "Establish static routes\n"
527 "IP destination prefix (e.g. 10.0.0.0/8)\n"
528 "IP gateway address\n"
529 "IP gateway interface name\n"
531 "Set tag for this route\n"
533 "Distance value for this route\n")
536 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, argv
[2],
540 DEFUN (ip_route_flags_distance
,
541 ip_route_flags_distance_cmd
,
542 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
544 "Establish static routes\n"
545 "IP destination prefix (e.g. 10.0.0.0/8)\n"
546 "IP gateway address\n"
547 "IP gateway interface name\n"
548 "Emit an ICMP unreachable when matched\n"
549 "Silently discard pkts when matched\n"
550 "Distance value for this route\n")
552 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], NULL
,
556 DEFUN (ip_route_flags_tag_distance
,
557 ip_route_flags_tag_distance_cmd
,
558 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
560 "Establish static routes\n"
561 "IP destination prefix (e.g. 10.0.0.0/8)\n"
562 "IP gateway address\n"
563 "IP gateway interface name\n"
564 "Emit an ICMP unreachable when matched\n"
565 "Silently discard pkts when matched\n"
566 "Set tag for this route\n"
568 "Distance value for this route\n")
570 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], argv
[3],
574 DEFUN (ip_route_flags_distance2
,
575 ip_route_flags_distance2_cmd
,
576 "ip route A.B.C.D/M (reject|blackhole) <1-255>",
578 "Establish static routes\n"
579 "IP destination prefix (e.g. 10.0.0.0/8)\n"
580 "Emit an ICMP unreachable when matched\n"
581 "Silently discard pkts when matched\n"
582 "Distance value for this route\n")
584 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], NULL
,
588 DEFUN (ip_route_flags_tag_distance2
,
589 ip_route_flags_tag_distance2_cmd
,
590 "ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255>",
592 "Establish static routes\n"
593 "IP destination prefix (e.g. 10.0.0.0/8)\n"
594 "Emit an ICMP unreachable when matched\n"
595 "Silently discard pkts when matched\n"
596 "Set tag for this route\n"
598 "Distance value for this route\n")
600 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], argv
[2],
604 DEFUN (ip_route_mask_distance
,
605 ip_route_mask_distance_cmd
,
606 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
608 "Establish static routes\n"
609 "IP destination prefix\n"
610 "IP destination prefix mask\n"
611 "IP gateway address\n"
612 "IP gateway interface name\n"
614 "Distance value for this route\n")
616 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
,
620 DEFUN (ip_route_mask_tag_distance
,
621 ip_route_mask_tag_distance_cmd
,
622 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
624 "Establish static routes\n"
625 "IP destination prefix\n"
626 "IP destination prefix mask\n"
627 "IP gateway address\n"
628 "IP gateway interface name\n"
630 "Set tag for this route\n"
632 "Distance value for this route\n")
634 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3],
638 DEFUN (ip_route_mask_flags_tag_distance
,
639 ip_route_mask_flags_tag_distance_cmd
,
640 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
642 "Establish static routes\n"
643 "IP destination prefix\n"
644 "IP destination prefix mask\n"
645 "IP gateway address\n"
646 "IP gateway interface name\n"
647 "Set tag for this route\n"
649 "Distance value for this route\n"
650 "Emit an ICMP unreachable when matched\n"
651 "Silently discard pkts when matched\n")
653 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4],
658 DEFUN (ip_route_mask_flags_distance
,
659 ip_route_mask_flags_distance_cmd
,
660 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
662 "Establish static routes\n"
663 "IP destination prefix\n"
664 "IP destination prefix mask\n"
665 "IP gateway address\n"
666 "IP gateway interface name\n"
667 "Emit an ICMP unreachable when matched\n"
668 "Silently discard pkts when matched\n"
669 "Distance value for this route\n")
671 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
,
675 DEFUN (ip_route_mask_flags_distance2
,
676 ip_route_mask_flags_distance2_cmd
,
677 "ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255>",
679 "Establish static routes\n"
680 "IP destination prefix\n"
681 "IP destination prefix mask\n"
682 "Emit an ICMP unreachable when matched\n"
683 "Silently discard pkts when matched\n"
684 "Distance value for this route\n")
686 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
,
690 DEFUN (ip_route_mask_flags_tag_distance2
,
691 ip_route_mask_flags_tag_distance2_cmd
,
692 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255>",
694 "Establish static routes\n"
695 "IP destination prefix\n"
696 "IP destination prefix mask\n"
697 "Set tag for this route\n"
699 "Distance value for this route\n"
700 "Emit an ICMP unreachable when matched\n"
701 "Silently discard pkts when matched\n")
703 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3],
709 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
712 "Establish static routes\n"
713 "IP destination prefix (e.g. 10.0.0.0/8)\n"
714 "IP gateway address\n"
715 "IP gateway interface name\n"
718 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, NULL
,
722 DEFUN (no_ip_route_tag
,
724 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535>",
727 "Establish static routes\n"
728 "IP destination prefix (e.g. 10.0.0.0/8)\n"
729 "IP gateway address\n"
730 "IP gateway interface name\n"
732 "Tag of this route\n"
735 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, argv
[2],
740 no_ip_route_flags_cmd
,
741 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
744 "Establish static routes\n"
745 "IP destination prefix (e.g. 10.0.0.0/8)\n"
746 "IP gateway address\n"
747 "IP gateway interface name\n"
748 "Emit an ICMP unreachable when matched\n"
749 "Silently discard pkts when matched\n")
751 ALIAS (no_ip_route_tag
,
752 no_ip_route_flags_tag_cmd
,
753 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
756 "Establish static routes\n"
757 "IP destination prefix (e.g. 10.0.0.0/8)\n"
758 "IP gateway address\n"
759 "IP gateway interface name\n"
760 "Emit an ICMP unreachable when matched\n"
761 "Silently discard pkts when matched\n"
762 "Tag of this route\n"
765 DEFUN (no_ip_route_flags2
,
766 no_ip_route_flags2_cmd
,
767 "no ip route A.B.C.D/M (reject|blackhole)",
770 "Establish static routes\n"
771 "IP destination prefix (e.g. 10.0.0.0/8)\n"
772 "Emit an ICMP unreachable when matched\n"
773 "Silently discard pkts when matched\n")
775 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, NULL
, NULL
,
779 DEFUN (no_ip_route_flags2_tag
,
780 no_ip_route_flags2_tag_cmd
,
781 "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535>",
784 "Establish static routes\n"
785 "IP destination prefix (e.g. 10.0.0.0/8)\n"
786 "Emit an ICMP unreachable when matched\n"
787 "Silently discard pkts when matched\n"
788 "Tag of this route\n"
791 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, NULL
, argv
[1],
795 DEFUN (no_ip_route_mask
,
796 no_ip_route_mask_cmd
,
797 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
800 "Establish static routes\n"
801 "IP destination prefix\n"
802 "IP destination prefix mask\n"
803 "IP gateway address\n"
804 "IP gateway interface name\n"
807 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
,
811 DEFUN (no_ip_route_mask_tag
,
812 no_ip_route_mask_tag_cmd
,
813 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535>",
816 "Establish static routes\n"
817 "IP destination prefix\n"
818 "IP destination prefix mask\n"
819 "IP gateway address\n"
820 "IP gateway interface name\n"
822 "Tag of this route\n"
825 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3],
829 ALIAS (no_ip_route_mask
,
830 no_ip_route_mask_flags_cmd
,
831 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
834 "Establish static routes\n"
835 "IP destination prefix\n"
836 "IP destination prefix mask\n"
837 "IP gateway address\n"
838 "IP gateway interface name\n"
839 "Emit an ICMP unreachable when matched\n"
840 "Silently discard pkts when matched\n")
842 ALIAS (no_ip_route_mask_tag
,
843 no_ip_route_mask_flags_tag_cmd
,
844 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
847 "Establish static routes\n"
848 "IP destination prefix\n"
849 "IP destination prefix mask\n"
850 "IP gateway address\n"
851 "IP gateway interface name\n"
852 "Emit an ICMP unreachable when matched\n"
853 "Silently discard pkts when matched\n"
854 "Tag of this route\n"
857 DEFUN (no_ip_route_mask_flags2
,
858 no_ip_route_mask_flags2_cmd
,
859 "no ip route A.B.C.D A.B.C.D (reject|blackhole)",
862 "Establish static routes\n"
863 "IP destination prefix\n"
864 "IP destination prefix mask\n"
865 "Emit an ICMP unreachable when matched\n"
866 "Silently discard pkts when matched\n")
868 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, NULL
, NULL
,
872 DEFUN (no_ip_route_mask_flags2_tag
,
873 no_ip_route_mask_flags2_tag_cmd
,
874 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535>",
877 "Establish static routes\n"
878 "IP destination prefix\n"
879 "IP destination prefix mask\n"
880 "Emit an ICMP unreachable when matched\n"
881 "Silently discard pkts when matched\n"
882 "Tag of this route\n"
885 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, NULL
, argv
[2],
889 DEFUN (no_ip_route_distance
,
890 no_ip_route_distance_cmd
,
891 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
894 "Establish static routes\n"
895 "IP destination prefix (e.g. 10.0.0.0/8)\n"
896 "IP gateway address\n"
897 "IP gateway interface name\n"
899 "Distance value for this route\n")
901 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, NULL
,
905 DEFUN (no_ip_route_tag_distance
,
906 no_ip_route_tag_distance_cmd
,
907 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
910 "Establish static routes\n"
911 "IP destination prefix (e.g. 10.0.0.0/8)\n"
912 "IP gateway address\n"
913 "IP gateway interface name\n"
915 "Tag of this route\n"
917 "Distance value for this route\n")
919 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, argv
[2],
923 DEFUN (no_ip_route_flags_distance
,
924 no_ip_route_flags_distance_cmd
,
925 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
928 "Establish static routes\n"
929 "IP destination prefix (e.g. 10.0.0.0/8)\n"
930 "IP gateway address\n"
931 "IP gateway interface name\n"
932 "Emit an ICMP unreachable when matched\n"
933 "Silently discard pkts when matched\n"
934 "Distance value for this route\n")
936 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], argv
[2], NULL
,
940 DEFUN (no_ip_route_flags_tag_distance
,
941 no_ip_route_flags_tag_distance_cmd
,
942 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
945 "Establish static routes\n"
946 "IP destination prefix (e.g. 10.0.0.0/8)\n"
947 "IP gateway address\n"
948 "IP gateway interface name\n"
949 "Emit an ICMP unreachable when matched\n"
950 "Silently discard pkts when matched\n"
951 "Tag of this route\n"
953 "Distance value for this route\n")
955 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], argv
[2], argv
[3],
959 DEFUN (no_ip_route_flags_distance2
,
960 no_ip_route_flags_distance2_cmd
,
961 "no ip route A.B.C.D/M (reject|blackhole) <1-255>",
964 "Establish static routes\n"
965 "IP destination prefix (e.g. 10.0.0.0/8)\n"
966 "Emit an ICMP unreachable when matched\n"
967 "Silently discard pkts when matched\n"
968 "Distance value for this route\n")
970 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, argv
[1], NULL
,
974 DEFUN (no_ip_route_flags_tag_distance2
,
975 no_ip_route_flags_tag_distance2_cmd
,
976 "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255>",
979 "Establish static routes\n"
980 "IP destination prefix (e.g. 10.0.0.0/8)\n"
981 "Emit an ICMP unreachable when matched\n"
982 "Silently discard pkts when matched\n"
983 "Tag of this route\n"
985 "Distance value for this route\n")
987 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, argv
[1], argv
[2],
991 DEFUN (no_ip_route_mask_distance
,
992 no_ip_route_mask_distance_cmd
,
993 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
996 "Establish static routes\n"
997 "IP destination prefix\n"
998 "IP destination prefix mask\n"
999 "IP gateway address\n"
1000 "IP gateway interface name\n"
1002 "Distance value for this route\n")
1004 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
,
1008 DEFUN (no_ip_route_mask_tag_distance
,
1009 no_ip_route_mask_tag_distance_cmd
,
1010 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
1013 "Establish static routes\n"
1014 "IP destination prefix\n"
1015 "IP destination prefix mask\n"
1016 "IP gateway address\n"
1017 "IP gateway interface name\n"
1019 "Tag of this route\n"
1021 "Distance value for this route\n")
1023 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3],
1027 DEFUN (no_ip_route_mask_flags_distance
,
1028 no_ip_route_mask_flags_distance_cmd
,
1029 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
1032 "Establish static routes\n"
1033 "IP destination prefix\n"
1034 "IP destination prefix mask\n"
1035 "IP gateway address\n"
1036 "IP gateway interface name\n"
1037 "Emit an ICMP unreachable when matched\n"
1038 "Silently discard pkts when matched\n"
1039 "Distance value for this route\n")
1041 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
,
1045 DEFUN (no_ip_route_mask_flags_tag_distance
,
1046 no_ip_route_mask_flags_tag_distance_cmd
,
1047 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
1050 "Establish static routes\n"
1051 "IP destination prefix\n"
1052 "IP destination prefix mask\n"
1053 "IP gateway address\n"
1054 "IP gateway interface name\n"
1055 "Emit an ICMP unreachable when matched\n"
1056 "Silently discard pkts when matched\n"
1057 "Tag of this route\n"
1059 "Distance value for this route\n")
1061 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4],
1065 DEFUN (no_ip_route_mask_flags_distance2
,
1066 no_ip_route_mask_flags_distance2_cmd
,
1067 "no ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255>",
1070 "Establish static routes\n"
1071 "IP destination prefix\n"
1072 "IP destination prefix mask\n"
1073 "Emit an ICMP unreachable when matched\n"
1074 "Silently discard pkts when matched\n"
1075 "Distance value for this route\n")
1077 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
,
1081 DEFUN (no_ip_route_mask_flags_tag_distance2
,
1082 no_ip_route_mask_flags_tag_distance2_cmd
,
1083 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255>",
1086 "Establish static routes\n"
1087 "IP destination prefix\n"
1088 "IP destination prefix mask\n"
1089 "Emit an ICMP unreachable when matched\n"
1090 "Silently discard pkts when matched\n"
1091 "Tag of this route\n"
1093 "Distance value for this route\n")
1095 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3],
1099 /* Static route configuration. */
1100 DEFUN (ip_route_vrf
,
1102 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR
,
1104 "Establish static routes\n"
1105 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1106 "IP gateway address\n"
1107 "IP gateway interface name\n"
1111 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, NULL
, NULL
, argv
[2]);
1114 DEFUN (ip_route_tag_vrf
,
1115 ip_route_tag_vrf_cmd
,
1116 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR
,
1118 "Establish static routes\n"
1119 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1120 "IP gateway address\n"
1121 "IP gateway interface name\n"
1123 "Set tag for this route\n"
1127 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, argv
[2], NULL
, argv
[3]);
1130 DEFUN (ip_route_flags_vrf
,
1131 ip_route_flags_vrf_cmd
,
1132 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR
,
1134 "Establish static routes\n"
1135 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1136 "IP gateway address\n"
1137 "IP gateway interface name\n"
1138 "Emit an ICMP unreachable when matched\n"
1139 "Silently discard pkts when matched\n"
1142 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], NULL
, NULL
, argv
[3]);
1145 DEFUN (ip_route_flags_tag_vrf
,
1146 ip_route_flags_tag_vrf_cmd
,
1147 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1149 "Establish static routes\n"
1150 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1151 "IP gateway address\n"
1152 "IP gateway interface name\n"
1153 "Emit an ICMP unreachable when matched\n"
1154 "Silently discard pkts when matched\n"
1155 "Set tag for this route\n"
1160 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], argv
[3], NULL
, argv
[4]);
1163 DEFUN (ip_route_flags2_vrf
,
1164 ip_route_flags2_vrf_cmd
,
1165 "ip route A.B.C.D/M (reject|blackhole) " VRF_CMD_STR
,
1167 "Establish static routes\n"
1168 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1169 "Emit an ICMP unreachable when matched\n"
1170 "Silently discard pkts when matched\n"
1173 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], NULL
, NULL
, argv
[2]);
1176 DEFUN (ip_route_flags2_tag_vrf
,
1177 ip_route_flags2_tag_vrf_cmd
,
1178 "ip route A.B.C.D/M (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1180 "Establish static routes\n"
1181 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1182 "Emit an ICMP unreachable when matched\n"
1183 "Silently discard pkts when matched\n"
1184 "Set tag for this route\n"
1189 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], argv
[2], NULL
, argv
[3]);
1192 /* Mask as A.B.C.D format. */
1193 DEFUN (ip_route_mask_vrf
,
1194 ip_route_mask_vrf_cmd
,
1195 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR
,
1197 "Establish static routes\n"
1198 "IP destination prefix\n"
1199 "IP destination prefix mask\n"
1200 "IP gateway address\n"
1201 "IP gateway interface name\n"
1205 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
, NULL
, argv
[3]);
1208 DEFUN (ip_route_mask_tag_vrf
,
1209 ip_route_mask_tag_vrf_cmd
,
1210 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR
,
1212 "Establish static routes\n"
1213 "IP destination prefix\n"
1214 "IP destination prefix mask\n"
1215 "IP gateway address\n"
1216 "IP gateway interface name\n"
1218 "Set tag for this route\n"
1223 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], NULL
, argv
[4]);
1226 DEFUN (ip_route_mask_flags_vrf
,
1227 ip_route_mask_flags_vrf_cmd
,
1228 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR
,
1230 "Establish static routes\n"
1231 "IP destination prefix\n"
1232 "IP destination prefix mask\n"
1233 "IP gateway address\n"
1234 "IP gateway interface name\n"
1235 "Emit an ICMP unreachable when matched\n"
1236 "Silently discard pkts when matched\n"
1239 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, NULL
, argv
[4]);
1242 DEFUN (ip_route_mask_flags_tag_vrf
,
1243 ip_route_mask_flags_tag_vrf_cmd
,
1244 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1246 "Establish static routes\n"
1247 "IP destination prefix\n"
1248 "IP destination prefix mask\n"
1249 "IP gateway address\n"
1250 "IP gateway interface name\n"
1251 "Emit an ICMP unreachable when matched\n"
1252 "Silently discard pkts when matched\n"
1253 "Set tag for this route\n"
1258 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], NULL
, argv
[5]);
1261 DEFUN (ip_route_mask_flags2_vrf
,
1262 ip_route_mask_flags2_vrf_cmd
,
1263 "ip route A.B.C.D A.B.C.D (reject|blackhole) " VRF_CMD_STR
,
1265 "Establish static routes\n"
1266 "IP destination prefix\n"
1267 "IP destination prefix mask\n"
1268 "Emit an ICMP unreachable when matched\n"
1269 "Silently discard pkts when matched\n"
1272 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
, NULL
, argv
[3]);
1275 DEFUN (ip_route_mask_flags2_tag_vrf
,
1276 ip_route_mask_flags2_tag_vrf_cmd
,
1277 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1279 "Establish static routes\n"
1280 "IP destination prefix\n"
1281 "IP destination prefix mask\n"
1282 "Emit an ICMP unreachable when matched\n"
1283 "Silently discard pkts when matched\n"
1284 "Set tag for this route\n"
1288 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], NULL
, argv
[4]);
1291 /* Distance option value. */
1292 DEFUN (ip_route_distance_vrf
,
1293 ip_route_distance_vrf_cmd
,
1294 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR
,
1296 "Establish static routes\n"
1297 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1298 "IP gateway address\n"
1299 "IP gateway interface name\n"
1301 "Distance value for this route\n"
1304 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, NULL
, argv
[2], argv
[3]);
1307 DEFUN (ip_route_tag_distance_vrf
,
1308 ip_route_tag_distance_vrf_cmd
,
1309 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR
,
1311 "Establish static routes\n"
1312 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1313 "IP gateway address\n"
1314 "IP gateway interface name\n"
1316 "Set tag for this route\n"
1318 "Distance value for this route\n"
1322 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], NULL
, argv
[2], argv
[3], argv
[4]);
1325 DEFUN (ip_route_flags_distance_vrf
,
1326 ip_route_flags_distance_vrf_cmd
,
1327 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR
,
1329 "Establish static routes\n"
1330 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1331 "IP gateway address\n"
1332 "IP gateway interface name\n"
1333 "Emit an ICMP unreachable when matched\n"
1334 "Silently discard pkts when matched\n"
1335 "Distance value for this route\n"
1338 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], NULL
, argv
[3], argv
[4]);
1341 DEFUN (ip_route_flags_tag_distance_vrf
,
1342 ip_route_flags_tag_distance_vrf_cmd
,
1343 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1345 "Establish static routes\n"
1346 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1347 "IP gateway address\n"
1348 "IP gateway interface name\n"
1349 "Emit an ICMP unreachable when matched\n"
1350 "Silently discard pkts when matched\n"
1351 "Set tag for this route\n"
1353 "Distance value for this route\n"
1356 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, argv
[1], argv
[2], argv
[3], argv
[4],argv
[5]);
1359 DEFUN (ip_route_flags_distance2_vrf
,
1360 ip_route_flags_distance2_vrf_cmd
,
1361 "ip route A.B.C.D/M (reject|blackhole) <1-255> " VRF_CMD_STR
,
1363 "Establish static routes\n"
1364 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1365 "Emit an ICMP unreachable when matched\n"
1366 "Silently discard pkts when matched\n"
1367 "Distance value for this route\n"
1370 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], NULL
, argv
[2], argv
[3]);
1373 DEFUN (ip_route_flags_tag_distance2_vrf
,
1374 ip_route_flags_tag_distance2_vrf_cmd
,
1375 "ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1377 "Establish static routes\n"
1378 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1379 "Emit an ICMP unreachable when matched\n"
1380 "Silently discard pkts when matched\n"
1381 "Set tag for this route\n"
1383 "Distance value for this route\n"
1386 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], NULL
, NULL
, argv
[1], argv
[2], argv
[3], argv
[4]);
1389 DEFUN (ip_route_mask_distance_vrf
,
1390 ip_route_mask_distance_vrf_cmd
,
1391 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR
,
1393 "Establish static routes\n"
1394 "IP destination prefix\n"
1395 "IP destination prefix mask\n"
1396 "IP gateway address\n"
1397 "IP gateway interface name\n"
1399 "Distance value for this route\n"
1402 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
, argv
[3], argv
[4]);
1405 DEFUN (ip_route_mask_tag_distance_vrf
,
1406 ip_route_mask_tag_distance_vrf_cmd
,
1407 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR
,
1409 "Establish static routes\n"
1410 "IP destination prefix\n"
1411 "IP destination prefix mask\n"
1412 "IP gateway address\n"
1413 "IP gateway interface name\n"
1415 "Set tag for this route\n"
1417 "Distance value for this route\n"
1420 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], argv
[4], argv
[5]);
1423 DEFUN (ip_route_mask_flags_tag_distance_vrf
,
1424 ip_route_mask_flags_tag_distance_vrf_cmd
,
1425 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1427 "Establish static routes\n"
1428 "IP destination prefix\n"
1429 "IP destination prefix mask\n"
1430 "IP gateway address\n"
1431 "IP gateway interface name\n"
1432 "Set tag for this route\n"
1434 "Distance value for this route\n"
1435 "Emit an ICMP unreachable when matched\n"
1436 "Silently discard pkts when matched\n"
1439 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], argv
[5], argv
[6]);
1443 DEFUN (ip_route_mask_flags_distance_vrf
,
1444 ip_route_mask_flags_distance_vrf_cmd
,
1445 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR
,
1447 "Establish static routes\n"
1448 "IP destination prefix\n"
1449 "IP destination prefix mask\n"
1450 "IP gateway address\n"
1451 "IP gateway interface name\n"
1452 "Emit an ICMP unreachable when matched\n"
1453 "Silently discard pkts when matched\n"
1454 "Distance value for this route\n"
1457 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, argv
[4], argv
[5]);
1460 DEFUN (ip_route_mask_flags_distance2_vrf
,
1461 ip_route_mask_flags_distance2_vrf_cmd
,
1462 "ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255> " VRF_CMD_STR
,
1464 "Establish static routes\n"
1465 "IP destination prefix\n"
1466 "IP destination prefix mask\n"
1467 "Emit an ICMP unreachable when matched\n"
1468 "Silently discard pkts when matched\n"
1469 "Distance value for this route\n"
1472 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
, argv
[3], argv
[4]);
1475 DEFUN (ip_route_mask_flags_tag_distance2_vrf
,
1476 ip_route_mask_flags_tag_distance2_vrf_cmd
,
1477 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1479 "Establish static routes\n"
1480 "IP destination prefix\n"
1481 "IP destination prefix mask\n"
1482 "Set tag for this route\n"
1484 "Distance value for this route\n"
1485 "Emit an ICMP unreachable when matched\n"
1486 "Silently discard pkts when matched\n"
1489 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], argv
[4], argv
[5]);
1492 DEFUN (no_ip_route_vrf
,
1493 no_ip_route_vrf_cmd
,
1494 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR
,
1497 "Establish static routes\n"
1498 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1499 "IP gateway address\n"
1500 "IP gateway interface name\n"
1504 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, NULL
, NULL
, argv
[2]);
1507 DEFUN (no_ip_route_flags_vrf
,
1508 no_ip_route_flags_vrf_cmd
,
1509 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR
,
1512 "Establish static routes\n"
1513 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1514 "IP gateway address\n"
1515 "IP gateway interface name\n"
1516 "Emit an ICMP unreachable when matched\n"
1517 "Silently discard pkts when matched\n"
1520 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], argv
[2], NULL
, NULL
, argv
[3]);
1523 DEFUN (no_ip_route_tag_vrf
,
1524 no_ip_route_tag_vrf_cmd
,
1525 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR
,
1528 "Establish static routes\n"
1529 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1530 "IP gateway address\n"
1531 "IP gateway interface name\n"
1533 "Tag of this route\n"
1537 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, argv
[2], NULL
, argv
[3]);
1540 DEFUN (no_ip_route_flags_tag_vrf
,
1541 no_ip_route_flags_tag_vrf_cmd
,
1542 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1545 "Establish static routes\n"
1546 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1547 "IP gateway address\n"
1548 "IP gateway interface name\n"
1549 "Emit an ICMP unreachable when matched\n"
1550 "Silently discard pkts when matched\n"
1551 "Tag of this route\n"
1555 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], argv
[2], argv
[3], NULL
, argv
[4]);
1558 DEFUN (no_ip_route_flags2_vrf
,
1559 no_ip_route_flags2_vrf_cmd
,
1560 "no ip route A.B.C.D/M (reject|blackhole) " VRF_CMD_STR
,
1563 "Establish static routes\n"
1564 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1565 "Emit an ICMP unreachable when matched\n"
1566 "Silently discard pkts when matched\n"
1569 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, argv
[1], NULL
, NULL
, argv
[2]);
1572 DEFUN (no_ip_route_flags2_tag_vrf
,
1573 no_ip_route_flags2_tag_vrf_cmd
,
1574 "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1577 "Establish static routes\n"
1578 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1579 "Emit an ICMP unreachable when matched\n"
1580 "Silently discard pkts when matched\n"
1581 "Tag of this route\n"
1585 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, argv
[1], argv
[2], NULL
, argv
[3]);
1588 DEFUN (no_ip_route_mask_vrf
,
1589 no_ip_route_mask_vrf_cmd
,
1590 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR
,
1593 "Establish static routes\n"
1594 "IP destination prefix\n"
1595 "IP destination prefix mask\n"
1596 "IP gateway address\n"
1597 "IP gateway interface name\n"
1601 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
, NULL
, argv
[3]);
1604 DEFUN (no_ip_route_mask_flags_vrf
,
1605 no_ip_route_mask_flags_vrf_cmd
,
1606 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR
,
1609 "Establish static routes\n"
1610 "IP destination prefix\n"
1611 "IP destination prefix mask\n"
1612 "IP gateway address\n"
1613 "IP gateway interface name\n"
1614 "Emit an ICMP unreachable when matched\n"
1615 "Silently discard pkts when matched\n"
1618 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, NULL
, argv
[4]);
1621 DEFUN (no_ip_route_mask_tag_vrf
,
1622 no_ip_route_mask_tag_vrf_cmd
,
1623 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR
,
1626 "Establish static routes\n"
1627 "IP destination prefix\n"
1628 "IP destination prefix mask\n"
1629 "IP gateway address\n"
1630 "IP gateway interface name\n"
1632 "Tag of this route\n"
1636 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], NULL
, argv
[4]);
1639 DEFUN (no_ip_route_mask_flags_tag_vrf
,
1640 no_ip_route_mask_flags_tag_vrf_cmd
,
1641 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1644 "Establish static routes\n"
1645 "IP destination prefix\n"
1646 "IP destination prefix mask\n"
1647 "IP gateway address\n"
1648 "IP gateway interface name\n"
1649 "Emit an ICMP unreachable when matched\n"
1650 "Silently discard pkts when matched\n"
1651 "Tag of this route\n"
1655 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], NULL
, argv
[5]);
1658 DEFUN (no_ip_route_mask_flags2_vrf
,
1659 no_ip_route_mask_flags2_vrf_cmd
,
1660 "no ip route A.B.C.D A.B.C.D (reject|blackhole) " VRF_CMD_STR
,
1663 "Establish static routes\n"
1664 "IP destination prefix\n"
1665 "IP destination prefix mask\n"
1666 "Emit an ICMP unreachable when matched\n"
1667 "Silently discard pkts when matched\n"
1670 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
, NULL
, argv
[3]);
1673 DEFUN (no_ip_route_mask_flags2_tag_vrf
,
1674 no_ip_route_mask_flags2_tag_vrf_cmd
,
1675 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
1678 "Establish static routes\n"
1679 "IP destination prefix\n"
1680 "IP destination prefix mask\n"
1681 "Emit an ICMP unreachable when matched\n"
1682 "Silently discard pkts when matched\n"
1683 "Tag of this route\n"
1687 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], NULL
, argv
[4]);
1691 DEFUN (no_ip_route_distance_vrf
,
1692 no_ip_route_distance_vrf_cmd
,
1693 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR
,
1696 "Establish static routes\n"
1697 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1698 "IP gateway address\n"
1699 "IP gateway interface name\n"
1701 "Distance value for this route\n"
1704 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, NULL
, argv
[2], argv
[3]);
1707 DEFUN (no_ip_route_tag_distance_vrf
,
1708 no_ip_route_tag_distance_vrf_cmd
,
1709 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR
,
1712 "Establish static routes\n"
1713 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1714 "IP gateway address\n"
1715 "IP gateway interface name\n"
1717 "Tag of this route\n"
1719 "Distance value for this route\n"
1722 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], NULL
, argv
[2], argv
[3], argv
[4]);
1725 DEFUN (no_ip_route_flags_distance_vrf
,
1726 no_ip_route_flags_distance_vrf_cmd
,
1727 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR
,
1730 "Establish static routes\n"
1731 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1732 "IP gateway address\n"
1733 "IP gateway interface name\n"
1734 "Emit an ICMP unreachable when matched\n"
1735 "Silently discard pkts when matched\n"
1736 "Distance value for this route\n"
1739 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], argv
[2], NULL
, argv
[3], argv
[4]);
1742 DEFUN (no_ip_route_flags_tag_distance_vrf
,
1743 no_ip_route_flags_tag_distance_vrf_cmd
,
1744 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1747 "Establish static routes\n"
1748 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1749 "IP gateway address\n"
1750 "IP gateway interface name\n"
1751 "Emit an ICMP unreachable when matched\n"
1752 "Silently discard pkts when matched\n"
1753 "Tag of this route\n"
1755 "Distance value for this route\n"
1758 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, argv
[1], argv
[2], argv
[3], argv
[4],argv
[5]);
1761 DEFUN (no_ip_route_flags_distance2_vrf
,
1762 no_ip_route_flags_distance2_vrf_cmd
,
1763 "no ip route A.B.C.D/M (reject|blackhole) <1-255> " VRF_CMD_STR
,
1766 "Establish static routes\n"
1767 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1768 "Emit an ICMP unreachable when matched\n"
1769 "Silently discard pkts when matched\n"
1770 "Distance value for this route\n"
1773 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, argv
[1], NULL
, argv
[2], argv
[3]);
1776 DEFUN (no_ip_route_flags_tag_distance2_vrf
,
1777 no_ip_route_flags_tag_distance2_vrf_cmd
,
1778 "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1781 "Establish static routes\n"
1782 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1783 "Emit an ICMP unreachable when matched\n"
1784 "Silently discard pkts when matched\n"
1785 "Tag of this route\n"
1787 "Distance value for this route\n"
1790 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], NULL
, NULL
, argv
[1], argv
[2] , argv
[3], argv
[4]);
1793 DEFUN (no_ip_route_mask_distance_vrf
,
1794 no_ip_route_mask_distance_vrf_cmd
,
1795 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR
,
1798 "Establish static routes\n"
1799 "IP destination prefix\n"
1800 "IP destination prefix mask\n"
1801 "IP gateway address\n"
1802 "IP gateway interface name\n"
1804 "Distance value for this route\n"
1807 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
, argv
[3], argv
[4]);
1810 DEFUN (no_ip_route_mask_tag_distance_vrf
,
1811 no_ip_route_mask_tag_distance_vrf_cmd
,
1812 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR
,
1815 "Establish static routes\n"
1816 "IP destination prefix\n"
1817 "IP destination prefix mask\n"
1818 "IP gateway address\n"
1819 "IP gateway interface name\n"
1821 "Tag of this route\n"
1823 "Distance value for this route\n"
1826 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], argv
[4], argv
[5]);
1829 DEFUN (no_ip_route_mask_flags_distance_vrf
,
1830 no_ip_route_mask_flags_distance_vrf_cmd
,
1831 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR
,
1834 "Establish static routes\n"
1835 "IP destination prefix\n"
1836 "IP destination prefix mask\n"
1837 "IP gateway address\n"
1838 "IP gateway interface name\n"
1839 "Emit an ICMP unreachable when matched\n"
1840 "Silently discard pkts when matched\n"
1841 "Distance value for this route\n"
1844 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, argv
[4], argv
[5]);
1847 DEFUN (no_ip_route_mask_flags_tag_distance_vrf
,
1848 no_ip_route_mask_flags_tag_distance_vrf_cmd
,
1849 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1852 "Establish static routes\n"
1853 "IP destination prefix\n"
1854 "IP destination prefix mask\n"
1855 "IP gateway address\n"
1856 "IP gateway interface name\n"
1857 "Emit an ICMP unreachable when matched\n"
1858 "Silently discard pkts when matched\n"
1859 "Tag of this route\n"
1861 "Distance value for this route\n"
1864 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], argv
[5], argv
[6]);
1867 DEFUN (no_ip_route_mask_flags_distance2_vrf
,
1868 no_ip_route_mask_flags_distance2_vrf_cmd
,
1869 "no ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255> " VRF_CMD_STR
,
1872 "Establish static routes\n"
1873 "IP destination prefix\n"
1874 "IP destination prefix mask\n"
1875 "Emit an ICMP unreachable when matched\n"
1876 "Silently discard pkts when matched\n"
1877 "Distance value for this route\n"
1880 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
, argv
[3], argv
[4]);
1883 DEFUN (no_ip_route_mask_flags_tag_distance2_vrf
,
1884 no_ip_route_mask_flags_tag_distance2_vrf_cmd
,
1885 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
1888 "Establish static routes\n"
1889 "IP destination prefix\n"
1890 "IP destination prefix mask\n"
1891 "Emit an ICMP unreachable when matched\n"
1892 "Silently discard pkts when matched\n"
1893 "Tag of this route\n"
1895 "Distance value for this route\n"
1898 return zebra_static_ipv4 (vty
, SAFI_UNICAST
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], argv
[4], argv
[5]);
1901 /* New RIB. Detailed information for IPv4 route. */
1903 vty_show_ip_route_detail (struct vty
*vty
, struct route_node
*rn
, int mcast
)
1906 struct nexthop
*nexthop
, *tnexthop
;
1908 char buf
[PREFIX_STRLEN
];
1909 struct zebra_vrf
*zvrf
;
1911 RNODE_FOREACH_RIB (rn
, rib
)
1913 const char *mcast_info
= "";
1916 rib_table_info_t
*info
= rn
->table
->info
;
1917 mcast_info
= (info
->safi
== SAFI_MULTICAST
)
1918 ? " using Multicast RIB"
1919 : " using Unicast RIB";
1922 vty_out (vty
, "Routing entry for %s%s%s",
1923 prefix2str (&rn
->p
, buf
, sizeof(buf
)), mcast_info
,
1925 vty_out (vty
, " Known via \"%s", zebra_route_string (rib
->type
));
1927 vty_out (vty
, "[%d]", rib
->instance
);
1928 vty_out (vty
, "\"");
1929 vty_out (vty
, ", distance %u, metric %u", rib
->distance
, rib
->metric
);
1931 vty_out (vty
, ", tag %d", rib
->tag
);
1932 if (rib
->vrf_id
!= VRF_DEFAULT
)
1934 zvrf
= vrf_info_lookup(rib
->vrf_id
);
1935 vty_out (vty
, ", vrf %s", zvrf
->name
);
1937 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
))
1938 vty_out (vty
, ", best");
1940 vty_out (vty
, ", refcnt %ld", rib
->refcnt
);
1941 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_BLACKHOLE
))
1942 vty_out (vty
, ", blackhole");
1943 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_REJECT
))
1944 vty_out (vty
, ", reject");
1945 vty_out (vty
, "%s", VTY_NEWLINE
);
1947 #define ONE_DAY_SECOND 60*60*24
1948 #define ONE_WEEK_SECOND 60*60*24*7
1949 if (rib
->type
== ZEBRA_ROUTE_RIP
1950 || rib
->type
== ZEBRA_ROUTE_OSPF
1951 || rib
->type
== ZEBRA_ROUTE_ISIS
1952 || rib
->type
== ZEBRA_ROUTE_TABLE
1953 || rib
->type
== ZEBRA_ROUTE_BGP
)
1958 uptime
= time (NULL
);
1959 uptime
-= rib
->uptime
;
1960 tm
= gmtime (&uptime
);
1962 vty_out (vty
, " Last update ");
1964 if (uptime
< ONE_DAY_SECOND
)
1965 vty_out (vty
, "%02d:%02d:%02d",
1966 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
1967 else if (uptime
< ONE_WEEK_SECOND
)
1968 vty_out (vty
, "%dd%02dh%02dm",
1969 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
1971 vty_out (vty
, "%02dw%dd%02dh",
1973 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
1974 vty_out (vty
, " ago%s", VTY_NEWLINE
);
1977 for (ALL_NEXTHOPS_RO(rib
->nexthop
, nexthop
, tnexthop
, recursing
))
1981 vty_out (vty
, " %c%s",
1982 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
) ? '*' : ' ',
1983 recursing
? " " : "");
1985 switch (nexthop
->type
)
1987 case NEXTHOP_TYPE_IPV4
:
1988 case NEXTHOP_TYPE_IPV4_IFINDEX
:
1989 vty_out (vty
, " %s", inet_ntoa (nexthop
->gate
.ipv4
));
1990 if (nexthop
->ifindex
)
1991 vty_out (vty
, ", via %s",
1992 ifindex2ifname_vrf (nexthop
->ifindex
, rib
->vrf_id
));
1994 case NEXTHOP_TYPE_IPV6
:
1995 case NEXTHOP_TYPE_IPV6_IFINDEX
:
1996 vty_out (vty
, " %s",
1997 inet_ntop (AF_INET6
, &nexthop
->gate
.ipv6
, buf
, BUFSIZ
));
1998 if (nexthop
->ifindex
)
1999 vty_out (vty
, ", via %s",
2000 ifindex2ifname_vrf (nexthop
->ifindex
, rib
->vrf_id
));
2002 case NEXTHOP_TYPE_IFINDEX
:
2003 vty_out (vty
, " directly connected, %s",
2004 ifindex2ifname_vrf (nexthop
->ifindex
, rib
->vrf_id
));
2006 case NEXTHOP_TYPE_BLACKHOLE
:
2007 vty_out (vty
, " directly connected, Null0");
2012 if (! CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ACTIVE
))
2013 vty_out (vty
, " inactive");
2015 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ONLINK
))
2016 vty_out (vty
, " onlink");
2018 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_RECURSIVE
))
2019 vty_out (vty
, " (recursive)");
2021 switch (nexthop
->type
)
2023 case NEXTHOP_TYPE_IPV4
:
2024 case NEXTHOP_TYPE_IPV4_IFINDEX
:
2025 if (nexthop
->src
.ipv4
.s_addr
)
2027 if (inet_ntop(AF_INET
, &nexthop
->src
.ipv4
, addrstr
,
2029 vty_out (vty
, ", src %s", addrstr
);
2032 case NEXTHOP_TYPE_IPV6
:
2033 case NEXTHOP_TYPE_IPV6_IFINDEX
:
2034 if (!IPV6_ADDR_SAME(&nexthop
->src
.ipv6
, &in6addr_any
))
2036 if (inet_ntop(AF_INET6
, &nexthop
->src
.ipv6
, addrstr
,
2038 vty_out (vty
, ", src %s", addrstr
);
2044 vty_out (vty
, "%s", VTY_NEWLINE
);
2046 vty_out (vty
, "%s", VTY_NEWLINE
);
2051 vty_show_ip_route (struct vty
*vty
, struct route_node
*rn
, struct rib
*rib
)
2053 struct nexthop
*nexthop
, *tnexthop
;
2058 /* Nexthop information. */
2059 for (ALL_NEXTHOPS_RO(rib
->nexthop
, nexthop
, tnexthop
, recursing
))
2061 if (nexthop
== rib
->nexthop
)
2063 /* Prefix information. */
2064 len
= vty_out (vty
, "%c", zebra_route_char (rib
->type
));
2066 len
+= vty_out (vty
, "[%d]", rib
->instance
);
2067 len
+= vty_out (vty
, "%c%c %s",
2068 CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
)
2070 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
)
2072 prefix2str (&rn
->p
, buf
, sizeof buf
));
2074 /* Distance and metric display. */
2075 if (rib
->type
!= ZEBRA_ROUTE_CONNECT
2076 && rib
->type
!= ZEBRA_ROUTE_KERNEL
)
2077 len
+= vty_out (vty
, " [%d/%d]", rib
->distance
,
2081 vty_out (vty
, " %c%*c",
2082 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
)
2084 len
- 3 + (2 * recursing
), ' ');
2086 switch (nexthop
->type
)
2088 case NEXTHOP_TYPE_IPV4
:
2089 case NEXTHOP_TYPE_IPV4_IFINDEX
:
2090 vty_out (vty
, " via %s", inet_ntoa (nexthop
->gate
.ipv4
));
2091 if (nexthop
->ifindex
)
2092 vty_out (vty
, ", %s",
2093 ifindex2ifname_vrf (nexthop
->ifindex
, rib
->vrf_id
));
2095 case NEXTHOP_TYPE_IPV6
:
2096 case NEXTHOP_TYPE_IPV6_IFINDEX
:
2097 vty_out (vty
, " via %s",
2098 inet_ntop (AF_INET6
, &nexthop
->gate
.ipv6
, buf
, BUFSIZ
));
2099 if (nexthop
->ifindex
)
2100 vty_out (vty
, ", %s",
2101 ifindex2ifname_vrf (nexthop
->ifindex
, rib
->vrf_id
));
2104 case NEXTHOP_TYPE_IFINDEX
:
2105 vty_out (vty
, " is directly connected, %s",
2106 ifindex2ifname_vrf (nexthop
->ifindex
, rib
->vrf_id
));
2108 case NEXTHOP_TYPE_BLACKHOLE
:
2109 vty_out (vty
, " is directly connected, Null0");
2114 if (! CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ACTIVE
))
2115 vty_out (vty
, " inactive");
2117 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ONLINK
))
2118 vty_out (vty
, " onlink");
2120 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_RECURSIVE
))
2121 vty_out (vty
, " (recursive)");
2123 switch (nexthop
->type
)
2125 case NEXTHOP_TYPE_IPV4
:
2126 case NEXTHOP_TYPE_IPV4_IFINDEX
:
2127 if (nexthop
->src
.ipv4
.s_addr
)
2129 if (inet_ntop(AF_INET
, &nexthop
->src
.ipv4
, buf
, sizeof buf
))
2130 vty_out (vty
, ", src %s", buf
);
2133 case NEXTHOP_TYPE_IPV6
:
2134 case NEXTHOP_TYPE_IPV6_IFINDEX
:
2135 if (!IPV6_ADDR_SAME(&nexthop
->src
.ipv6
, &in6addr_any
))
2137 if (inet_ntop(AF_INET6
, &nexthop
->src
.ipv6
, buf
, sizeof buf
))
2138 vty_out (vty
, ", src %s", buf
);
2145 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_BLACKHOLE
))
2146 vty_out (vty
, ", bh");
2147 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_REJECT
))
2148 vty_out (vty
, ", rej");
2150 if (rib
->type
== ZEBRA_ROUTE_RIP
2151 || rib
->type
== ZEBRA_ROUTE_OSPF
2152 || rib
->type
== ZEBRA_ROUTE_ISIS
2153 || rib
->type
== ZEBRA_ROUTE_TABLE
2154 || rib
->type
== ZEBRA_ROUTE_BGP
)
2159 uptime
= time (NULL
);
2160 uptime
-= rib
->uptime
;
2161 tm
= gmtime (&uptime
);
2163 #define ONE_DAY_SECOND 60*60*24
2164 #define ONE_WEEK_SECOND 60*60*24*7
2166 if (uptime
< ONE_DAY_SECOND
)
2167 vty_out (vty
, ", %02d:%02d:%02d",
2168 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
2169 else if (uptime
< ONE_WEEK_SECOND
)
2170 vty_out (vty
, ", %dd%02dh%02dm",
2171 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
2173 vty_out (vty
, ", %02dw%dd%02dh",
2175 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
2177 vty_out (vty
, "%s", VTY_NEWLINE
);
2181 DEFUN (show_ip_route
,
2186 "IP routing table\n")
2188 return do_show_ip_route (vty
, VRF_DEFAULT_NAME
, SAFI_UNICAST
);
2192 do_show_ip_route(struct vty
*vty
, const char *vrf_name
, safi_t safi
)
2194 struct route_table
*table
;
2195 struct route_node
*rn
;
2198 struct zebra_vrf
*zvrf
= NULL
;
2200 if (!(zvrf
= zebra_vrf_list_lookup_by_name (vrf_name
)))
2202 vty_out (vty
, "vrf %s not defined%s", vrf_name
, VTY_NEWLINE
);
2206 if (zvrf
->vrf_id
== VRF_UNKNOWN
)
2208 vty_out (vty
, "vrf %s inactive%s", vrf_name
, VTY_NEWLINE
);
2212 table
= zebra_vrf_table (AFI_IP
, safi
, zvrf
->vrf_id
);
2216 /* Show all IPv4 routes. */
2217 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2218 RNODE_FOREACH_RIB (rn
, rib
)
2222 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
2225 vty_show_ip_route (vty
, rn
, rib
);
2230 ALIAS (show_ip_route
,
2231 show_ip_route_vrf_cmd
,
2232 "show ip route " VRF_CMD_STR
,
2235 "IP routing table\n"
2243 "IP nexthop tracking table\n")
2245 vrf_id_t vrf_id
= VRF_DEFAULT
;
2248 VRF_GET_ID (vrf_id
, argv
[0]);
2250 zebra_print_rnh_table(vrf_id
, AF_INET
, vty
, RNH_NEXTHOP_TYPE
);
2255 show_ip_nht_vrf_cmd
,
2256 "show ip nht " VRF_CMD_STR
,
2259 "IP nexthop tracking table\n"
2262 DEFUN (show_ip_nht_vrf_all
,
2263 show_ip_nht_vrf_all_cmd
,
2264 "show ip nht " VRF_ALL_CMD_STR
,
2267 "IP nexthop tracking table\n"
2268 VRF_ALL_CMD_HELP_STR
)
2270 struct zebra_vrf
*zvrf
;
2273 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
2274 if ((zvrf
= vrf_iter2info (iter
)) != NULL
)
2276 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
2277 zebra_print_rnh_table(zvrf
->vrf_id
, AF_INET
, vty
, RNH_NEXTHOP_TYPE
);
2283 DEFUN (show_ipv6_nht
,
2288 "IPv6 nexthop tracking table\n")
2290 vrf_id_t vrf_id
= VRF_DEFAULT
;
2293 VRF_GET_ID (vrf_id
, argv
[0]);
2295 zebra_print_rnh_table(vrf_id
, AF_INET6
, vty
, RNH_NEXTHOP_TYPE
);
2299 ALIAS (show_ipv6_nht
,
2300 show_ipv6_nht_vrf_cmd
,
2301 "show ipv6 nht " VRF_CMD_STR
,
2304 "IPv6 nexthop tracking table\n"
2307 DEFUN (show_ipv6_nht_vrf_all
,
2308 show_ipv6_nht_vrf_all_cmd
,
2309 "show ipv6 nht " VRF_ALL_CMD_STR
,
2312 "IPv6 nexthop tracking table\n"
2313 VRF_ALL_CMD_HELP_STR
)
2315 struct zebra_vrf
*zvrf
;
2318 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
2319 if ((zvrf
= vrf_iter2info (iter
)) != NULL
)
2321 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
2322 zebra_print_rnh_table(zvrf
->vrf_id
, AF_INET6
, vty
, RNH_NEXTHOP_TYPE
);
2328 DEFUN (ip_nht_default_route
,
2329 ip_nht_default_route_cmd
,
2330 "ip nht resolve-via-default",
2332 "Filter Next Hop tracking route resolution\n"
2333 "Resolve via default route\n")
2335 if (zebra_rnh_ip_default_route
)
2338 zebra_rnh_ip_default_route
= 1;
2339 zebra_evaluate_rnh(0, AF_INET
, 1, RNH_NEXTHOP_TYPE
, NULL
);
2343 DEFUN (no_ip_nht_default_route
,
2344 no_ip_nht_default_route_cmd
,
2345 "no ip nht resolve-via-default",
2348 "Filter Next Hop tracking route resolution\n"
2349 "Resolve via default route\n")
2351 if (!zebra_rnh_ip_default_route
)
2354 zebra_rnh_ip_default_route
= 0;
2355 zebra_evaluate_rnh(0, AF_INET
, 1, RNH_NEXTHOP_TYPE
, NULL
);
2359 DEFUN (ipv6_nht_default_route
,
2360 ipv6_nht_default_route_cmd
,
2361 "ipv6 nht resolve-via-default",
2363 "Filter Next Hop tracking route resolution\n"
2364 "Resolve via default route\n")
2366 if (zebra_rnh_ipv6_default_route
)
2369 zebra_rnh_ipv6_default_route
= 1;
2370 zebra_evaluate_rnh(0, AF_INET6
, 1, RNH_NEXTHOP_TYPE
, NULL
);
2374 DEFUN (no_ipv6_nht_default_route
,
2375 no_ipv6_nht_default_route_cmd
,
2376 "no ipv6 nht resolve-via-default",
2379 "Filter Next Hop tracking route resolution\n"
2380 "Resolve via default route\n")
2382 if (!zebra_rnh_ipv6_default_route
)
2385 zebra_rnh_ipv6_default_route
= 0;
2386 zebra_evaluate_rnh(0, AF_INET6
, 1, RNH_NEXTHOP_TYPE
, NULL
);
2390 DEFUN (show_ip_route_tag
,
2391 show_ip_route_tag_cmd
,
2392 "show ip route tag <1-65535>",
2395 "IP routing table\n"
2396 "Show only routes with tag\n"
2399 struct route_table
*table
;
2400 struct route_node
*rn
;
2404 vrf_id_t vrf_id
= VRF_DEFAULT
;
2408 tag
= atoi(argv
[1]);
2409 VRF_GET_ID (vrf_id
, argv
[0]);
2412 tag
= atoi(argv
[0]);
2414 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2418 /* Show all IPv4 routes with matching tag value. */
2419 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2420 RNODE_FOREACH_RIB (rn
, rib
)
2422 if (rib
->tag
!= tag
)
2427 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
2430 vty_show_ip_route (vty
, rn
, rib
);
2435 ALIAS (show_ip_route_tag
,
2436 show_ip_route_vrf_tag_cmd
,
2437 "show ip route " VRF_CMD_STR
" tag <1-65535>",
2440 "IP routing table\n"
2442 "Show only routes with tag\n"
2445 DEFUN (show_ip_route_prefix_longer
,
2446 show_ip_route_prefix_longer_cmd
,
2447 "show ip route A.B.C.D/M longer-prefixes",
2450 "IP routing table\n"
2451 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
2452 "Show route matching the specified Network/Mask pair only\n")
2454 struct route_table
*table
;
2455 struct route_node
*rn
;
2460 vrf_id_t vrf_id
= VRF_DEFAULT
;
2464 ret
= str2prefix (argv
[1], &p
);
2465 VRF_GET_ID (vrf_id
, argv
[0]);
2468 ret
= str2prefix (argv
[0], &p
);
2472 vty_out (vty
, "%% Malformed Prefix%s", VTY_NEWLINE
);
2476 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2480 /* Show matched type IPv4 routes. */
2481 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2482 RNODE_FOREACH_RIB (rn
, rib
)
2483 if (prefix_match (&p
, &rn
->p
))
2487 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
2490 vty_show_ip_route (vty
, rn
, rib
);
2495 ALIAS (show_ip_route_prefix_longer
,
2496 show_ip_route_vrf_prefix_longer_cmd
,
2497 "show ip route " VRF_CMD_STR
" A.B.C.D/M longer-prefixes",
2500 "IP routing table\n"
2502 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
2503 "Show route matching the specified Network/Mask pair only\n")
2505 DEFUN (show_ip_route_supernets
,
2506 show_ip_route_supernets_cmd
,
2507 "show ip route supernets-only",
2510 "IP routing table\n"
2511 "Show supernet entries only\n")
2513 struct route_table
*table
;
2514 struct route_node
*rn
;
2518 vrf_id_t vrf_id
= VRF_DEFAULT
;
2521 VRF_GET_ID (vrf_id
, argv
[0]);
2523 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2527 /* Show matched type IPv4 routes. */
2528 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2529 RNODE_FOREACH_RIB (rn
, rib
)
2531 addr
= ntohl (rn
->p
.u
.prefix4
.s_addr
);
2533 if ((IN_CLASSC (addr
) && rn
->p
.prefixlen
< 24)
2534 || (IN_CLASSB (addr
) && rn
->p
.prefixlen
< 16)
2535 || (IN_CLASSA (addr
) && rn
->p
.prefixlen
< 8))
2539 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
2542 vty_show_ip_route (vty
, rn
, rib
);
2548 ALIAS (show_ip_route_supernets
,
2549 show_ip_route_vrf_supernets_cmd
,
2550 "show ip route " VRF_CMD_STR
" supernets-only",
2553 "IP routing table\n"
2555 "Show supernet entries only\n")
2557 DEFUN (show_ip_route_protocol
,
2558 show_ip_route_protocol_cmd
,
2559 "show ip route " QUAGGA_IP_REDIST_STR_ZEBRA
,
2562 "IP routing table\n"
2563 QUAGGA_IP_REDIST_HELP_STR_ZEBRA
)
2566 struct route_table
*table
;
2567 struct route_node
*rn
;
2570 vrf_id_t vrf_id
= VRF_DEFAULT
;
2574 type
= proto_redistnum (AFI_IP
, argv
[1]);
2575 VRF_GET_ID (vrf_id
, argv
[0]);
2578 type
= proto_redistnum (AFI_IP
, argv
[0]);
2582 vty_out (vty
, "Unknown route type%s", VTY_NEWLINE
);
2586 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2590 /* Show matched type IPv4 routes. */
2591 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2592 RNODE_FOREACH_RIB (rn
, rib
)
2593 if (rib
->type
== type
)
2597 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
2600 vty_show_ip_route (vty
, rn
, rib
);
2605 ALIAS (show_ip_route_protocol
,
2606 show_ip_route_vrf_protocol_cmd
,
2607 "show ip route " VRF_CMD_STR
" " QUAGGA_IP_REDIST_STR_ZEBRA
,
2610 "IP routing table\n"
2612 QUAGGA_IP_REDIST_HELP_STR_ZEBRA
)
2614 DEFUN (show_ip_route_ospf_instance
,
2615 show_ip_route_ospf_instance_cmd
,
2616 "show ip route ospf <1-65535>",
2619 "IP routing table\n"
2620 "Open Shortest Path First (OSPFv2)\n"
2623 struct route_table
*table
;
2624 struct route_node
*rn
;
2627 u_short instance
= 0;
2629 VTY_GET_INTEGER ("Instance", instance
, argv
[0]);
2631 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, VRF_DEFAULT
);
2635 /* Show matched type IPv4 routes. */
2636 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2637 RNODE_FOREACH_RIB (rn
, rib
)
2638 if (rib
->type
== ZEBRA_ROUTE_OSPF
&& rib
->instance
== instance
)
2642 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
2645 vty_show_ip_route (vty
, rn
, rib
);
2650 DEFUN (show_ip_route_addr
,
2651 show_ip_route_addr_cmd
,
2652 "show ip route A.B.C.D",
2655 "IP routing table\n"
2656 "Network in the IP routing table to display\n")
2659 struct prefix_ipv4 p
;
2660 struct route_table
*table
;
2661 struct route_node
*rn
;
2662 vrf_id_t vrf_id
= VRF_DEFAULT
;
2666 VRF_GET_ID (vrf_id
, argv
[0]);
2667 ret
= str2prefix_ipv4 (argv
[1], &p
);
2670 ret
= str2prefix_ipv4 (argv
[0], &p
);
2674 vty_out (vty
, "%% Malformed IPv4 address%s", VTY_NEWLINE
);
2678 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2682 rn
= route_node_match (table
, (struct prefix
*) &p
);
2685 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
2689 vty_show_ip_route_detail (vty
, rn
, 0);
2691 route_unlock_node (rn
);
2696 ALIAS (show_ip_route_addr
,
2697 show_ip_route_vrf_addr_cmd
,
2698 "show ip route " VRF_CMD_STR
" A.B.C.D",
2701 "IP routing table\n"
2703 "Network in the IP routing table to display\n")
2705 DEFUN (show_ip_route_prefix
,
2706 show_ip_route_prefix_cmd
,
2707 "show ip route A.B.C.D/M",
2710 "IP routing table\n"
2711 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
2714 struct prefix_ipv4 p
;
2715 struct route_table
*table
;
2716 struct route_node
*rn
;
2717 vrf_id_t vrf_id
= VRF_DEFAULT
;
2721 VRF_GET_ID (vrf_id
, argv
[0]);
2722 ret
= str2prefix_ipv4 (argv
[1], &p
);
2725 ret
= str2prefix_ipv4 (argv
[0], &p
);
2729 vty_out (vty
, "%% Malformed IPv4 address%s", VTY_NEWLINE
);
2733 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2737 rn
= route_node_match (table
, (struct prefix
*) &p
);
2738 if (! rn
|| rn
->p
.prefixlen
!= p
.prefixlen
)
2740 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
2744 vty_show_ip_route_detail (vty
, rn
, 0);
2746 route_unlock_node (rn
);
2751 ALIAS (show_ip_route_prefix
,
2752 show_ip_route_vrf_prefix_cmd
,
2753 "show ip route " VRF_CMD_STR
" A.B.C.D/M",
2756 "IP routing table\n"
2758 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
2761 vty_show_ip_route_summary (struct vty
*vty
, struct route_table
*table
)
2763 struct route_node
*rn
;
2765 #define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
2766 #define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
2767 u_int32_t rib_cnt
[ZEBRA_ROUTE_TOTAL
+ 1];
2768 u_int32_t fib_cnt
[ZEBRA_ROUTE_TOTAL
+ 1];
2772 memset (&rib_cnt
, 0, sizeof(rib_cnt
));
2773 memset (&fib_cnt
, 0, sizeof(fib_cnt
));
2774 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2775 RNODE_FOREACH_RIB (rn
, rib
)
2777 is_ibgp
= (rib
->type
== ZEBRA_ROUTE_BGP
&&
2778 CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_IBGP
));
2780 rib_cnt
[ZEBRA_ROUTE_TOTAL
]++;
2782 rib_cnt
[ZEBRA_ROUTE_IBGP
]++;
2784 rib_cnt
[rib
->type
]++;
2786 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
))
2788 fib_cnt
[ZEBRA_ROUTE_TOTAL
]++;
2791 fib_cnt
[ZEBRA_ROUTE_IBGP
]++;
2793 fib_cnt
[rib
->type
]++;
2797 vty_out (vty
, "%-20s %-20s %s (vrf %s)%s",
2798 "Route Source", "Routes", "FIB",
2799 ((rib_table_info_t
*)table
->info
)->zvrf
->name
,
2802 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
2804 if ((rib_cnt
[i
] > 0) ||
2805 (i
== ZEBRA_ROUTE_BGP
&& rib_cnt
[ZEBRA_ROUTE_IBGP
] > 0))
2807 if (i
== ZEBRA_ROUTE_BGP
)
2809 vty_out (vty
, "%-20s %-20d %-20d %s", "ebgp",
2810 rib_cnt
[ZEBRA_ROUTE_BGP
], fib_cnt
[ZEBRA_ROUTE_BGP
],
2812 vty_out (vty
, "%-20s %-20d %-20d %s", "ibgp",
2813 rib_cnt
[ZEBRA_ROUTE_IBGP
], fib_cnt
[ZEBRA_ROUTE_IBGP
],
2817 vty_out (vty
, "%-20s %-20d %-20d %s", zebra_route_string(i
),
2818 rib_cnt
[i
], fib_cnt
[i
], VTY_NEWLINE
);
2822 vty_out (vty
, "------%s", VTY_NEWLINE
);
2823 vty_out (vty
, "%-20s %-20d %-20d %s", "Totals", rib_cnt
[ZEBRA_ROUTE_TOTAL
],
2824 fib_cnt
[ZEBRA_ROUTE_TOTAL
], VTY_NEWLINE
);
2825 vty_out (vty
, "%s", VTY_NEWLINE
);
2829 * Implementation of the ip route summary prefix command.
2831 * This command prints the primary prefixes that have been installed by various
2832 * protocols on the box.
2836 vty_show_ip_route_summary_prefix (struct vty
*vty
, struct route_table
*table
)
2838 struct route_node
*rn
;
2840 struct nexthop
*nexthop
;
2841 #define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
2842 #define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
2843 u_int32_t rib_cnt
[ZEBRA_ROUTE_TOTAL
+ 1];
2844 u_int32_t fib_cnt
[ZEBRA_ROUTE_TOTAL
+ 1];
2848 memset (&rib_cnt
, 0, sizeof(rib_cnt
));
2849 memset (&fib_cnt
, 0, sizeof(fib_cnt
));
2850 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
2851 RNODE_FOREACH_RIB (rn
, rib
)
2855 * In case of ECMP, count only once.
2858 for (nexthop
= rib
->nexthop
; (!cnt
&& nexthop
); nexthop
= nexthop
->next
)
2861 rib_cnt
[ZEBRA_ROUTE_TOTAL
]++;
2862 rib_cnt
[rib
->type
]++;
2863 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
))
2865 fib_cnt
[ZEBRA_ROUTE_TOTAL
]++;
2866 fib_cnt
[rib
->type
]++;
2868 if (rib
->type
== ZEBRA_ROUTE_BGP
&&
2869 CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_IBGP
))
2871 rib_cnt
[ZEBRA_ROUTE_IBGP
]++;
2872 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
))
2873 fib_cnt
[ZEBRA_ROUTE_IBGP
]++;
2878 vty_out (vty
, "%-20s %-20s %s (vrf %s)%s",
2879 "Route Source", "Prefix Routes", "FIB",
2880 ((rib_table_info_t
*)table
->info
)->zvrf
->name
,
2883 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
2887 if (i
== ZEBRA_ROUTE_BGP
)
2889 vty_out (vty
, "%-20s %-20d %-20d %s", "ebgp",
2890 rib_cnt
[ZEBRA_ROUTE_BGP
] - rib_cnt
[ZEBRA_ROUTE_IBGP
],
2891 fib_cnt
[ZEBRA_ROUTE_BGP
] - fib_cnt
[ZEBRA_ROUTE_IBGP
],
2893 vty_out (vty
, "%-20s %-20d %-20d %s", "ibgp",
2894 rib_cnt
[ZEBRA_ROUTE_IBGP
], fib_cnt
[ZEBRA_ROUTE_IBGP
],
2898 vty_out (vty
, "%-20s %-20d %-20d %s", zebra_route_string(i
),
2899 rib_cnt
[i
], fib_cnt
[i
], VTY_NEWLINE
);
2903 vty_out (vty
, "------%s", VTY_NEWLINE
);
2904 vty_out (vty
, "%-20s %-20d %-20d %s", "Totals", rib_cnt
[ZEBRA_ROUTE_TOTAL
],
2905 fib_cnt
[ZEBRA_ROUTE_TOTAL
], VTY_NEWLINE
);
2906 vty_out (vty
, "%s", VTY_NEWLINE
);
2909 /* Show route summary. */
2910 DEFUN (show_ip_route_summary
,
2911 show_ip_route_summary_cmd
,
2912 "show ip route summary",
2915 "IP routing table\n"
2916 "Summary of all routes\n")
2918 struct route_table
*table
;
2919 vrf_id_t vrf_id
= VRF_DEFAULT
;
2922 VRF_GET_ID (vrf_id
, argv
[0]);
2924 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2928 vty_show_ip_route_summary (vty
, table
);
2933 ALIAS (show_ip_route_summary
,
2934 show_ip_route_vrf_summary_cmd
,
2935 "show ip route " VRF_CMD_STR
" summary",
2938 "IP routing table\n"
2940 "Summary of all routes\n")
2942 /* Show route summary prefix. */
2943 DEFUN (show_ip_route_summary_prefix
,
2944 show_ip_route_summary_prefix_cmd
,
2945 "show ip route summary prefix",
2948 "IP routing table\n"
2949 "Summary of all routes\n"
2952 struct route_table
*table
;
2953 vrf_id_t vrf_id
= VRF_DEFAULT
;
2956 VRF_GET_ID (vrf_id
, argv
[0]);
2958 table
= zebra_vrf_table (AFI_IP
, SAFI_UNICAST
, vrf_id
);
2962 vty_show_ip_route_summary_prefix (vty
, table
);
2967 ALIAS (show_ip_route_summary_prefix
,
2968 show_ip_route_vrf_summary_prefix_cmd
,
2969 "show ip route " VRF_CMD_STR
" summary prefix",
2972 "IP routing table\n"
2974 "Summary of all routes\n"
2977 DEFUN (show_ip_route_vrf_all
,
2978 show_ip_route_vrf_all_cmd
,
2979 "show ip route " VRF_ALL_CMD_STR
,
2982 "IP routing table\n"
2983 VRF_ALL_CMD_HELP_STR
)
2985 struct route_table
*table
;
2986 struct route_node
*rn
;
2988 struct zebra_vrf
*zvrf
;
2993 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
2995 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
2996 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
2999 /* Show all IPv4 routes. */
3000 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
3001 RNODE_FOREACH_RIB (rn
, rib
)
3005 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
3011 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
3014 vty_show_ip_route (vty
, rn
, rib
);
3022 DEFUN (show_ip_route_vrf_all_tag
,
3023 show_ip_route_vrf_all_tag_cmd
,
3024 "show ip route " VRF_ALL_CMD_STR
" tag <1-65535>",
3027 "IP routing table\n"
3028 VRF_ALL_CMD_HELP_STR
3029 "Show only routes with tag\n"
3032 struct route_table
*table
;
3033 struct route_node
*rn
;
3035 struct zebra_vrf
*zvrf
;
3042 tag
= atoi(argv
[0]);
3044 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3046 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
3047 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
3050 /* Show all IPv4 routes with matching tag value. */
3051 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
3052 RNODE_FOREACH_RIB (rn
, rib
)
3054 if (rib
->tag
!= tag
)
3059 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
3065 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
3068 vty_show_ip_route (vty
, rn
, rib
);
3075 DEFUN (show_ip_route_vrf_all_prefix_longer
,
3076 show_ip_route_vrf_all_prefix_longer_cmd
,
3077 "show ip route " VRF_ALL_CMD_STR
" A.B.C.D/M longer-prefixes",
3080 "IP routing table\n"
3081 VRF_ALL_CMD_HELP_STR
3082 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
3083 "Show route matching the specified Network/Mask pair only\n")
3085 struct route_table
*table
;
3086 struct route_node
*rn
;
3089 struct zebra_vrf
*zvrf
;
3095 ret
= str2prefix (argv
[0], &p
);
3098 vty_out (vty
, "%% Malformed Prefix%s", VTY_NEWLINE
);
3102 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3104 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
3105 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
3108 /* Show matched type IPv4 routes. */
3109 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
3110 RNODE_FOREACH_RIB (rn
, rib
)
3111 if (prefix_match (&p
, &rn
->p
))
3115 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
3121 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
3124 vty_show_ip_route (vty
, rn
, rib
);
3132 DEFUN (show_ip_route_vrf_all_supernets
,
3133 show_ip_route_vrf_all_supernets_cmd
,
3134 "show ip route " VRF_ALL_CMD_STR
" supernets-only",
3137 "IP routing table\n"
3138 VRF_ALL_CMD_HELP_STR
3139 "Show supernet entries only\n")
3141 struct route_table
*table
;
3142 struct route_node
*rn
;
3144 struct zebra_vrf
*zvrf
;
3150 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3152 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
3153 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
3156 /* Show matched type IPv4 routes. */
3157 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
3158 RNODE_FOREACH_RIB (rn
, rib
)
3160 addr
= ntohl (rn
->p
.u
.prefix4
.s_addr
);
3162 if ((IN_CLASSC (addr
) && rn
->p
.prefixlen
< 24)
3163 || (IN_CLASSB (addr
) && rn
->p
.prefixlen
< 16)
3164 || (IN_CLASSA (addr
) && rn
->p
.prefixlen
< 8))
3168 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
3174 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
3177 vty_show_ip_route (vty
, rn
, rib
);
3186 DEFUN (show_ip_route_vrf_all_protocol
,
3187 show_ip_route_vrf_all_protocol_cmd
,
3188 "show ip route " VRF_ALL_CMD_STR
" " QUAGGA_IP_REDIST_STR_ZEBRA
,
3191 "IP routing table\n"
3192 VRF_ALL_CMD_HELP_STR
3193 QUAGGA_IP_REDIST_HELP_STR_ZEBRA
"\n")
3196 struct route_table
*table
;
3197 struct route_node
*rn
;
3199 struct zebra_vrf
*zvrf
;
3204 type
= proto_redistnum (AFI_IP
, argv
[0]);
3207 vty_out (vty
, "Unknown route type%s", VTY_NEWLINE
);
3211 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3213 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
3214 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
3217 /* Show matched type IPv4 routes. */
3218 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
3219 RNODE_FOREACH_RIB (rn
, rib
)
3220 if (rib
->type
== type
)
3224 vty_out (vty
, SHOW_ROUTE_V4_HEADER
);
3230 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
3233 vty_show_ip_route (vty
, rn
, rib
);
3241 DEFUN (show_ip_route_vrf_all_addr
,
3242 show_ip_route_vrf_all_addr_cmd
,
3243 "show ip route " VRF_ALL_CMD_STR
" A.B.C.D",
3246 "IP routing table\n"
3247 VRF_ALL_CMD_HELP_STR
3248 "Network in the IP routing table to display\n")
3251 struct prefix_ipv4 p
;
3252 struct route_table
*table
;
3253 struct route_node
*rn
;
3254 struct zebra_vrf
*zvrf
;
3257 ret
= str2prefix_ipv4 (argv
[0], &p
);
3260 vty_out (vty
, "%% Malformed IPv4 address%s", VTY_NEWLINE
);
3264 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3266 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
3267 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
3270 rn
= route_node_match (table
, (struct prefix
*) &p
);
3274 vty_show_ip_route_detail (vty
, rn
, 0);
3276 route_unlock_node (rn
);
3282 DEFUN (show_ip_route_vrf_all_prefix
,
3283 show_ip_route_vrf_all_prefix_cmd
,
3284 "show ip route " VRF_ALL_CMD_STR
" A.B.C.D/M",
3287 "IP routing table\n"
3288 VRF_ALL_CMD_HELP_STR
3289 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
3292 struct prefix_ipv4 p
;
3293 struct route_table
*table
;
3294 struct route_node
*rn
;
3295 struct zebra_vrf
*zvrf
;
3298 ret
= str2prefix_ipv4 (argv
[0], &p
);
3301 vty_out (vty
, "%% Malformed IPv4 address%s", VTY_NEWLINE
);
3305 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3307 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
3308 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
3311 rn
= route_node_match (table
, (struct prefix
*) &p
);
3314 if (rn
->p
.prefixlen
!= p
.prefixlen
)
3316 route_unlock_node (rn
);
3320 vty_show_ip_route_detail (vty
, rn
, 0);
3322 route_unlock_node (rn
);
3328 DEFUN (show_ip_route_vrf_all_summary
,
3329 show_ip_route_vrf_all_summary_cmd
,
3330 "show ip route " VRF_ALL_CMD_STR
" summary ",
3333 "IP routing table\n"
3334 VRF_ALL_CMD_HELP_STR
3335 "Summary of all routes\n")
3337 struct zebra_vrf
*zvrf
;
3340 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3341 if ((zvrf
= vrf_iter2info (iter
)) != NULL
)
3342 vty_show_ip_route_summary (vty
, zvrf
->table
[AFI_IP
][SAFI_UNICAST
]);
3347 DEFUN (show_ip_route_vrf_all_summary_prefix
,
3348 show_ip_route_vrf_all_summary_prefix_cmd
,
3349 "show ip route " VRF_ALL_CMD_STR
" summary prefix",
3352 "IP routing table\n"
3353 VRF_ALL_CMD_HELP_STR
3354 "Summary of all routes\n"
3357 struct zebra_vrf
*zvrf
;
3360 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
3361 if ((zvrf
= vrf_iter2info (iter
)) != NULL
)
3362 vty_show_ip_route_summary_prefix (vty
, zvrf
->table
[AFI_IP
][SAFI_UNICAST
]);
3367 /* Write IPv4 static route configuration. */
3369 static_config_ipv4 (struct vty
*vty
, safi_t safi
, const char *cmd
)
3371 struct route_node
*rn
;
3372 struct static_route
*si
;
3373 struct route_table
*stable
;
3374 struct zebra_vrf
*zvrf
;
3375 char buf
[PREFIX_STRLEN
];
3377 struct listnode
*node
;
3379 for (ALL_LIST_ELEMENTS_RO (zvrf_list
, node
, zvrf
))
3381 if ((stable
= zvrf
->stable
[AFI_IP
][safi
]) == NULL
)
3384 for (rn
= route_top (stable
); rn
; rn
= route_next (rn
))
3385 for (si
= rn
->info
; si
; si
= si
->next
)
3387 vty_out (vty
, "%s %s", cmd
, prefix2str (&rn
->p
, buf
, sizeof buf
));
3391 case STATIC_IPV4_GATEWAY
:
3392 vty_out (vty
, " %s", inet_ntoa (si
->addr
.ipv4
));
3394 case STATIC_IFINDEX
:
3395 vty_out (vty
, " %s", si
->ifname
);
3397 case STATIC_IPV4_BLACKHOLE
:
3398 vty_out (vty
, " Null0");
3402 /* flags are incompatible with STATIC_IPV4_BLACKHOLE */
3403 if (si
->type
!= STATIC_IPV4_BLACKHOLE
)
3405 if (CHECK_FLAG(si
->flags
, ZEBRA_FLAG_REJECT
))
3406 vty_out (vty
, " %s", "reject");
3408 if (CHECK_FLAG(si
->flags
, ZEBRA_FLAG_BLACKHOLE
))
3409 vty_out (vty
, " %s", "blackhole");
3413 vty_out (vty
, " tag %d", si
->tag
);
3415 if (si
->distance
!= ZEBRA_STATIC_DISTANCE_DEFAULT
)
3416 vty_out (vty
, " %d", si
->distance
);
3418 if (si
->vrf_id
!= VRF_DEFAULT
)
3419 vty_out (vty
, " vrf %s", zvrf
? zvrf
->name
: "");
3421 vty_out (vty
, "%s", VTY_NEWLINE
);
3430 /* General fucntion for IPv6 static route. */
3432 static_ipv6_func (struct vty
*vty
, int add_cmd
, const char *dest_str
,
3433 const char *gate_str
, const char *ifname
,
3434 const char *flag_str
, const char *tag_str
,
3435 const char *distance_str
, const char *vrf_id_str
)
3440 struct in6_addr
*gate
= NULL
;
3441 struct in6_addr gate_addr
;
3445 unsigned int ifindex
= 0;
3446 struct interface
*ifp
= NULL
;
3447 struct zebra_vrf
*zvrf
;
3449 ret
= str2prefix (dest_str
, &p
);
3452 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
3456 /* Apply mask for given prefix. */
3461 switch(flag_str
[0]) {
3464 SET_FLAG (flag
, ZEBRA_FLAG_REJECT
);
3468 SET_FLAG (flag
, ZEBRA_FLAG_BLACKHOLE
);
3471 vty_out (vty
, "%% Malformed flag %s %s", flag_str
, VTY_NEWLINE
);
3476 /* Administrative distance. */
3478 distance
= atoi (distance_str
);
3480 distance
= ZEBRA_STATIC_DISTANCE_DEFAULT
;
3484 tag
= atoi(tag_str
);
3486 /* When gateway is valid IPv6 addrees, then gate is treated as
3487 nexthop address other case gate is treated as interface name. */
3488 ret
= inet_pton (AF_INET6
, gate_str
, &gate_addr
);
3491 zvrf
= zebra_vrf_list_lookup_by_name (vrf_id_str
);
3495 vty_out (vty
, "%% vrf %s is not defined%s", vrf_id_str
, VTY_NEWLINE
);
3501 /* When ifname is specified. It must be come with gateway
3505 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
3508 type
= STATIC_IPV6_GATEWAY_IFINDEX
;
3510 ifp
= if_lookup_by_name_vrf (ifname
, zvrf
->vrf_id
);
3513 vty_out (vty
, "%% Malformed Interface name %s%s", ifname
, VTY_NEWLINE
);
3516 ifindex
= ifp
->ifindex
;
3522 type
= STATIC_IPV6_GATEWAY
;
3527 type
= STATIC_IFINDEX
;
3528 ifp
= if_lookup_by_name_vrf (gate_str
, zvrf
->vrf_id
);
3531 vty_out (vty
, "%% Malformed Interface name %s%s", gate_str
, VTY_NEWLINE
);
3532 ifindex
= IFINDEX_DELETED
;
3535 ifindex
= ifp
->ifindex
;
3541 static_add_ipv6 (&p
, type
, gate
, ifindex
, ifname
, flag
, tag
, distance
, zvrf
);
3543 static_delete_ipv6 (&p
, type
, gate
, ifindex
, tag
, distance
, zvrf
);
3550 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
3552 "Establish static routes\n"
3553 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3554 "IPv6 gateway address\n"
3555 "IPv6 gateway interface name\n")
3557 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, NULL
, NULL
, NULL
);
3560 DEFUN (ipv6_route_tag
,
3562 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535>",
3564 "Establish static routes\n"
3565 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3566 "IPv6 gateway address\n"
3567 "IPv6 gateway interface name\n"
3568 "Set tag for this route\n"
3571 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, argv
[2], NULL
, NULL
);
3574 DEFUN (ipv6_route_flags
,
3575 ipv6_route_flags_cmd
,
3576 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
3578 "Establish static routes\n"
3579 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3580 "IPv6 gateway address\n"
3581 "IPv6 gateway interface name\n"
3582 "Emit an ICMP unreachable when matched\n"
3583 "Silently discard pkts when matched\n")
3585 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
, NULL
, NULL
);
3588 DEFUN (ipv6_route_flags_tag
,
3589 ipv6_route_flags_tag_cmd
,
3590 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
3592 "Establish static routes\n"
3593 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3594 "IPv6 gateway address\n"
3595 "IPv6 gateway interface name\n"
3596 "Emit an ICMP unreachable when matched\n"
3597 "Silently discard pkts when matched\n"
3598 "Set tag for this route\n"
3601 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], NULL
, NULL
);
3604 DEFUN (ipv6_route_ifname
,
3605 ipv6_route_ifname_cmd
,
3606 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
3608 "Establish static routes\n"
3609 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3610 "IPv6 gateway address\n"
3611 "IPv6 gateway interface name\n")
3613 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
, NULL
, NULL
);
3615 DEFUN (ipv6_route_ifname_tag
,
3616 ipv6_route_ifname_tag_cmd
,
3617 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535>",
3619 "Establish static routes\n"
3620 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3621 "IPv6 gateway address\n"
3622 "IPv6 gateway interface name\n"
3623 "Set tag for this route\n"
3626 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], NULL
, NULL
);
3629 DEFUN (ipv6_route_ifname_flags
,
3630 ipv6_route_ifname_flags_cmd
,
3631 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
3633 "Establish static routes\n"
3634 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3635 "IPv6 gateway address\n"
3636 "IPv6 gateway interface name\n"
3637 "Emit an ICMP unreachable when matched\n"
3638 "Silently discard pkts when matched\n")
3640 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, NULL
, NULL
);
3643 DEFUN (ipv6_route_ifname_flags_tag
,
3644 ipv6_route_ifname_flags_tag_cmd
,
3645 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
3647 "Establish static routes\n"
3648 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3649 "IPv6 gateway address\n"
3650 "IPv6 gateway interface name\n"
3651 "Emit an ICMP unreachable when matched\n"
3652 "Silently discard pkts when matched\n"
3653 "Set tag for this route\n"
3656 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], NULL
, NULL
);
3659 DEFUN (ipv6_route_pref
,
3660 ipv6_route_pref_cmd
,
3661 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
3663 "Establish static routes\n"
3664 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3665 "IPv6 gateway address\n"
3666 "IPv6 gateway interface name\n"
3667 "Distance value for this prefix\n")
3669 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, NULL
, argv
[2], NULL
);
3672 DEFUN (ipv6_route_pref_tag
,
3673 ipv6_route_pref_tag_cmd
,
3674 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255>",
3676 "Establish static routes\n"
3677 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3678 "IPv6 gateway address\n"
3679 "IPv6 gateway interface name\n"
3680 "Set tag for this route\n"
3682 "Distance value for this prefix\n")
3684 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, argv
[2], argv
[3], NULL
);
3687 DEFUN (ipv6_route_flags_pref
,
3688 ipv6_route_flags_pref_cmd
,
3689 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255>",
3691 "Establish static routes\n"
3692 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3693 "IPv6 gateway address\n"
3694 "IPv6 gateway interface name\n"
3695 "Emit an ICMP unreachable when matched\n"
3696 "Silently discard pkts when matched\n"
3697 "Distance value for this prefix\n")
3699 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
, argv
[3], NULL
);
3702 DEFUN (ipv6_route_flags_pref_tag
,
3703 ipv6_route_flags_pref_tag_cmd
,
3704 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
3706 "Establish static routes\n"
3707 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3708 "IPv6 gateway address\n"
3709 "IPv6 gateway interface name\n"
3710 "Emit an ICMP unreachable when matched\n"
3711 "Silently discard pkts when matched\n"
3712 "Set tag for this route\n"
3714 "Distance value for this prefix\n")
3716 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], argv
[4], NULL
);
3719 DEFUN (ipv6_route_ifname_pref
,
3720 ipv6_route_ifname_pref_cmd
,
3721 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
3723 "Establish static routes\n"
3724 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3725 "IPv6 gateway address\n"
3726 "IPv6 gateway interface name\n"
3727 "Distance value for this prefix\n")
3729 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
, argv
[3], NULL
);
3732 DEFUN (ipv6_route_ifname_pref_tag
,
3733 ipv6_route_ifname_pref_tag_cmd
,
3734 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255>",
3736 "Establish static routes\n"
3737 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3738 "IPv6 gateway address\n"
3739 "IPv6 gateway interface name\n"
3740 "Set tag for this route\n"
3742 "Distance value for this prefix\n")
3744 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], argv
[4], NULL
);
3747 DEFUN (ipv6_route_ifname_flags_pref
,
3748 ipv6_route_ifname_flags_pref_cmd
,
3749 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255>",
3751 "Establish static routes\n"
3752 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3753 "IPv6 gateway address\n"
3754 "IPv6 gateway interface name\n"
3755 "Emit an ICMP unreachable when matched\n"
3756 "Silently discard pkts when matched\n"
3757 "Distance value for this prefix\n")
3759 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, argv
[4], NULL
);
3762 DEFUN (ipv6_route_ifname_flags_pref_tag
,
3763 ipv6_route_ifname_flags_pref_tag_cmd
,
3764 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255>",
3766 "Establish static routes\n"
3767 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3768 "IPv6 gateway address\n"
3769 "IPv6 gateway interface name\n"
3770 "Emit an ICMP unreachable when matched\n"
3771 "Silently discard pkts when matched\n"
3772 "Set tag for this route\n"
3774 "Distance value for this prefix\n")
3776 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], argv
[5], NULL
);
3779 DEFUN (no_ipv6_route
,
3781 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
3784 "Establish static routes\n"
3785 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3786 "IPv6 gateway address\n"
3787 "IPv6 gateway interface name\n")
3789 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, NULL
, NULL
, NULL
);
3792 DEFUN (no_ipv6_route_tag
,
3793 no_ipv6_route_tag_cmd
,
3794 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535>",
3797 "Establish static routes\n"
3798 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3799 "IPv6 gateway address\n"
3800 "IPv6 gateway interface name\n"
3801 "Set tag for this route\n"
3804 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, argv
[2], NULL
, NULL
);
3807 DEFUN (no_ipv6_route_flags
,
3808 no_ipv6_route_flags_cmd
,
3809 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
3812 "Establish static routes\n"
3813 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3814 "IPv6 gateway address\n"
3815 "IPv6 gateway interface name\n"
3816 "Emit an ICMP unreachable when matched\n"
3817 "Silently discard pkts when matched\n")
3819 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
, NULL
, NULL
);
3822 DEFUN (no_ipv6_route_flags_tag
,
3823 no_ipv6_route_flags_tag_cmd
,
3824 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
3827 "Establish static routes\n"
3828 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3829 "IPv6 gateway address\n"
3830 "IPv6 gateway interface name\n"
3831 "Emit an ICMP unreachable when matched\n"
3832 "Silently discard pkts when matched\n"
3833 "Set tag for this route\n"
3836 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], NULL
, NULL
);
3839 DEFUN (no_ipv6_route_ifname
,
3840 no_ipv6_route_ifname_cmd
,
3841 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
3844 "Establish static routes\n"
3845 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3846 "IPv6 gateway address\n"
3847 "IPv6 gateway interface name\n")
3849 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
, NULL
, NULL
);
3852 DEFUN (no_ipv6_route_ifname_tag
,
3853 no_ipv6_route_ifname_tag_cmd
,
3854 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535>",
3857 "Establish static routes\n"
3858 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3859 "IPv6 gateway address\n"
3860 "IPv6 gateway interface name\n"
3861 "Set tag for this route\n"
3864 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], NULL
, NULL
);
3867 DEFUN (no_ipv6_route_ifname_flags
,
3868 no_ipv6_route_ifname_flags_cmd
,
3869 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
3872 "Establish static routes\n"
3873 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3874 "IPv6 gateway address\n"
3875 "IPv6 gateway interface name\n"
3876 "Emit an ICMP unreachable when matched\n"
3877 "Silently discard pkts when matched\n")
3879 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, NULL
, NULL
);
3882 DEFUN (no_ipv6_route_ifname_flags_tag
,
3883 no_ipv6_route_ifname_flags_tag_cmd
,
3884 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
3887 "Establish static routes\n"
3888 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3889 "IPv6 gateway address\n"
3890 "IPv6 gateway interface name\n"
3891 "Emit an ICMP unreachable when matched\n"
3892 "Silently discard pkts when matched\n"
3893 "Set tag for this route\n"
3896 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], NULL
, NULL
);
3899 DEFUN (no_ipv6_route_pref
,
3900 no_ipv6_route_pref_cmd
,
3901 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
3904 "Establish static routes\n"
3905 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3906 "IPv6 gateway address\n"
3907 "IPv6 gateway interface name\n"
3908 "Distance value for this prefix\n")
3910 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, NULL
, argv
[2], NULL
);
3913 DEFUN (no_ipv6_route_pref_tag
,
3914 no_ipv6_route_pref_tag_cmd
,
3915 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255>",
3918 "Establish static routes\n"
3919 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3920 "IPv6 gateway address\n"
3921 "IPv6 gateway interface name\n"
3922 "Set tag for this route\n"
3924 "Distance value for this prefix\n")
3926 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, argv
[2], argv
[3], NULL
);
3929 DEFUN (no_ipv6_route_flags_pref
,
3930 no_ipv6_route_flags_pref_cmd
,
3931 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255>",
3934 "Establish static routes\n"
3935 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3936 "IPv6 gateway address\n"
3937 "IPv6 gateway interface name\n"
3938 "Emit an ICMP unreachable when matched\n"
3939 "Silently discard pkts when matched\n"
3940 "Distance value for this prefix\n")
3942 /* We do not care about argv[2] */
3943 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
, argv
[3], NULL
);
3946 DEFUN (no_ipv6_route_flags_pref_tag
,
3947 no_ipv6_route_flags_pref_tag_cmd
,
3948 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
3951 "Establish static routes\n"
3952 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3953 "IPv6 gateway address\n"
3954 "IPv6 gateway interface name\n"
3955 "Emit an ICMP unreachable when matched\n"
3956 "Silently discard pkts when matched\n"
3957 "Set tag for this route\n"
3959 "Distance value for this prefix\n")
3961 /* We do not care about argv[2] */
3962 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], argv
[4], NULL
);
3965 DEFUN (no_ipv6_route_ifname_pref
,
3966 no_ipv6_route_ifname_pref_cmd
,
3967 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
3970 "Establish static routes\n"
3971 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3972 "IPv6 gateway address\n"
3973 "IPv6 gateway interface name\n"
3974 "Distance value for this prefix\n")
3976 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
, argv
[3], NULL
);
3979 DEFUN (no_ipv6_route_ifname_pref_tag
,
3980 no_ipv6_route_ifname_pref_tag_cmd
,
3981 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255>",
3984 "Establish static routes\n"
3985 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3986 "IPv6 gateway address\n"
3987 "IPv6 gateway interface name\n"
3988 "Set tag for this route\n"
3990 "Distance value for this prefix\n")
3992 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], argv
[4], NULL
);
3995 DEFUN (no_ipv6_route_ifname_flags_pref
,
3996 no_ipv6_route_ifname_flags_pref_cmd
,
3997 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255>",
4000 "Establish static routes\n"
4001 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4002 "IPv6 gateway address\n"
4003 "IPv6 gateway interface name\n"
4004 "Emit an ICMP unreachable when matched\n"
4005 "Silently discard pkts when matched\n"
4006 "Distance value for this prefix\n")
4008 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, argv
[4], NULL
);
4011 DEFUN (no_ipv6_route_ifname_flags_pref_tag
,
4012 no_ipv6_route_ifname_flags_pref_tag_cmd
,
4013 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255>",
4016 "Establish static routes\n"
4017 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4018 "IPv6 gateway address\n"
4019 "IPv6 gateway interface name\n"
4020 "Emit an ICMP unreachable when matched\n"
4021 "Silently discard pkts when matched\n"
4022 "Set tag for this route\n"
4024 "Distance value for this prefix\n")
4026 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], argv
[5], NULL
);
4029 DEFUN (ipv6_route_vrf
,
4031 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) " VRF_CMD_STR
,
4033 "Establish static routes\n"
4034 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4035 "IPv6 gateway address\n"
4036 "IPv6 gateway interface name\n"
4039 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, NULL
, NULL
, argv
[2]);
4042 DEFUN (ipv6_route_tag_vrf
,
4043 ipv6_route_tag_vrf_cmd
,
4044 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> " VRF_CMD_STR
,
4046 "Establish static routes\n"
4047 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4048 "IPv6 gateway address\n"
4049 "IPv6 gateway interface name\n"
4050 "Set tag for this route\n"
4054 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, argv
[2], NULL
, argv
[3]);
4057 DEFUN (ipv6_route_flags_vrf
,
4058 ipv6_route_flags_vrf_cmd
,
4059 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) " VRF_CMD_STR
,
4061 "Establish static routes\n"
4062 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4063 "IPv6 gateway address\n"
4064 "IPv6 gateway interface name\n"
4065 "Emit an ICMP unreachable when matched\n"
4066 "Silently discard pkts when matched\n"
4069 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
, NULL
, argv
[3]);
4072 DEFUN (ipv6_route_flags_tag_vrf
,
4073 ipv6_route_flags_tag_vrf_cmd
,
4074 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
4076 "Establish static routes\n"
4077 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4078 "IPv6 gateway address\n"
4079 "IPv6 gateway interface name\n"
4080 "Emit an ICMP unreachable when matched\n"
4081 "Silently discard pkts when matched\n"
4082 "Set tag for this route\n"
4086 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], NULL
, argv
[4]);
4089 DEFUN (ipv6_route_ifname_vrf
,
4090 ipv6_route_ifname_vrf_cmd
,
4091 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE " VRF_CMD_STR
,
4093 "Establish static routes\n"
4094 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4095 "IPv6 gateway address\n"
4096 "IPv6 gateway interface name\n"
4099 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
, NULL
, argv
[3]);
4101 DEFUN (ipv6_route_ifname_tag_vrf
,
4102 ipv6_route_ifname_tag_vrf_cmd
,
4103 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> " VRF_CMD_STR
,
4105 "Establish static routes\n"
4106 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4107 "IPv6 gateway address\n"
4108 "IPv6 gateway interface name\n"
4109 "Set tag for this route\n"
4113 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], NULL
, argv
[4]);
4116 DEFUN (ipv6_route_ifname_flags_vrf
,
4117 ipv6_route_ifname_flags_vrf_cmd
,
4118 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) " VRF_CMD_STR
,
4120 "Establish static routes\n"
4121 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4122 "IPv6 gateway address\n"
4123 "IPv6 gateway interface name\n"
4124 "Emit an ICMP unreachable when matched\n"
4125 "Silently discard pkts when matched\n"
4128 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, NULL
, argv
[4]);
4131 DEFUN (ipv6_route_ifname_flags_tag_vrf
,
4132 ipv6_route_ifname_flags_tag_vrf_cmd
,
4133 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
4135 "Establish static routes\n"
4136 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4137 "IPv6 gateway address\n"
4138 "IPv6 gateway interface name\n"
4139 "Emit an ICMP unreachable when matched\n"
4140 "Silently discard pkts when matched\n"
4141 "Set tag for this route\n"
4145 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], NULL
, argv
[5]);
4148 DEFUN (ipv6_route_pref_vrf
,
4149 ipv6_route_pref_vrf_cmd
,
4150 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255> " VRF_CMD_STR
,
4152 "Establish static routes\n"
4153 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4154 "IPv6 gateway address\n"
4155 "IPv6 gateway interface name\n"
4156 "Distance value for this prefix\n"
4159 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, NULL
, argv
[2], argv
[3]);
4162 DEFUN (ipv6_route_pref_tag_vrf
,
4163 ipv6_route_pref_tag_vrf_cmd
,
4164 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255> " VRF_CMD_STR
,
4166 "Establish static routes\n"
4167 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4168 "IPv6 gateway address\n"
4169 "IPv6 gateway interface name\n"
4170 "Set tag for this route\n"
4172 "Distance value for this prefix\n"
4175 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
, argv
[2], argv
[3], argv
[4]);
4178 DEFUN (ipv6_route_flags_pref_vrf
,
4179 ipv6_route_flags_pref_vrf_cmd
,
4180 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR
,
4182 "Establish static routes\n"
4183 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4184 "IPv6 gateway address\n"
4185 "IPv6 gateway interface name\n"
4186 "Emit an ICMP unreachable when matched\n"
4187 "Silently discard pkts when matched\n"
4188 "Distance value for this prefix\n"
4191 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], NULL
, argv
[3], argv
[4]);
4194 DEFUN (ipv6_route_flags_pref_tag_vrf
,
4195 ipv6_route_flags_pref_tag_vrf_cmd
,
4196 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
4198 "Establish static routes\n"
4199 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4200 "IPv6 gateway address\n"
4201 "IPv6 gateway interface name\n"
4202 "Emit an ICMP unreachable when matched\n"
4203 "Silently discard pkts when matched\n"
4204 "Set tag for this route\n"
4206 "Distance value for this prefix\n"
4209 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], argv
[4], argv
[5]);
4212 DEFUN (ipv6_route_ifname_pref_vrf
,
4213 ipv6_route_ifname_pref_vrf_cmd
,
4214 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255> " VRF_CMD_STR
,
4216 "Establish static routes\n"
4217 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4218 "IPv6 gateway address\n"
4219 "IPv6 gateway interface name\n"
4220 "Distance value for this prefix\n"
4223 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, NULL
, argv
[3], argv
[4]);
4226 DEFUN (ipv6_route_ifname_pref_tag_vrf
,
4227 ipv6_route_ifname_pref_tag_vrf_cmd
,
4228 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255> " VRF_CMD_STR
,
4230 "Establish static routes\n"
4231 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4232 "IPv6 gateway address\n"
4233 "IPv6 gateway interface name\n"
4234 "Set tag for this route\n"
4236 "Distance value for this prefix\n"
4239 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], argv
[4], argv
[5]);
4242 DEFUN (ipv6_route_ifname_flags_pref_vrf
,
4243 ipv6_route_ifname_flags_pref_vrf_cmd
,
4244 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255> " VRF_CMD_STR
,
4246 "Establish static routes\n"
4247 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4248 "IPv6 gateway address\n"
4249 "IPv6 gateway interface name\n"
4250 "Emit an ICMP unreachable when matched\n"
4251 "Silently discard pkts when matched\n"
4252 "Distance value for this prefix\n"
4255 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, argv
[4], argv
[5]);
4258 DEFUN (ipv6_route_ifname_flags_pref_tag_vrf
,
4259 ipv6_route_ifname_flags_pref_tag_vrf_cmd
,
4260 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
4262 "Establish static routes\n"
4263 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4264 "IPv6 gateway address\n"
4265 "IPv6 gateway interface name\n"
4266 "Emit an ICMP unreachable when matched\n"
4267 "Silently discard pkts when matched\n"
4268 "Set tag for this route\n"
4270 "Distance value for this prefix\n"
4273 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], argv
[5], argv
[6]);
4276 DEFUN (no_ipv6_route_vrf
,
4277 no_ipv6_route_vrf_cmd
,
4278 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) " VRF_CMD_STR
,
4281 "Establish static routes\n"
4282 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4283 "IPv6 gateway address\n"
4284 "IPv6 gateway interface name\n"
4287 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, NULL
, NULL
, argv
[2]);
4290 DEFUN (no_ipv6_route_tag_vrf
,
4291 no_ipv6_route_tag_vrf_cmd
,
4292 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> " VRF_CMD_STR
,
4295 "Establish static routes\n"
4296 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4297 "IPv6 gateway address\n"
4298 "IPv6 gateway interface name\n"
4299 "Set tag for this route\n"
4303 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, argv
[2], NULL
, argv
[3]);
4306 DEFUN (no_ipv6_route_flags_vrf
,
4307 no_ipv6_route_flags_vrf_cmd
,
4308 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) " VRF_CMD_STR
,
4311 "Establish static routes\n"
4312 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4313 "IPv6 gateway address\n"
4314 "IPv6 gateway interface name\n"
4315 "Emit an ICMP unreachable when matched\n"
4316 "Silently discard pkts when matched\n"
4319 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
, NULL
, argv
[3]);
4322 DEFUN (no_ipv6_route_flags_tag_vrf
,
4323 no_ipv6_route_flags_tag_vrf_cmd
,
4324 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
4327 "Establish static routes\n"
4328 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4329 "IPv6 gateway address\n"
4330 "IPv6 gateway interface name\n"
4331 "Emit an ICMP unreachable when matched\n"
4332 "Silently discard pkts when matched\n"
4333 "Set tag for this route\n"
4337 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], NULL
, argv
[4]);
4340 DEFUN (no_ipv6_route_ifname_vrf
,
4341 no_ipv6_route_ifname_vrf_cmd
,
4342 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE " VRF_CMD_STR
,
4345 "Establish static routes\n"
4346 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4347 "IPv6 gateway address\n"
4348 "IPv6 gateway interface name\n"
4351 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
, NULL
, argv
[3]);
4354 DEFUN (no_ipv6_route_ifname_tag_vrf
,
4355 no_ipv6_route_ifname_tag_vrf_cmd
,
4356 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> " VRF_CMD_STR
,
4359 "Establish static routes\n"
4360 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4361 "IPv6 gateway address\n"
4362 "IPv6 gateway interface name\n"
4363 "Set tag for this route\n"
4367 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], NULL
, argv
[4]);
4370 DEFUN (no_ipv6_route_ifname_flags_vrf
,
4371 no_ipv6_route_ifname_flags_vrf_cmd
,
4372 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) " VRF_CMD_STR
,
4375 "Establish static routes\n"
4376 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4377 "IPv6 gateway address\n"
4378 "IPv6 gateway interface name\n"
4379 "Emit an ICMP unreachable when matched\n"
4380 "Silently discard pkts when matched\n"
4383 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, NULL
, argv
[4]);
4386 DEFUN (no_ipv6_route_ifname_flags_tag_vrf
,
4387 no_ipv6_route_ifname_flags_tag_vrf_cmd
,
4388 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> " VRF_CMD_STR
,
4391 "Establish static routes\n"
4392 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4393 "IPv6 gateway address\n"
4394 "IPv6 gateway interface name\n"
4395 "Emit an ICMP unreachable when matched\n"
4396 "Silently discard pkts when matched\n"
4397 "Set tag for this route\n"
4401 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], NULL
, argv
[5]);
4404 DEFUN (no_ipv6_route_pref_vrf
,
4405 no_ipv6_route_pref_vrf_cmd
,
4406 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255> " VRF_CMD_STR
,
4409 "Establish static routes\n"
4410 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4411 "IPv6 gateway address\n"
4412 "IPv6 gateway interface name\n"
4413 "Distance value for this prefix\n"
4416 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, NULL
, argv
[2], argv
[3]);
4419 DEFUN (no_ipv6_route_pref_tag_vrf
,
4420 no_ipv6_route_pref_tag_vrf_cmd
,
4421 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255> " VRF_CMD_STR
,
4424 "Establish static routes\n"
4425 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4426 "IPv6 gateway address\n"
4427 "IPv6 gateway interface name\n"
4428 "Set tag for this route\n"
4430 "Distance value for this prefix\n"
4433 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
, argv
[2], argv
[3], argv
[4]);
4436 DEFUN (no_ipv6_route_flags_pref_vrf
,
4437 no_ipv6_route_flags_pref_vrf_cmd
,
4438 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR
,
4441 "Establish static routes\n"
4442 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4443 "IPv6 gateway address\n"
4444 "IPv6 gateway interface name\n"
4445 "Emit an ICMP unreachable when matched\n"
4446 "Silently discard pkts when matched\n"
4447 "Distance value for this prefix\n"
4450 /* We do not care about argv[2] */
4451 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], NULL
, argv
[3], argv
[4]);
4454 DEFUN (no_ipv6_route_flags_pref_tag_vrf
,
4455 no_ipv6_route_flags_pref_tag_vrf_cmd
,
4456 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
4459 "Establish static routes\n"
4460 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4461 "IPv6 gateway address\n"
4462 "IPv6 gateway interface name\n"
4463 "Emit an ICMP unreachable when matched\n"
4464 "Silently discard pkts when matched\n"
4465 "Set tag for this route\n"
4467 "Distance value for this prefix\n"
4470 /* We do not care about argv[2] */
4471 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2], argv
[3], argv
[4], argv
[5]);
4474 DEFUN (no_ipv6_route_ifname_pref_vrf
,
4475 no_ipv6_route_ifname_pref_vrf_cmd
,
4476 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255> " VRF_CMD_STR
,
4479 "Establish static routes\n"
4480 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4481 "IPv6 gateway address\n"
4482 "IPv6 gateway interface name\n"
4483 "Distance value for this prefix\n"
4486 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, NULL
, argv
[3], argv
[4]);
4489 DEFUN (no_ipv6_route_ifname_pref_tag_vrf
,
4490 no_ipv6_route_ifname_pref_tag_vrf_cmd
,
4491 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255> " VRF_CMD_STR
,
4494 "Establish static routes\n"
4495 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4496 "IPv6 gateway address\n"
4497 "IPv6 gateway interface name\n"
4498 "Set tag for this route\n"
4500 "Distance value for this prefix\n"
4503 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
, argv
[3], argv
[4], argv
[5]);
4506 DEFUN (no_ipv6_route_ifname_flags_pref_vrf
,
4507 no_ipv6_route_ifname_flags_pref_vrf_cmd
,
4508 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255> " VRF_CMD_STR
,
4511 "Establish static routes\n"
4512 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4513 "IPv6 gateway address\n"
4514 "IPv6 gateway interface name\n"
4515 "Emit an ICMP unreachable when matched\n"
4516 "Silently discard pkts when matched\n"
4517 "Distance value for this prefix\n"
4520 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], NULL
, argv
[4], argv
[5]);
4523 DEFUN (no_ipv6_route_ifname_flags_pref_tag_vrf
,
4524 no_ipv6_route_ifname_flags_pref_tag_vrf_cmd
,
4525 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR
,
4528 "Establish static routes\n"
4529 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4530 "IPv6 gateway address\n"
4531 "IPv6 gateway interface name\n"
4532 "Emit an ICMP unreachable when matched\n"
4533 "Silently discard pkts when matched\n"
4534 "Set tag for this route\n"
4536 "Distance value for this prefix\n"
4539 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3], argv
[4], argv
[5], argv
[6]);
4542 DEFUN (show_ipv6_route
,
4543 show_ipv6_route_cmd
,
4547 "IPv6 routing table\n")
4549 struct route_table
*table
;
4550 struct route_node
*rn
;
4553 vrf_id_t vrf_id
= VRF_DEFAULT
;
4554 struct zebra_vrf
*zvrf
= NULL
;
4558 if (!(zvrf
= zebra_vrf_list_lookup_by_name (argv
[0])))
4560 vty_out (vty
, "vrf %s not defined%s", argv
[0], VTY_NEWLINE
);
4564 if (zvrf
->vrf_id
== VRF_UNKNOWN
)
4566 vty_out (vty
, "vrf %s inactive%s", argv
[0], VTY_NEWLINE
);
4570 vrf_id
= zvrf
->vrf_id
;
4573 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4577 /* Show all IPv6 route. */
4578 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
4579 RNODE_FOREACH_RIB (rn
, rib
)
4583 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
4586 vty_show_ip_route (vty
, rn
, rib
);
4591 ALIAS (show_ipv6_route
,
4592 show_ipv6_route_vrf_cmd
,
4593 "show ipv6 route " VRF_CMD_STR
,
4596 "IPv6 routing table\n"
4599 DEFUN (show_ipv6_route_tag
,
4600 show_ipv6_route_tag_cmd
,
4601 "show ipv6 route tag <1-65535>",
4604 "IPv6 routing table\n"
4605 "Show only routes with tag\n"
4608 struct route_table
*table
;
4609 struct route_node
*rn
;
4613 vrf_id_t vrf_id
= VRF_DEFAULT
;
4617 VRF_GET_ID (vrf_id
, argv
[0]);
4618 tag
= atoi(argv
[1]);
4621 tag
= atoi(argv
[0]);
4623 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4627 /* Show all IPv6 routes with matching tag value. */
4628 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
4629 RNODE_FOREACH_RIB (rn
, rib
)
4631 if (rib
->tag
!= tag
)
4636 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
4639 vty_show_ip_route (vty
, rn
, rib
);
4644 ALIAS (show_ipv6_route_tag
,
4645 show_ipv6_route_vrf_tag_cmd
,
4646 "show ipv6 route " VRF_CMD_STR
" tag <1-65535>",
4649 "IPv6 routing table\n"
4651 "Show only routes with tag\n"
4654 DEFUN (show_ipv6_route_prefix_longer
,
4655 show_ipv6_route_prefix_longer_cmd
,
4656 "show ipv6 route X:X::X:X/M longer-prefixes",
4659 "IPv6 routing table\n"
4661 "Show route matching the specified Network/Mask pair only\n")
4663 struct route_table
*table
;
4664 struct route_node
*rn
;
4669 vrf_id_t vrf_id
= VRF_DEFAULT
;
4673 VRF_GET_ID (vrf_id
, argv
[0]);
4674 ret
= str2prefix (argv
[1], &p
);
4677 ret
= str2prefix (argv
[0], &p
);
4681 vty_out (vty
, "%% Malformed Prefix%s", VTY_NEWLINE
);
4685 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4689 /* Show matched type IPv6 routes. */
4690 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
4691 RNODE_FOREACH_RIB (rn
, rib
)
4692 if (prefix_match (&p
, &rn
->p
))
4696 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
4699 vty_show_ip_route (vty
, rn
, rib
);
4704 ALIAS (show_ipv6_route_prefix_longer
,
4705 show_ipv6_route_vrf_prefix_longer_cmd
,
4706 "show ipv6 route " VRF_CMD_STR
" X:X::X:X/M longer-prefixes",
4709 "IPv6 routing table\n"
4712 "Show route matching the specified Network/Mask pair only\n")
4714 DEFUN (show_ipv6_route_protocol
,
4715 show_ipv6_route_protocol_cmd
,
4716 "show ipv6 route " QUAGGA_IP6_REDIST_STR_ZEBRA
,
4719 "IP routing table\n"
4720 QUAGGA_IP6_REDIST_HELP_STR_ZEBRA
)
4723 struct route_table
*table
;
4724 struct route_node
*rn
;
4727 vrf_id_t vrf_id
= VRF_DEFAULT
;
4731 VRF_GET_ID (vrf_id
, argv
[0]);
4732 type
= proto_redistnum (AFI_IP6
, argv
[1]);
4735 type
= proto_redistnum (AFI_IP6
, argv
[0]);
4739 vty_out (vty
, "Unknown route type%s", VTY_NEWLINE
);
4743 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4747 /* Show matched type IPv6 routes. */
4748 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
4749 RNODE_FOREACH_RIB (rn
, rib
)
4750 if (rib
->type
== type
)
4754 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
4757 vty_show_ip_route (vty
, rn
, rib
);
4762 ALIAS (show_ipv6_route_protocol
,
4763 show_ipv6_route_vrf_protocol_cmd
,
4764 "show ipv6 route " VRF_CMD_STR
" " QUAGGA_IP6_REDIST_STR_ZEBRA
,
4767 "IP routing table\n"
4769 QUAGGA_IP6_REDIST_HELP_STR_ZEBRA
)
4771 DEFUN (show_ipv6_route_addr
,
4772 show_ipv6_route_addr_cmd
,
4773 "show ipv6 route X:X::X:X",
4776 "IPv6 routing table\n"
4780 struct prefix_ipv6 p
;
4781 struct route_table
*table
;
4782 struct route_node
*rn
;
4783 vrf_id_t vrf_id
= VRF_DEFAULT
;
4787 VRF_GET_ID (vrf_id
, argv
[0]);
4788 ret
= str2prefix_ipv6 (argv
[1], &p
);
4791 ret
= str2prefix_ipv6 (argv
[0], &p
);
4795 vty_out (vty
, "Malformed IPv6 address%s", VTY_NEWLINE
);
4799 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4803 rn
= route_node_match (table
, (struct prefix
*) &p
);
4806 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
4810 vty_show_ip_route_detail (vty
, rn
, 0);
4812 route_unlock_node (rn
);
4817 ALIAS (show_ipv6_route_addr
,
4818 show_ipv6_route_vrf_addr_cmd
,
4819 "show ipv6 route " VRF_CMD_STR
" X:X::X:X",
4822 "IPv6 routing table\n"
4826 DEFUN (show_ipv6_route_prefix
,
4827 show_ipv6_route_prefix_cmd
,
4828 "show ipv6 route X:X::X:X/M",
4831 "IPv6 routing table\n"
4835 struct prefix_ipv6 p
;
4836 struct route_table
*table
;
4837 struct route_node
*rn
;
4838 vrf_id_t vrf_id
= VRF_DEFAULT
;
4842 VRF_GET_ID (vrf_id
, argv
[0]);
4843 ret
= str2prefix_ipv6 (argv
[1], &p
);
4846 ret
= str2prefix_ipv6 (argv
[0], &p
);
4850 vty_out (vty
, "Malformed IPv6 prefix%s", VTY_NEWLINE
);
4854 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4858 rn
= route_node_match (table
, (struct prefix
*) &p
);
4859 if (! rn
|| rn
->p
.prefixlen
!= p
.prefixlen
)
4861 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
4865 vty_show_ip_route_detail (vty
, rn
, 0);
4867 route_unlock_node (rn
);
4872 ALIAS (show_ipv6_route_prefix
,
4873 show_ipv6_route_vrf_prefix_cmd
,
4874 "show ipv6 route " VRF_CMD_STR
" X:X::X:X/M ",
4877 "IPv6 routing table\n"
4881 /* Show route summary. */
4882 DEFUN (show_ipv6_route_summary
,
4883 show_ipv6_route_summary_cmd
,
4884 "show ipv6 route summary",
4887 "IPv6 routing table\n"
4888 "Summary of all IPv6 routes\n")
4890 struct route_table
*table
;
4891 vrf_id_t vrf_id
= VRF_DEFAULT
;
4894 VRF_GET_ID (vrf_id
, argv
[0]);
4896 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4900 vty_show_ip_route_summary (vty
, table
);
4905 ALIAS (show_ipv6_route_summary
,
4906 show_ipv6_route_vrf_summary_cmd
,
4907 "show ipv6 route " VRF_CMD_STR
" summary",
4910 "IPv6 routing table\n"
4912 "Summary of all IPv6 routes\n")
4914 /* Show ipv6 route summary prefix. */
4915 DEFUN (show_ipv6_route_summary_prefix
,
4916 show_ipv6_route_summary_prefix_cmd
,
4917 "show ipv6 route summary prefix",
4920 "IPv6 routing table\n"
4921 "Summary of all IPv6 routes\n"
4924 struct route_table
*table
;
4925 vrf_id_t vrf_id
= VRF_DEFAULT
;
4928 VRF_GET_ID (vrf_id
, argv
[0]);
4930 table
= zebra_vrf_table (AFI_IP6
, SAFI_UNICAST
, vrf_id
);
4934 vty_show_ip_route_summary_prefix (vty
, table
);
4939 ALIAS (show_ipv6_route_summary_prefix
,
4940 show_ipv6_route_vrf_summary_prefix_cmd
,
4941 "show ipv6 route " VRF_CMD_STR
" summary prefix",
4944 "IPv6 routing table\n"
4946 "Summary of all IPv6 routes\n"
4950 * Show IPv6 mroute command.Used to dump
4951 * the Multicast routing table.
4954 DEFUN (show_ipv6_mroute
,
4955 show_ipv6_mroute_cmd
,
4959 "IPv6 Multicast routing table\n")
4961 struct route_table
*table
;
4962 struct route_node
*rn
;
4965 vrf_id_t vrf_id
= VRF_DEFAULT
;
4968 VRF_GET_ID (vrf_id
, argv
[0]);
4970 table
= zebra_vrf_table (AFI_IP6
, SAFI_MULTICAST
, vrf_id
);
4974 /* Show all IPv6 route. */
4975 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
4976 RNODE_FOREACH_RIB (rn
, rib
)
4980 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
4983 vty_show_ip_route (vty
, rn
, rib
);
4988 ALIAS (show_ipv6_mroute
,
4989 show_ipv6_mroute_vrf_cmd
,
4990 "show ipv6 mroute " VRF_CMD_STR
,
4993 "IPv6 Multicast routing table\n"
4996 DEFUN (show_ipv6_route_vrf_all
,
4997 show_ipv6_route_vrf_all_cmd
,
4998 "show ipv6 route " VRF_ALL_CMD_STR
,
5001 "IPv6 routing table\n"
5002 VRF_ALL_CMD_HELP_STR
)
5004 struct route_table
*table
;
5005 struct route_node
*rn
;
5007 struct zebra_vrf
*zvrf
;
5012 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5014 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5015 (table
= zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5018 /* Show all IPv6 route. */
5019 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
5020 RNODE_FOREACH_RIB (rn
, rib
)
5024 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
5030 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
5033 vty_show_ip_route (vty
, rn
, rib
);
5041 DEFUN (show_ipv6_route_vrf_all_tag
,
5042 show_ipv6_route_vrf_all_tag_cmd
,
5043 "show ipv6 route " VRF_ALL_CMD_STR
" tag <1-65535>",
5046 "IPv6 routing table\n"
5047 VRF_ALL_CMD_HELP_STR
5048 "Show only routes with tag\n"
5051 struct route_table
*table
;
5052 struct route_node
*rn
;
5054 struct zebra_vrf
*zvrf
;
5061 tag
= atoi(argv
[0]);
5063 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5065 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5066 (table
= zvrf
->table
[AFI_IP
][SAFI_UNICAST
]) == NULL
)
5069 /* Show all IPv6 routes with matching tag value. */
5070 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
5071 RNODE_FOREACH_RIB (rn
, rib
)
5073 if (rib
->tag
!= tag
)
5078 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
5084 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
5087 vty_show_ip_route (vty
, rn
, rib
);
5095 DEFUN (show_ipv6_route_vrf_all_prefix_longer
,
5096 show_ipv6_route_vrf_all_prefix_longer_cmd
,
5097 "show ipv6 route " VRF_ALL_CMD_STR
" X:X::X:X/M longer-prefixes",
5100 "IPv6 routing table\n"
5101 VRF_ALL_CMD_HELP_STR
5103 "Show route matching the specified Network/Mask pair only\n")
5105 struct route_table
*table
;
5106 struct route_node
*rn
;
5109 struct zebra_vrf
*zvrf
;
5115 ret
= str2prefix (argv
[0], &p
);
5118 vty_out (vty
, "%% Malformed Prefix%s", VTY_NEWLINE
);
5122 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5124 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5125 (table
= zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5128 /* Show matched type IPv6 routes. */
5129 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
5130 RNODE_FOREACH_RIB (rn
, rib
)
5131 if (prefix_match (&p
, &rn
->p
))
5135 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
5141 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
5144 vty_show_ip_route (vty
, rn
, rib
);
5152 DEFUN (show_ipv6_route_vrf_all_protocol
,
5153 show_ipv6_route_vrf_all_protocol_cmd
,
5154 "show ipv6 route " VRF_ALL_CMD_STR
" " QUAGGA_IP6_REDIST_STR_ZEBRA
,
5157 "IP routing table\n"
5158 VRF_ALL_CMD_HELP_STR
5159 QUAGGA_IP6_REDIST_HELP_STR_ZEBRA
)
5162 struct route_table
*table
;
5163 struct route_node
*rn
;
5165 struct zebra_vrf
*zvrf
;
5170 type
= proto_redistnum (AFI_IP6
, argv
[0]);
5173 vty_out (vty
, "Unknown route type%s", VTY_NEWLINE
);
5177 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5179 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5180 (table
= zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5183 /* Show matched type IPv6 routes. */
5184 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
5185 RNODE_FOREACH_RIB (rn
, rib
)
5186 if (rib
->type
== type
)
5190 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
5196 vty_out (vty
, "%sVRF %s:%s", VTY_NEWLINE
, zvrf
->name
, VTY_NEWLINE
);
5199 vty_show_ip_route (vty
, rn
, rib
);
5207 DEFUN (show_ipv6_route_vrf_all_addr
,
5208 show_ipv6_route_vrf_all_addr_cmd
,
5209 "show ipv6 route " VRF_ALL_CMD_STR
" X:X::X:X",
5212 "IPv6 routing table\n"
5213 VRF_ALL_CMD_HELP_STR
5217 struct prefix_ipv6 p
;
5218 struct route_table
*table
;
5219 struct route_node
*rn
;
5220 struct zebra_vrf
*zvrf
;
5223 ret
= str2prefix_ipv6 (argv
[0], &p
);
5226 vty_out (vty
, "Malformed IPv6 address%s", VTY_NEWLINE
);
5230 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5232 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5233 (table
= zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5236 rn
= route_node_match (table
, (struct prefix
*) &p
);
5240 vty_show_ip_route_detail (vty
, rn
, 0);
5242 route_unlock_node (rn
);
5248 DEFUN (show_ipv6_route_vrf_all_prefix
,
5249 show_ipv6_route_vrf_all_prefix_cmd
,
5250 "show ipv6 route " VRF_ALL_CMD_STR
" X:X::X:X/M",
5253 "IPv6 routing table\n"
5254 VRF_ALL_CMD_HELP_STR
5258 struct prefix_ipv6 p
;
5259 struct route_table
*table
;
5260 struct route_node
*rn
;
5261 struct zebra_vrf
*zvrf
;
5264 ret
= str2prefix_ipv6 (argv
[0], &p
);
5267 vty_out (vty
, "Malformed IPv6 prefix%s", VTY_NEWLINE
);
5271 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5273 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5274 (table
= zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5277 rn
= route_node_match (table
, (struct prefix
*) &p
);
5280 if (rn
->p
.prefixlen
!= p
.prefixlen
)
5282 route_unlock_node (rn
);
5286 vty_show_ip_route_detail (vty
, rn
, 0);
5288 route_unlock_node (rn
);
5294 DEFUN (show_ipv6_route_vrf_all_summary
,
5295 show_ipv6_route_vrf_all_summary_cmd
,
5296 "show ipv6 route " VRF_ALL_CMD_STR
" summary",
5299 "IPv6 routing table\n"
5300 VRF_ALL_CMD_HELP_STR
5301 "Summary of all IPv6 routes\n")
5303 struct zebra_vrf
*zvrf
;
5306 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5307 if ((zvrf
= vrf_iter2info (iter
)) != NULL
)
5308 vty_show_ip_route_summary (vty
, zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]);
5313 DEFUN (show_ipv6_mroute_vrf_all
,
5314 show_ipv6_mroute_vrf_all_cmd
,
5315 "show ipv6 mroute " VRF_ALL_CMD_STR
,
5318 "IPv6 Multicast routing table\n"
5319 VRF_ALL_CMD_HELP_STR
)
5321 struct route_table
*table
;
5322 struct route_node
*rn
;
5324 struct zebra_vrf
*zvrf
;
5328 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5330 if ((zvrf
= vrf_iter2info (iter
)) == NULL
||
5331 (table
= zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5334 /* Show all IPv6 route. */
5335 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
5336 RNODE_FOREACH_RIB (rn
, rib
)
5340 vty_out (vty
, SHOW_ROUTE_V6_HEADER
);
5343 vty_show_ip_route (vty
, rn
, rib
);
5349 DEFUN (show_ipv6_route_vrf_all_summary_prefix
,
5350 show_ipv6_route_vrf_all_summary_prefix_cmd
,
5351 "show ipv6 route " VRF_ALL_CMD_STR
" summary prefix",
5354 "IPv6 routing table\n"
5355 VRF_ALL_CMD_HELP_STR
5356 "Summary of all IPv6 routes\n"
5359 struct zebra_vrf
*zvrf
;
5362 for (iter
= vrf_first (); iter
!= VRF_ITER_INVALID
; iter
= vrf_next (iter
))
5363 if ((zvrf
= vrf_iter2info (iter
)) != NULL
)
5364 vty_show_ip_route_summary_prefix (vty
, zvrf
->table
[AFI_IP6
][SAFI_UNICAST
]);
5369 /* Write IPv6 static route configuration. */
5371 static_config_ipv6 (struct vty
*vty
)
5373 struct route_node
*rn
;
5374 struct static_route
*si
;
5376 char buf
[PREFIX_STRLEN
];
5377 struct route_table
*stable
;
5378 struct zebra_vrf
*zvrf
;
5379 struct listnode
*node
;
5381 for (ALL_LIST_ELEMENTS_RO (zvrf_list
, node
, zvrf
))
5383 if ((stable
= zvrf
->stable
[AFI_IP6
][SAFI_UNICAST
]) == NULL
)
5386 for (rn
= route_top (stable
); rn
; rn
= route_next (rn
))
5387 for (si
= rn
->info
; si
; si
= si
->next
)
5389 vty_out (vty
, "ipv6 route %s", prefix2str (&rn
->p
, buf
, sizeof buf
));
5393 case STATIC_IPV6_GATEWAY
:
5394 vty_out (vty
, " %s", inet_ntop (AF_INET6
, &si
->addr
.ipv6
, buf
, BUFSIZ
));
5396 case STATIC_IFINDEX
:
5397 vty_out (vty
, " %s", si
->ifname
);
5399 case STATIC_IPV6_GATEWAY_IFINDEX
:
5400 vty_out (vty
, " %s %s",
5401 inet_ntop (AF_INET6
, &si
->addr
.ipv6
, buf
, BUFSIZ
),
5402 ifindex2ifname_vrf (si
->ifindex
, si
->vrf_id
));
5406 if (CHECK_FLAG(si
->flags
, ZEBRA_FLAG_REJECT
))
5407 vty_out (vty
, " %s", "reject");
5409 if (CHECK_FLAG(si
->flags
, ZEBRA_FLAG_BLACKHOLE
))
5410 vty_out (vty
, " %s", "blackhole");
5413 vty_out (vty
, " tag %d", si
->tag
);
5415 if (si
->distance
!= ZEBRA_STATIC_DISTANCE_DEFAULT
)
5416 vty_out (vty
, " %d", si
->distance
);
5418 if (si
->vrf_id
!= VRF_DEFAULT
)
5420 vty_out (vty
, " vrf %s", zvrf
->name
);
5423 vty_out (vty
, "%s", VTY_NEWLINE
);
5430 #endif /* HAVE_IPV6 */
5432 DEFUN (allow_external_route_update
,
5433 allow_external_route_update_cmd
,
5434 "allow-external-route-update",
5435 "Allow Quagga routes to be overwritten by external processes")
5442 DEFUN (no_allow_external_route_update
,
5443 no_allow_external_route_update_cmd
,
5444 "no allow-external-route-update",
5445 "Allow Quagga routes to be overwritten by external processes")
5459 struct zebra_vrf
*zvrf
;
5460 struct listnode
*node
;
5462 for (ALL_LIST_ELEMENTS_RO (zvrf_list
, node
, zvrf
))
5467 vty_out (vty
, "vrf %s ", zvrf
->name
);
5468 if (zvrf
->vrf_id
== VRF_UNKNOWN
)
5469 vty_out (vty
, "inactive");
5471 vty_out (vty
, "id %u table %u", zvrf
->vrf_id
, zvrf
->table_id
);
5472 vty_out (vty
, "%s", VTY_NEWLINE
);
5479 /* Static ip route configuration write function. */
5481 zebra_ip_config (struct vty
*vty
)
5485 write
+= static_config_ipv4 (vty
, SAFI_UNICAST
, "ip route");
5486 write
+= static_config_ipv4 (vty
, SAFI_MULTICAST
, "ip mroute");
5488 write
+= static_config_ipv6 (vty
);
5489 #endif /* HAVE_IPV6 */
5491 write
+= zebra_import_table_config (vty
);
5495 DEFUN (ip_zebra_import_table_distance
,
5496 ip_zebra_import_table_distance_cmd
,
5497 "ip import-table <1-252> distance <1-255>",
5499 "import routes from non-main kernel table\n"
5500 "kernel routing table id\n"
5501 "Distance for imported routes\n"
5502 "Default distance value\n")
5504 u_int32_t table_id
= 0;
5505 int distance
= ZEBRA_TABLE_DISTANCE_DEFAULT
;
5508 VTY_GET_INTEGER("table", table_id
, argv
[0]);
5510 if (!is_zebra_valid_kernel_table(table_id
))
5512 vty_out(vty
, "Invalid routing table ID, %d. Must be in range 1-252%s",
5513 table_id
, VTY_NEWLINE
);
5517 if (is_zebra_main_routing_table(table_id
))
5519 vty_out(vty
, "Invalid routing table ID, %d. Must be non-default table%s",
5520 table_id
, VTY_NEWLINE
);
5525 VTY_GET_INTEGER_RANGE("distance", distance
, argv
[1], 1, 255);
5526 return (zebra_import_table(AFI_IP
, table_id
, distance
, NULL
, 1));
5530 ALIAS (ip_zebra_import_table_distance
,
5531 ip_zebra_import_table_cmd
,
5532 "ip import-table <1-252>",
5534 "import routes from non-main kernel table\n"
5535 "kernel routing table id\n")
5537 DEFUN (ip_zebra_import_table_distance_routemap
,
5538 ip_zebra_import_table_distance_routemap_cmd
,
5539 "ip import-table <1-252> distance <1-255> route-map WORD",
5541 "import routes from non-main kernel table\n"
5542 "kernel routing table id\n"
5543 "Distance for imported routes\n"
5544 "Default distance value\n"
5545 "route-map for filtering\n"
5548 u_int32_t table_id
= 0;
5549 int distance
= ZEBRA_TABLE_DISTANCE_DEFAULT
;
5550 const char *rmap_name
;
5553 VTY_GET_INTEGER("table", table_id
, argv
[0]);
5555 if (!is_zebra_valid_kernel_table(table_id
))
5557 vty_out(vty
, "Invalid routing table ID, %d. Must be in range 1-252%s",
5558 table_id
, VTY_NEWLINE
);
5562 if (is_zebra_main_routing_table(table_id
))
5564 vty_out(vty
, "Invalid routing table ID, %d. Must be non-default table%s",
5565 table_id
, VTY_NEWLINE
);
5571 VTY_GET_INTEGER_RANGE("distance", distance
, argv
[1], 1, 255);
5572 rmap_name
= XSTRDUP (MTYPE_ROUTE_MAP_NAME
, argv
[2]);
5575 rmap_name
= XSTRDUP (MTYPE_ROUTE_MAP_NAME
, argv
[1]);
5577 return (zebra_import_table(AFI_IP
, table_id
, distance
, rmap_name
, 1));
5580 ALIAS (ip_zebra_import_table_distance_routemap
,
5581 ip_zebra_import_table_routemap_cmd
,
5582 "ip import-table <1-252> route-map WORD",
5584 "import routes from non-main kernel table\n"
5585 "kernel routing table id\n"
5586 "route-map for filtering\n"
5589 DEFUN (no_ip_zebra_import_table
,
5590 no_ip_zebra_import_table_cmd
,
5591 "no ip import-table <1-252> {route-map NAME}",
5594 "import routes from non-main kernel table\n"
5595 "kernel routing table id\n")
5597 u_int32_t table_id
= 0;
5600 VTY_GET_INTEGER("table", table_id
, argv
[0]);
5602 if (!is_zebra_valid_kernel_table(table_id
))
5604 vty_out(vty
, "Invalid routing table ID. Must be in range 1-252%s",
5609 if (is_zebra_main_routing_table(table_id
))
5611 vty_out(vty
, "Invalid routing table ID, %d. Must be non-default table%s",
5612 table_id
, VTY_NEWLINE
);
5616 if (!is_zebra_import_table_enabled(AFI_IP
, table_id
))
5619 return (zebra_import_table(AFI_IP
, table_id
, 0, NULL
, 0));
5622 ALIAS (no_ip_zebra_import_table
,
5623 no_ip_zebra_import_table_distance_cmd
,
5624 "no ip import-table <1-252> distance <1-255> {route-map NAME}",
5626 "import routes from non-main kernel table to main table"
5627 "kernel routing table id\n"
5628 "distance to be used\n")
5631 config_write_protocol (struct vty
*vty
)
5634 vty_out(vty
, "allow-external-route-update%s", VTY_NEWLINE
);
5636 if (zebra_rnh_ip_default_route
)
5637 vty_out(vty
, "ip nht resolve-via-default%s", VTY_NEWLINE
);
5639 if (zebra_rnh_ipv6_default_route
)
5640 vty_out(vty
, "ipv6 nht resolve-via-default%s", VTY_NEWLINE
);
5642 enum multicast_mode ipv4_multicast_mode
= multicast_mode_ipv4_get ();
5644 if (ipv4_multicast_mode
!= MCAST_NO_CONFIG
)
5645 vty_out (vty
, "ip multicast rpf-lookup-mode %s%s",
5646 ipv4_multicast_mode
== MCAST_URIB_ONLY
? "urib-only" :
5647 ipv4_multicast_mode
== MCAST_MRIB_ONLY
? "mrib-only" :
5648 ipv4_multicast_mode
== MCAST_MIX_MRIB_FIRST
? "mrib-then-urib" :
5649 ipv4_multicast_mode
== MCAST_MIX_DISTANCE
? "lower-distance" :
5653 zebra_routemap_config_write_protocol(vty
);
5658 /* IP node for static routes. */
5659 static struct cmd_node ip_node
= { IP_NODE
, "", 1 };
5660 static struct cmd_node protocol_node
= { PROTOCOL_NODE
, "", 1 };
5664 zebra_vty_init (void)
5666 install_node (&ip_node
, zebra_ip_config
);
5667 install_node (&protocol_node
, config_write_protocol
);
5669 install_element (CONFIG_NODE
, &allow_external_route_update_cmd
);
5670 install_element (CONFIG_NODE
, &no_allow_external_route_update_cmd
);
5671 install_element (CONFIG_NODE
, &ip_mroute_cmd
);
5672 install_element (CONFIG_NODE
, &ip_mroute_dist_cmd
);
5673 install_element (CONFIG_NODE
, &no_ip_mroute_cmd
);
5674 install_element (CONFIG_NODE
, &no_ip_mroute_dist_cmd
);
5675 install_element (CONFIG_NODE
, &ip_multicast_mode_cmd
);
5676 install_element (CONFIG_NODE
, &no_ip_multicast_mode_cmd
);
5677 install_element (CONFIG_NODE
, &no_ip_multicast_mode_noarg_cmd
);
5678 install_element (CONFIG_NODE
, &ip_route_cmd
);
5679 install_element (CONFIG_NODE
, &ip_route_tag_cmd
);
5680 install_element (CONFIG_NODE
, &ip_route_flags_cmd
);
5681 install_element (CONFIG_NODE
, &ip_route_flags_tag_cmd
);
5682 install_element (CONFIG_NODE
, &ip_route_flags2_cmd
);
5683 install_element (CONFIG_NODE
, &ip_route_flags2_tag_cmd
);
5684 install_element (CONFIG_NODE
, &ip_route_mask_cmd
);
5685 install_element (CONFIG_NODE
, &ip_route_mask_tag_cmd
);
5686 install_element (CONFIG_NODE
, &ip_route_mask_flags_cmd
);
5687 install_element (CONFIG_NODE
, &ip_route_mask_flags_tag_cmd
);
5688 install_element (CONFIG_NODE
, &ip_route_mask_flags2_cmd
);
5689 install_element (CONFIG_NODE
, &ip_route_mask_flags2_tag_cmd
);
5690 install_element (CONFIG_NODE
, &no_ip_route_cmd
);
5691 install_element (CONFIG_NODE
, &no_ip_route_tag_cmd
);
5692 install_element (CONFIG_NODE
, &no_ip_route_flags_cmd
);
5693 install_element (CONFIG_NODE
, &no_ip_route_flags_tag_cmd
);
5694 install_element (CONFIG_NODE
, &no_ip_route_flags2_cmd
);
5695 install_element (CONFIG_NODE
, &no_ip_route_flags2_tag_cmd
);
5696 install_element (CONFIG_NODE
, &no_ip_route_mask_cmd
);
5697 install_element (CONFIG_NODE
, &no_ip_route_mask_tag_cmd
);
5698 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_cmd
);
5699 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_tag_cmd
);
5700 install_element (CONFIG_NODE
, &no_ip_route_mask_flags2_cmd
);
5701 install_element (CONFIG_NODE
, &no_ip_route_mask_flags2_tag_cmd
);
5702 install_element (CONFIG_NODE
, &ip_route_distance_cmd
);
5703 install_element (CONFIG_NODE
, &ip_route_tag_distance_cmd
);
5704 install_element (CONFIG_NODE
, &ip_route_flags_distance_cmd
);
5705 install_element (CONFIG_NODE
, &ip_route_flags_tag_distance_cmd
);
5706 install_element (CONFIG_NODE
, &ip_route_flags_distance2_cmd
);
5707 install_element (CONFIG_NODE
, &ip_route_flags_tag_distance2_cmd
);
5708 install_element (CONFIG_NODE
, &ip_route_mask_distance_cmd
);
5709 install_element (CONFIG_NODE
, &ip_route_mask_tag_distance_cmd
);
5710 install_element (CONFIG_NODE
, &ip_route_mask_flags_distance_cmd
);
5711 install_element (CONFIG_NODE
, &ip_route_mask_flags_tag_distance_cmd
);
5712 install_element (CONFIG_NODE
, &ip_route_mask_flags_distance2_cmd
);
5713 install_element (CONFIG_NODE
, &ip_route_mask_flags_tag_distance2_cmd
);
5714 install_element (CONFIG_NODE
, &no_ip_route_distance_cmd
);
5715 install_element (CONFIG_NODE
, &no_ip_route_tag_distance_cmd
);
5716 install_element (CONFIG_NODE
, &no_ip_route_flags_distance_cmd
);
5717 install_element (CONFIG_NODE
, &no_ip_route_flags_tag_distance_cmd
);
5718 install_element (CONFIG_NODE
, &no_ip_route_flags_distance2_cmd
);
5719 install_element (CONFIG_NODE
, &no_ip_route_flags_tag_distance2_cmd
);
5720 install_element (CONFIG_NODE
, &no_ip_route_mask_distance_cmd
);
5721 install_element (CONFIG_NODE
, &no_ip_route_mask_tag_distance_cmd
);
5722 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_distance_cmd
);
5723 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_tag_distance_cmd
);
5724 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_distance2_cmd
);
5725 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_tag_distance2_cmd
);
5726 install_element (CONFIG_NODE
, &ip_zebra_import_table_cmd
);
5727 install_element (CONFIG_NODE
, &ip_zebra_import_table_distance_cmd
);
5728 install_element (CONFIG_NODE
, &ip_zebra_import_table_routemap_cmd
);
5729 install_element (CONFIG_NODE
, &ip_zebra_import_table_distance_routemap_cmd
);
5730 install_element (CONFIG_NODE
, &no_ip_zebra_import_table_cmd
);
5731 install_element (CONFIG_NODE
, &no_ip_zebra_import_table_distance_cmd
);
5733 install_element (VIEW_NODE
, &show_vrf_cmd
);
5734 install_element (VIEW_NODE
, &show_ip_route_cmd
);
5735 install_element (VIEW_NODE
, &show_ip_route_ospf_instance_cmd
);
5736 install_element (VIEW_NODE
, &show_ip_route_tag_cmd
);
5737 install_element (VIEW_NODE
, &show_ip_nht_cmd
);
5738 install_element (VIEW_NODE
, &show_ip_nht_vrf_cmd
);
5739 install_element (VIEW_NODE
, &show_ip_nht_vrf_all_cmd
);
5740 install_element (VIEW_NODE
, &show_ipv6_nht_cmd
);
5741 install_element (VIEW_NODE
, &show_ipv6_nht_vrf_cmd
);
5742 install_element (VIEW_NODE
, &show_ipv6_nht_vrf_all_cmd
);
5743 install_element (VIEW_NODE
, &show_ip_route_addr_cmd
);
5744 install_element (VIEW_NODE
, &show_ip_route_prefix_cmd
);
5745 install_element (VIEW_NODE
, &show_ip_route_prefix_longer_cmd
);
5746 install_element (VIEW_NODE
, &show_ip_route_protocol_cmd
);
5747 install_element (VIEW_NODE
, &show_ip_route_supernets_cmd
);
5748 install_element (VIEW_NODE
, &show_ip_route_summary_cmd
);
5749 install_element (VIEW_NODE
, &show_ip_route_summary_prefix_cmd
);
5750 install_element (ENABLE_NODE
, &show_vrf_cmd
);
5751 install_element (ENABLE_NODE
, &show_ip_route_cmd
);
5752 install_element (ENABLE_NODE
, &show_ip_route_ospf_instance_cmd
);
5753 install_element (ENABLE_NODE
, &show_ip_route_tag_cmd
);
5754 install_element (ENABLE_NODE
, &show_ip_nht_cmd
);
5755 install_element (ENABLE_NODE
, &show_ip_nht_vrf_cmd
);
5756 install_element (ENABLE_NODE
, &show_ip_nht_vrf_all_cmd
);
5757 install_element (ENABLE_NODE
, &show_ipv6_nht_cmd
);
5758 install_element (ENABLE_NODE
, &show_ipv6_nht_vrf_cmd
);
5759 install_element (ENABLE_NODE
, &show_ipv6_nht_vrf_all_cmd
);
5760 install_element (ENABLE_NODE
, &show_ip_route_addr_cmd
);
5761 install_element (ENABLE_NODE
, &show_ip_route_prefix_cmd
);
5762 install_element (ENABLE_NODE
, &show_ip_route_prefix_longer_cmd
);
5763 install_element (ENABLE_NODE
, &show_ip_route_protocol_cmd
);
5764 install_element (ENABLE_NODE
, &show_ip_route_supernets_cmd
);
5765 install_element (ENABLE_NODE
, &show_ip_route_summary_cmd
);
5766 install_element (ENABLE_NODE
, &show_ip_route_summary_prefix_cmd
);
5768 install_element (VIEW_NODE
, &show_ip_rpf_cmd
);
5769 install_element (ENABLE_NODE
, &show_ip_rpf_cmd
);
5770 install_element (VIEW_NODE
, &show_ip_rpf_addr_cmd
);
5771 install_element (ENABLE_NODE
, &show_ip_rpf_addr_cmd
);
5773 /* Commands for VRF */
5775 install_element (CONFIG_NODE
, &ip_route_vrf_cmd
);
5776 install_element (CONFIG_NODE
, &ip_route_tag_vrf_cmd
);
5777 install_element (CONFIG_NODE
, &ip_route_flags_vrf_cmd
);
5778 install_element (CONFIG_NODE
, &ip_route_flags_tag_vrf_cmd
);
5779 install_element (CONFIG_NODE
, &ip_route_flags2_vrf_cmd
);
5780 install_element (CONFIG_NODE
, &ip_route_flags2_tag_vrf_cmd
);
5781 install_element (CONFIG_NODE
, &ip_route_mask_vrf_cmd
);
5782 install_element (CONFIG_NODE
, &ip_route_mask_tag_vrf_cmd
);
5783 install_element (CONFIG_NODE
, &ip_route_mask_flags_vrf_cmd
);
5784 install_element (CONFIG_NODE
, &ip_route_mask_flags_tag_vrf_cmd
);
5785 install_element (CONFIG_NODE
, &ip_route_mask_flags2_vrf_cmd
);
5786 install_element (CONFIG_NODE
, &ip_route_mask_flags2_tag_vrf_cmd
);
5787 install_element (CONFIG_NODE
, &no_ip_route_vrf_cmd
);
5788 install_element (CONFIG_NODE
, &no_ip_route_tag_vrf_cmd
);
5789 install_element (CONFIG_NODE
, &no_ip_route_flags_vrf_cmd
);
5790 install_element (CONFIG_NODE
, &no_ip_route_flags_tag_vrf_cmd
);
5791 install_element (CONFIG_NODE
, &no_ip_route_flags2_vrf_cmd
);
5792 install_element (CONFIG_NODE
, &no_ip_route_flags2_tag_vrf_cmd
);
5793 install_element (CONFIG_NODE
, &no_ip_route_mask_vrf_cmd
);
5794 install_element (CONFIG_NODE
, &no_ip_route_mask_tag_vrf_cmd
);
5795 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_vrf_cmd
);
5796 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_tag_vrf_cmd
);
5797 install_element (CONFIG_NODE
, &no_ip_route_mask_flags2_vrf_cmd
);
5798 install_element (CONFIG_NODE
, &no_ip_route_mask_flags2_tag_vrf_cmd
);
5799 install_element (CONFIG_NODE
, &ip_route_distance_vrf_cmd
);
5800 install_element (CONFIG_NODE
, &ip_route_tag_distance_vrf_cmd
);
5801 install_element (CONFIG_NODE
, &ip_route_flags_distance_vrf_cmd
);
5802 install_element (CONFIG_NODE
, &ip_route_flags_tag_distance_vrf_cmd
);
5803 install_element (CONFIG_NODE
, &ip_route_flags_distance2_vrf_cmd
);
5804 install_element (CONFIG_NODE
, &ip_route_flags_tag_distance2_vrf_cmd
);
5805 install_element (CONFIG_NODE
, &ip_route_mask_distance_vrf_cmd
);
5806 install_element (CONFIG_NODE
, &ip_route_mask_tag_distance_vrf_cmd
);
5807 install_element (CONFIG_NODE
, &ip_route_mask_flags_distance_vrf_cmd
);
5808 install_element (CONFIG_NODE
, &ip_route_mask_flags_tag_distance_vrf_cmd
);
5809 install_element (CONFIG_NODE
, &ip_route_mask_flags_distance2_vrf_cmd
);
5810 install_element (CONFIG_NODE
, &ip_route_mask_flags_tag_distance2_vrf_cmd
);
5811 install_element (CONFIG_NODE
, &no_ip_route_distance_vrf_cmd
);
5812 install_element (CONFIG_NODE
, &no_ip_route_tag_distance_vrf_cmd
);
5813 install_element (CONFIG_NODE
, &no_ip_route_flags_distance_vrf_cmd
);
5814 install_element (CONFIG_NODE
, &no_ip_route_flags_tag_distance_vrf_cmd
);
5815 install_element (CONFIG_NODE
, &no_ip_route_flags_distance2_vrf_cmd
);
5816 install_element (CONFIG_NODE
, &no_ip_route_flags_tag_distance2_vrf_cmd
);
5817 install_element (CONFIG_NODE
, &no_ip_route_mask_distance_vrf_cmd
);
5818 install_element (CONFIG_NODE
, &no_ip_route_mask_tag_distance_vrf_cmd
);
5819 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_distance_vrf_cmd
);
5820 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_tag_distance_vrf_cmd
);
5821 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_distance2_vrf_cmd
);
5822 install_element (CONFIG_NODE
, &no_ip_route_mask_flags_tag_distance2_vrf_cmd
);
5824 install_element (VIEW_NODE
, &show_ip_route_vrf_cmd
);
5825 install_element (VIEW_NODE
, &show_ip_route_vrf_addr_cmd
);
5826 install_element (VIEW_NODE
, &show_ip_route_vrf_tag_cmd
);
5827 install_element (VIEW_NODE
, &show_ip_route_vrf_prefix_cmd
);
5828 install_element (VIEW_NODE
, &show_ip_route_vrf_prefix_longer_cmd
);
5829 install_element (VIEW_NODE
, &show_ip_route_vrf_protocol_cmd
);
5830 install_element (VIEW_NODE
, &show_ip_route_vrf_supernets_cmd
);
5831 install_element (VIEW_NODE
, &show_ip_route_vrf_summary_cmd
);
5832 install_element (VIEW_NODE
, &show_ip_route_vrf_summary_prefix_cmd
);
5833 install_element (ENABLE_NODE
, &show_ip_route_vrf_cmd
);
5834 install_element (ENABLE_NODE
, &show_ip_route_vrf_addr_cmd
);
5835 install_element (ENABLE_NODE
, &show_ip_route_vrf_tag_cmd
);
5836 install_element (ENABLE_NODE
, &show_ip_route_vrf_prefix_cmd
);
5837 install_element (ENABLE_NODE
, &show_ip_route_vrf_prefix_longer_cmd
);
5838 install_element (ENABLE_NODE
, &show_ip_route_vrf_protocol_cmd
);
5839 install_element (ENABLE_NODE
, &show_ip_route_vrf_supernets_cmd
);
5840 install_element (ENABLE_NODE
, &show_ip_route_vrf_summary_cmd
);
5841 install_element (ENABLE_NODE
, &show_ip_route_vrf_summary_prefix_cmd
);
5843 install_element (VIEW_NODE
, &show_ip_route_vrf_all_cmd
);
5844 install_element (VIEW_NODE
, &show_ip_route_vrf_all_tag_cmd
);
5845 install_element (VIEW_NODE
, &show_ip_route_vrf_all_addr_cmd
);
5846 install_element (VIEW_NODE
, &show_ip_route_vrf_all_prefix_cmd
);
5847 install_element (VIEW_NODE
, &show_ip_route_vrf_all_prefix_longer_cmd
);
5848 install_element (VIEW_NODE
, &show_ip_route_vrf_all_protocol_cmd
);
5849 install_element (VIEW_NODE
, &show_ip_route_vrf_all_supernets_cmd
);
5850 install_element (VIEW_NODE
, &show_ip_route_vrf_all_summary_cmd
);
5851 install_element (VIEW_NODE
, &show_ip_route_vrf_all_summary_prefix_cmd
);
5852 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_cmd
);
5853 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_tag_cmd
);
5854 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_addr_cmd
);
5855 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_prefix_cmd
);
5856 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_prefix_longer_cmd
);
5857 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_protocol_cmd
);
5858 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_supernets_cmd
);
5859 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_summary_cmd
);
5860 install_element (ENABLE_NODE
, &show_ip_route_vrf_all_summary_prefix_cmd
);
5863 install_element (CONFIG_NODE
, &ipv6_route_cmd
);
5864 install_element (CONFIG_NODE
, &ipv6_route_flags_cmd
);
5865 install_element (CONFIG_NODE
, &ipv6_route_ifname_cmd
);
5866 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_cmd
);
5867 install_element (CONFIG_NODE
, &no_ipv6_route_cmd
);
5868 install_element (CONFIG_NODE
, &no_ipv6_route_flags_cmd
);
5869 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_cmd
);
5870 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_cmd
);
5871 install_element (CONFIG_NODE
, &ipv6_route_pref_cmd
);
5872 install_element (CONFIG_NODE
, &ipv6_route_flags_pref_cmd
);
5873 install_element (CONFIG_NODE
, &ipv6_route_ifname_pref_cmd
);
5874 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_pref_cmd
);
5875 install_element (CONFIG_NODE
, &no_ipv6_route_pref_cmd
);
5876 install_element (CONFIG_NODE
, &no_ipv6_route_flags_pref_cmd
);
5877 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_pref_cmd
);
5878 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_pref_cmd
);
5879 install_element (CONFIG_NODE
, &ipv6_route_tag_cmd
);
5880 install_element (CONFIG_NODE
, &ipv6_route_flags_tag_cmd
);
5881 install_element (CONFIG_NODE
, &ipv6_route_ifname_tag_cmd
);
5882 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_tag_cmd
);
5883 install_element (CONFIG_NODE
, &ipv6_route_pref_tag_cmd
);
5884 install_element (CONFIG_NODE
, &ipv6_route_flags_pref_tag_cmd
);
5885 install_element (CONFIG_NODE
, &ipv6_route_ifname_pref_tag_cmd
);
5886 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_pref_tag_cmd
);
5887 install_element (CONFIG_NODE
, &no_ipv6_route_tag_cmd
);
5888 install_element (CONFIG_NODE
, &no_ipv6_route_flags_tag_cmd
);
5889 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_tag_cmd
);
5890 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_tag_cmd
);
5891 install_element (CONFIG_NODE
, &no_ipv6_route_pref_tag_cmd
);
5892 install_element (CONFIG_NODE
, &no_ipv6_route_flags_pref_tag_cmd
);
5893 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_pref_tag_cmd
);
5894 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_pref_tag_cmd
);
5895 install_element (CONFIG_NODE
, &ip_nht_default_route_cmd
);
5896 install_element (CONFIG_NODE
, &no_ip_nht_default_route_cmd
);
5897 install_element (CONFIG_NODE
, &ipv6_nht_default_route_cmd
);
5898 install_element (CONFIG_NODE
, &no_ipv6_nht_default_route_cmd
);
5899 install_element (VIEW_NODE
, &show_ipv6_route_cmd
);
5900 install_element (VIEW_NODE
, &show_ipv6_route_tag_cmd
);
5901 install_element (VIEW_NODE
, &show_ipv6_route_summary_cmd
);
5902 install_element (VIEW_NODE
, &show_ipv6_route_summary_prefix_cmd
);
5903 install_element (VIEW_NODE
, &show_ipv6_route_protocol_cmd
);
5904 install_element (VIEW_NODE
, &show_ipv6_route_addr_cmd
);
5905 install_element (VIEW_NODE
, &show_ipv6_route_prefix_cmd
);
5906 install_element (VIEW_NODE
, &show_ipv6_route_prefix_longer_cmd
);
5907 install_element (ENABLE_NODE
, &show_ipv6_route_cmd
);
5908 install_element (ENABLE_NODE
, &show_ipv6_route_tag_cmd
);
5909 install_element (ENABLE_NODE
, &show_ipv6_route_protocol_cmd
);
5910 install_element (ENABLE_NODE
, &show_ipv6_route_addr_cmd
);
5911 install_element (ENABLE_NODE
, &show_ipv6_route_prefix_cmd
);
5912 install_element (ENABLE_NODE
, &show_ipv6_route_prefix_longer_cmd
);
5913 install_element (ENABLE_NODE
, &show_ipv6_route_summary_cmd
);
5914 install_element (ENABLE_NODE
, &show_ipv6_route_summary_prefix_cmd
);
5916 install_element (VIEW_NODE
, &show_ipv6_mroute_cmd
);
5917 install_element (ENABLE_NODE
, &show_ipv6_mroute_cmd
);
5919 /* Commands for VRF */
5921 install_element (CONFIG_NODE
, &ipv6_route_vrf_cmd
);
5922 install_element (CONFIG_NODE
, &ipv6_route_flags_vrf_cmd
);
5923 install_element (CONFIG_NODE
, &ipv6_route_ifname_vrf_cmd
);
5924 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_vrf_cmd
);
5925 install_element (CONFIG_NODE
, &no_ipv6_route_vrf_cmd
);
5926 install_element (CONFIG_NODE
, &no_ipv6_route_flags_vrf_cmd
);
5927 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_vrf_cmd
);
5928 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_vrf_cmd
);
5929 install_element (CONFIG_NODE
, &ipv6_route_pref_vrf_cmd
);
5930 install_element (CONFIG_NODE
, &ipv6_route_flags_pref_vrf_cmd
);
5931 install_element (CONFIG_NODE
, &ipv6_route_ifname_pref_vrf_cmd
);
5932 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_pref_vrf_cmd
);
5933 install_element (CONFIG_NODE
, &no_ipv6_route_pref_vrf_cmd
);
5934 install_element (CONFIG_NODE
, &no_ipv6_route_flags_pref_vrf_cmd
);
5935 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_pref_vrf_cmd
);
5936 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_pref_vrf_cmd
);
5937 install_element (CONFIG_NODE
, &ipv6_route_tag_vrf_cmd
);
5938 install_element (CONFIG_NODE
, &ipv6_route_flags_tag_vrf_cmd
);
5939 install_element (CONFIG_NODE
, &ipv6_route_ifname_tag_vrf_cmd
);
5940 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_tag_vrf_cmd
);
5941 install_element (CONFIG_NODE
, &ipv6_route_pref_tag_vrf_cmd
);
5942 install_element (CONFIG_NODE
, &ipv6_route_flags_pref_tag_vrf_cmd
);
5943 install_element (CONFIG_NODE
, &ipv6_route_ifname_pref_tag_vrf_cmd
);
5944 install_element (CONFIG_NODE
, &ipv6_route_ifname_flags_pref_tag_vrf_cmd
);
5945 install_element (CONFIG_NODE
, &no_ipv6_route_tag_vrf_cmd
);
5946 install_element (CONFIG_NODE
, &no_ipv6_route_flags_tag_vrf_cmd
);
5947 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_tag_vrf_cmd
);
5948 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_tag_vrf_cmd
);
5949 install_element (CONFIG_NODE
, &no_ipv6_route_pref_tag_vrf_cmd
);
5950 install_element (CONFIG_NODE
, &no_ipv6_route_flags_pref_tag_vrf_cmd
);
5951 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_pref_tag_vrf_cmd
);
5952 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_flags_pref_tag_vrf_cmd
);
5955 install_element (VIEW_NODE
, &show_ipv6_route_vrf_cmd
);
5956 install_element (VIEW_NODE
, &show_ipv6_route_vrf_tag_cmd
);
5957 install_element (VIEW_NODE
, &show_ipv6_route_vrf_summary_cmd
);
5958 install_element (VIEW_NODE
, &show_ipv6_route_vrf_summary_prefix_cmd
);
5959 install_element (VIEW_NODE
, &show_ipv6_route_vrf_protocol_cmd
);
5960 install_element (VIEW_NODE
, &show_ipv6_route_vrf_addr_cmd
);
5961 install_element (VIEW_NODE
, &show_ipv6_route_vrf_prefix_cmd
);
5962 install_element (VIEW_NODE
, &show_ipv6_route_vrf_prefix_longer_cmd
);
5963 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_cmd
);
5964 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_tag_cmd
);
5965 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_protocol_cmd
);
5966 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_addr_cmd
);
5967 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_prefix_cmd
);
5968 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_prefix_longer_cmd
);
5969 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_summary_cmd
);
5970 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_summary_prefix_cmd
);
5972 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_cmd
);
5973 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_tag_cmd
);
5974 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_summary_cmd
);
5975 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_summary_prefix_cmd
);
5976 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_protocol_cmd
);
5977 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_addr_cmd
);
5978 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_prefix_cmd
);
5979 install_element (VIEW_NODE
, &show_ipv6_route_vrf_all_prefix_longer_cmd
);
5980 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_cmd
);
5981 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_tag_cmd
);
5982 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_protocol_cmd
);
5983 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_addr_cmd
);
5984 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_prefix_cmd
);
5985 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_prefix_longer_cmd
);
5986 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_summary_cmd
);
5987 install_element (ENABLE_NODE
, &show_ipv6_route_vrf_all_summary_prefix_cmd
);
5989 install_element (VIEW_NODE
, &show_ipv6_mroute_vrf_cmd
);
5990 install_element (ENABLE_NODE
, &show_ipv6_mroute_vrf_cmd
);
5992 install_element (VIEW_NODE
, &show_ipv6_mroute_vrf_all_cmd
);
5993 install_element (ENABLE_NODE
, &show_ipv6_mroute_vrf_all_cmd
);
5994 #endif /* HAVE_IPV6 */