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.
30 /* Return route type string for VTY output. */
32 route_type_str (u_char type
)
36 case ZEBRA_ROUTE_SYSTEM
:
38 case ZEBRA_ROUTE_KERNEL
:
40 case ZEBRA_ROUTE_CONNECT
:
42 case ZEBRA_ROUTE_STATIC
:
46 case ZEBRA_ROUTE_RIPNG
:
48 case ZEBRA_ROUTE_OSPF
:
50 case ZEBRA_ROUTE_OSPF6
:
59 /* Return route type string for VTY output. */
61 route_type_char (u_char type
)
65 case ZEBRA_ROUTE_SYSTEM
:
67 case ZEBRA_ROUTE_KERNEL
:
69 case ZEBRA_ROUTE_CONNECT
:
71 case ZEBRA_ROUTE_STATIC
:
75 case ZEBRA_ROUTE_RIPNG
:
77 case ZEBRA_ROUTE_OSPF
:
79 case ZEBRA_ROUTE_OSPF6
:
88 /* General fucntion for static route. */
90 zebra_static_ipv4 (struct vty
*vty
, int add_cmd
,
91 char *dest_str
, char *mask_str
, char *gate_str
,
101 ret
= str2prefix (dest_str
, &p
);
104 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
108 /* Cisco like mask notation. */
111 ret
= inet_aton (mask_str
, &mask
);
114 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
117 p
.prefixlen
= ip_masklen (mask
);
120 /* Apply mask for given prefix. */
123 /* Administrative distance. */
125 distance
= atoi (distance_str
);
127 distance
= ZEBRA_STATIC_DISTANCE_DEFAULT
;
129 /* Null0 static route. */
130 if (strncasecmp (gate_str
, "Null0", strlen (gate_str
)) == 0)
133 static_add_ipv4 (&p
, NULL
, NULL
, distance
, 0);
135 static_delete_ipv4 (&p
, NULL
, NULL
, distance
, 0);
139 /* When gateway is A.B.C.D format, gate is treated as nexthop
140 address other case gate is treated as interface name. */
141 ret
= inet_aton (gate_str
, &gate
);
148 static_add_ipv4 (&p
, ifname
? NULL
: &gate
, ifname
, distance
, 0);
150 static_delete_ipv4 (&p
, ifname
? NULL
: &gate
, ifname
, distance
, 0);
155 /* Static route configuration. */
158 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
160 "Establish static routes\n"
161 "IP destination prefix (e.g. 10.0.0.0/8)\n"
162 "IP gateway address\n"
163 "IP gateway interface name\n"
166 return zebra_static_ipv4 (vty
, 1, argv
[0], NULL
, argv
[1], NULL
);
169 /* Mask as A.B.C.D format. */
170 DEFUN (ip_route_mask
,
172 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
174 "Establish static routes\n"
175 "IP destination prefix\n"
176 "IP destination prefix mask\n"
177 "IP gateway address\n"
178 "IP gateway interface name\n"
181 return zebra_static_ipv4 (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
);
184 /* Distance option value. */
185 DEFUN (ip_route_distance
,
186 ip_route_distance_cmd
,
187 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
189 "Establish static routes\n"
190 "IP destination prefix (e.g. 10.0.0.0/8)\n"
191 "IP gateway address\n"
192 "IP gateway interface name\n"
194 "Distance value for this route\n")
196 return zebra_static_ipv4 (vty
, 1, argv
[0], NULL
, argv
[1], argv
[2]);
199 DEFUN (ip_route_mask_distance
,
200 ip_route_mask_distance_cmd
,
201 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
203 "Establish static routes\n"
204 "IP destination prefix\n"
205 "IP destination prefix mask\n"
206 "IP gateway address\n"
207 "IP gateway interface name\n"
209 "Distance value for this route\n")
211 return zebra_static_ipv4 (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3]);
216 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
219 "Establish static routes\n"
220 "IP destination prefix (e.g. 10.0.0.0/8)\n"
221 "IP gateway address\n"
222 "IP gateway interface name\n"
225 return zebra_static_ipv4 (vty
, 0, argv
[0], NULL
, argv
[1], NULL
);
228 DEFUN (no_ip_route_mask
,
229 no_ip_route_mask_cmd
,
230 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
233 "Establish static routes\n"
234 "IP destination prefix\n"
235 "IP destination prefix mask\n"
236 "IP gateway address\n"
237 "IP gateway interface name\n"
240 return zebra_static_ipv4 (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
);
243 DEFUN (no_ip_route_distance
,
244 no_ip_route_distance_cmd
,
245 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
248 "Establish static routes\n"
249 "IP destination prefix (e.g. 10.0.0.0/8)\n"
250 "IP gateway address\n"
251 "IP gateway interface name\n"
253 "Distance value for this route\n")
255 return zebra_static_ipv4 (vty
, 0, argv
[0], NULL
, argv
[1], argv
[2]);
258 DEFUN (no_ip_route_mask_distance
,
259 no_ip_route_mask_distance_cmd
,
260 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
263 "Establish static routes\n"
264 "IP destination prefix\n"
265 "IP destination prefix mask\n"
266 "IP gateway address\n"
267 "IP gateway interface name\n"
269 "Distance value for this route\n")
271 return zebra_static_ipv4 (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3]);
274 /* New RIB. Detailed information for IPv4 route. */
276 vty_show_ip_route_detail (struct vty
*vty
, struct route_node
*rn
)
279 struct nexthop
*nexthop
;
281 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
283 vty_out (vty
, "Routing entry for %s/%d%s",
284 inet_ntoa (rn
->p
.u
.prefix4
), rn
->p
.prefixlen
,
286 vty_out (vty
, " Known via \"%s\"", route_type_str (rib
->type
));
287 vty_out (vty
, ", distance %d, metric %d", rib
->distance
, rib
->metric
);
288 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
))
289 vty_out (vty
, ", best");
291 vty_out (vty
, ", refcnt %ld", rib
->refcnt
);
292 vty_out (vty
, "%s", VTY_NEWLINE
);
294 #define ONE_DAY_SECOND 60*60*24
295 #define ONE_WEEK_SECOND 60*60*24*7
296 if (rib
->type
== ZEBRA_ROUTE_RIP
297 || rib
->type
== ZEBRA_ROUTE_OSPF
298 || rib
->type
== ZEBRA_ROUTE_BGP
)
303 uptime
= time (NULL
);
304 uptime
-= rib
->uptime
;
305 tm
= gmtime (&uptime
);
307 vty_out (vty
, " Last update ");
309 if (uptime
< ONE_DAY_SECOND
)
310 vty_out (vty
, "%02d:%02d:%02d",
311 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
312 else if (uptime
< ONE_WEEK_SECOND
)
313 vty_out (vty
, "%dd%02dh%02dm",
314 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
316 vty_out (vty
, "%02dw%dd%02dh",
318 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
319 vty_out (vty
, " ago%s", VTY_NEWLINE
);
322 for (nexthop
= rib
->nexthop
; nexthop
; nexthop
= nexthop
->next
)
325 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
) ? '*' : ' ');
327 switch (nexthop
->type
)
329 case NEXTHOP_TYPE_IPV4
:
330 case NEXTHOP_TYPE_IPV4_IFINDEX
:
331 vty_out (vty
, " %s", inet_ntoa (nexthop
->gate
.ipv4
));
332 if (nexthop
->ifindex
)
333 vty_out (vty
, ", via %s", ifindex2ifname (nexthop
->ifindex
));
335 case NEXTHOP_TYPE_IFINDEX
:
336 vty_out (vty
, " directly connected, %s",
337 ifindex2ifname (nexthop
->ifindex
));
339 case NEXTHOP_TYPE_IFNAME
:
340 vty_out (vty
, " directly connected, %s", nexthop
->ifname
);
342 case NEXTHOP_TYPE_BLACKHOLE
:
343 vty_out (vty
, " directly connected, via Null0");
348 if (! CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ACTIVE
))
349 vty_out (vty
, " inactive");
351 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_RECURSIVE
))
353 vty_out (vty
, " (recursive");
355 switch (nexthop
->rtype
)
357 case NEXTHOP_TYPE_IPV4
:
358 case NEXTHOP_TYPE_IPV4_IFINDEX
:
359 vty_out (vty
, " via %s)", inet_ntoa (nexthop
->rgate
.ipv4
));
361 case NEXTHOP_TYPE_IFINDEX
:
362 case NEXTHOP_TYPE_IFNAME
:
363 vty_out (vty
, " is directly connected, %s)",
364 ifindex2ifname (nexthop
->rifindex
));
370 vty_out (vty
, "%s", VTY_NEWLINE
);
372 vty_out (vty
, "%s", VTY_NEWLINE
);
377 vty_show_ip_route (struct vty
*vty
, struct route_node
*rn
, struct rib
*rib
)
379 struct nexthop
*nexthop
;
383 /* Nexthop information. */
384 for (nexthop
= rib
->nexthop
; nexthop
; nexthop
= nexthop
->next
)
386 if (nexthop
== rib
->nexthop
)
388 /* Prefix information. */
389 len
= vty_out (vty
, "%c%c%c %s/%d",
390 route_type_char (rib
->type
),
391 CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
)
393 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
)
395 inet_ntop (AF_INET
, &rn
->p
.u
.prefix
, buf
, BUFSIZ
),
398 /* Distance and metric display. */
399 if (rib
->type
!= ZEBRA_ROUTE_CONNECT
400 && rib
->type
!= ZEBRA_ROUTE_KERNEL
)
401 len
+= vty_out (vty
, " [%d/%d]", rib
->distance
,
405 vty_out (vty
, " %c%*c",
406 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
)
410 switch (nexthop
->type
)
412 case NEXTHOP_TYPE_IPV4
:
413 case NEXTHOP_TYPE_IPV4_IFINDEX
:
414 vty_out (vty
, " via %s", inet_ntoa (nexthop
->gate
.ipv4
));
415 if (nexthop
->ifindex
)
416 vty_out (vty
, ", %s", ifindex2ifname (nexthop
->ifindex
));
418 case NEXTHOP_TYPE_IFINDEX
:
419 vty_out (vty
, " is directly connected, %s",
420 ifindex2ifname (nexthop
->ifindex
));
422 case NEXTHOP_TYPE_IFNAME
:
423 vty_out (vty
, " is directly connected, %s", nexthop
->ifname
);
425 case NEXTHOP_TYPE_BLACKHOLE
:
426 vty_out (vty
, " is directly connected, Null0");
430 if (! CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ACTIVE
))
431 vty_out (vty
, " inactive");
433 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_RECURSIVE
))
435 vty_out (vty
, " (recursive");
437 switch (nexthop
->rtype
)
439 case NEXTHOP_TYPE_IPV4
:
440 case NEXTHOP_TYPE_IPV4_IFINDEX
:
441 vty_out (vty
, " via %s)", inet_ntoa (nexthop
->rgate
.ipv4
));
443 case NEXTHOP_TYPE_IFINDEX
:
444 case NEXTHOP_TYPE_IFNAME
:
445 vty_out (vty
, " is directly connected, %s)",
446 ifindex2ifname (nexthop
->rifindex
));
453 if (rib
->type
== ZEBRA_ROUTE_RIP
454 || rib
->type
== ZEBRA_ROUTE_OSPF
455 || rib
->type
== ZEBRA_ROUTE_BGP
)
460 uptime
= time (NULL
);
461 uptime
-= rib
->uptime
;
462 tm
= gmtime (&uptime
);
464 #define ONE_DAY_SECOND 60*60*24
465 #define ONE_WEEK_SECOND 60*60*24*7
467 if (uptime
< ONE_DAY_SECOND
)
468 vty_out (vty
, ", %02d:%02d:%02d",
469 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
470 else if (uptime
< ONE_WEEK_SECOND
)
471 vty_out (vty
, ", %dd%02dh%02dm",
472 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
474 vty_out (vty
, ", %02dw%dd%02dh",
476 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
478 vty_out (vty
, "%s", VTY_NEWLINE
);
482 #define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,%s B - BGP, > - selected route, * - FIB route%s%s"
484 DEFUN (show_ip_route
,
489 "IP routing table\n")
491 struct route_table
*table
;
492 struct route_node
*rn
;
496 table
= vrf_table (AFI_IP
, SAFI_UNICAST
, 0);
500 /* Show all IPv4 routes. */
501 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
502 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
506 vty_out (vty
, SHOW_ROUTE_V4_HEADER
, VTY_NEWLINE
, VTY_NEWLINE
,
510 vty_show_ip_route (vty
, rn
, rib
);
515 DEFUN (show_ip_route_prefix_longer
,
516 show_ip_route_prefix_longer_cmd
,
517 "show ip route A.B.C.D/M longer-prefixes",
521 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
522 "Show route matching the specified Network/Mask pair only\n")
524 struct route_table
*table
;
525 struct route_node
*rn
;
531 ret
= str2prefix (argv
[0], &p
);
534 vty_out (vty
, "%% Malformed Prefix%s", VTY_NEWLINE
);
538 table
= vrf_table (AFI_IP
, SAFI_UNICAST
, 0);
542 /* Show matched type IPv4 routes. */
543 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
544 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
545 if (prefix_match (&p
, &rn
->p
))
549 vty_out (vty
, SHOW_ROUTE_V4_HEADER
, VTY_NEWLINE
,
550 VTY_NEWLINE
, VTY_NEWLINE
);
553 vty_show_ip_route (vty
, rn
, rib
);
558 DEFUN (show_ip_route_supernets
,
559 show_ip_route_supernets_cmd
,
560 "show ip route supernets-only",
564 "Show supernet entries only\n")
566 struct route_table
*table
;
567 struct route_node
*rn
;
572 table
= vrf_table (AFI_IP
, SAFI_UNICAST
, 0);
576 /* Show matched type IPv4 routes. */
577 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
578 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
580 addr
= ntohl (rn
->p
.u
.prefix4
.s_addr
);
582 if ((IN_CLASSC (addr
) && rn
->p
.prefixlen
< 24)
583 || (IN_CLASSB (addr
) && rn
->p
.prefixlen
< 16)
584 || (IN_CLASSA (addr
) && rn
->p
.prefixlen
< 8))
588 vty_out (vty
, SHOW_ROUTE_V4_HEADER
, VTY_NEWLINE
,
589 VTY_NEWLINE
, VTY_NEWLINE
);
592 vty_show_ip_route (vty
, rn
, rib
);
598 DEFUN (show_ip_route_protocol
,
599 show_ip_route_protocol_cmd
,
600 "show ip route (bgp|connected|kernel|ospf|rip|static)",
604 "Border Gateway Protocol (BGP)\n"
607 "Open Shortest Path First (OSPF)\n"
608 "Routing Information Protocol (RIP)\n"
612 struct route_table
*table
;
613 struct route_node
*rn
;
617 if (strncmp (argv
[0], "b", 1) == 0)
618 type
= ZEBRA_ROUTE_BGP
;
619 else if (strncmp (argv
[0], "c", 1) == 0)
620 type
= ZEBRA_ROUTE_CONNECT
;
621 else if (strncmp (argv
[0], "k", 1) ==0)
622 type
= ZEBRA_ROUTE_KERNEL
;
623 else if (strncmp (argv
[0], "o", 1) == 0)
624 type
= ZEBRA_ROUTE_OSPF
;
625 else if (strncmp (argv
[0], "r", 1) == 0)
626 type
= ZEBRA_ROUTE_RIP
;
627 else if (strncmp (argv
[0], "s", 1) == 0)
628 type
= ZEBRA_ROUTE_STATIC
;
631 vty_out (vty
, "Unknown route type%s", VTY_NEWLINE
);
635 table
= vrf_table (AFI_IP
, SAFI_UNICAST
, 0);
639 /* Show matched type IPv4 routes. */
640 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
641 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
642 if (rib
->type
== type
)
646 vty_out (vty
, SHOW_ROUTE_V4_HEADER
,
647 VTY_NEWLINE
, VTY_NEWLINE
, VTY_NEWLINE
);
650 vty_show_ip_route (vty
, rn
, rib
);
655 DEFUN (show_ip_route_addr
,
656 show_ip_route_addr_cmd
,
657 "show ip route A.B.C.D",
661 "Network in the IP routing table to display\n")
664 struct prefix_ipv4 p
;
665 struct route_table
*table
;
666 struct route_node
*rn
;
668 ret
= str2prefix_ipv4 (argv
[0], &p
);
671 vty_out (vty
, "%% Malformed IPv4 address%s", VTY_NEWLINE
);
675 table
= vrf_table (AFI_IP
, SAFI_UNICAST
, 0);
679 rn
= route_node_match (table
, (struct prefix
*) &p
);
682 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
686 vty_show_ip_route_detail (vty
, rn
);
688 route_unlock_node (rn
);
693 DEFUN (show_ip_route_prefix
,
694 show_ip_route_prefix_cmd
,
695 "show ip route A.B.C.D/M",
699 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
702 struct prefix_ipv4 p
;
703 struct route_table
*table
;
704 struct route_node
*rn
;
706 ret
= str2prefix_ipv4 (argv
[0], &p
);
709 vty_out (vty
, "%% Malformed IPv4 address%s", VTY_NEWLINE
);
713 table
= vrf_table (AFI_IP
, SAFI_UNICAST
, 0);
717 rn
= route_node_match (table
, (struct prefix
*) &p
);
718 if (! rn
|| rn
->p
.prefixlen
!= p
.prefixlen
)
720 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
724 vty_show_ip_route_detail (vty
, rn
);
726 route_unlock_node (rn
);
732 zebra_show_ip_route (struct vty
*vty
, struct vrf
*vrf
)
734 vty_out (vty
, "IP routing table name is %s(%d)%s",
735 vrf
->name
? vrf
->name
: "", vrf
->id
, VTY_NEWLINE
);
737 vty_out (vty
, "Route Source Networks%s", VTY_NEWLINE
);
738 vty_out (vty
, "connected %d%s", 0, VTY_NEWLINE
);
739 vty_out (vty
, "static %d%s", 0, VTY_NEWLINE
);
740 vty_out (vty
, "rip %d%s", 0, VTY_NEWLINE
);
742 vty_out (vty
, "bgp %d%s", 0, VTY_NEWLINE
);
743 vty_out (vty
, " External: %d Internal: %d Local: %d%s",
744 0, 0, 0, VTY_NEWLINE
);
746 vty_out (vty
, "ospf %d%s", 0, VTY_NEWLINE
);
748 " Intra-area: %d Inter-area: %d External-1: %d External-2: %d%s",
749 0, 0, 0, 0, VTY_NEWLINE
);
750 vty_out (vty
, " NSSA External-1: %d NSSA External-2: %d%s",
753 vty_out (vty
, "internal %d%s", 0, VTY_NEWLINE
);
754 vty_out (vty
, "Total %d%s", 0, VTY_NEWLINE
);
757 /* Show route summary. */
758 DEFUN (show_ip_route_summary
,
759 show_ip_route_summary_cmd
,
760 "show ip route summary",
764 "Summary of all routes\n")
768 /* Default table id is zero. */
769 vrf
= vrf_lookup (0);
772 vty_out (vty
, "%% No Default-IP-Routing-Table%s", VTY_NEWLINE
);
776 zebra_show_ip_route (vty
, vrf
);
781 /* Write IPv4 static route configuration. */
783 static_config_ipv4 (struct vty
*vty
)
785 struct route_node
*rn
;
786 struct static_ipv4
*si
;
787 struct route_table
*stable
;
793 stable
= vrf_static_table (AFI_IP
, SAFI_UNICAST
, 0);
797 for (rn
= route_top (stable
); rn
; rn
= route_next (rn
))
798 for (si
= rn
->info
; si
; si
= si
->next
)
800 vty_out (vty
, "ip route %s/%d", inet_ntoa (rn
->p
.u
.prefix4
),
805 case STATIC_IPV4_GATEWAY
:
806 vty_out (vty
, " %s", inet_ntoa (si
->gate
.ipv4
));
808 case STATIC_IPV4_IFNAME
:
809 vty_out (vty
, " %s", si
->gate
.ifname
);
811 case STATIC_IPV4_BLACKHOLE
:
812 vty_out (vty
, " Null0");
816 if (si
->distance
!= ZEBRA_STATIC_DISTANCE_DEFAULT
)
817 vty_out (vty
, " %d", si
->distance
);
818 vty_out (vty
, "%s", VTY_NEWLINE
);
826 /* General fucntion for IPv6 static route. */
828 static_ipv6_func (struct vty
*vty
, int add_cmd
, char *dest_str
,
829 char *gate_str
, char *ifname
, char *distance_str
)
834 struct in6_addr
*gate
= NULL
;
835 struct in6_addr gate_addr
;
839 ret
= str2prefix (dest_str
, &p
);
842 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
846 /* Apply mask for given prefix. */
849 /* Administrative distance. */
851 distance
= atoi (distance_str
);
853 distance
= ZEBRA_STATIC_DISTANCE_DEFAULT
;
855 /* When gateway is valid IPv6 addrees, then gate is treated as
856 nexthop address other case gate is treated as interface name. */
857 ret
= inet_pton (AF_INET6
, gate_str
, &gate_addr
);
861 /* When ifname is specified. It must be come with gateway
865 vty_out (vty
, "%% Malformed address%s", VTY_NEWLINE
);
868 type
= STATIC_IPV6_GATEWAY_IFNAME
;
875 type
= STATIC_IPV6_GATEWAY
;
880 type
= STATIC_IPV6_IFNAME
;
886 static_add_ipv6 (&p
, type
, gate
, ifname
, distance
, table
);
888 static_delete_ipv6 (&p
, type
, gate
, ifname
, distance
, table
);
895 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
897 "Establish static routes\n"
898 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
899 "IPv6 gateway address\n"
900 "IPv6 gateway interface name\n")
902 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, NULL
);
905 DEFUN (ipv6_route_ifname
,
906 ipv6_route_ifname_cmd
,
907 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
909 "Establish static routes\n"
910 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
911 "IPv6 gateway address\n"
912 "IPv6 gateway interface name\n")
914 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], NULL
);
917 DEFUN (ipv6_route_pref
,
919 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
921 "Establish static routes\n"
922 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
923 "IPv6 gateway address\n"
924 "IPv6 gateway interface name\n"
925 "Distance value for this prefix\n")
927 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], NULL
, argv
[2]);
930 DEFUN (ipv6_route_ifname_pref
,
931 ipv6_route_ifname_pref_cmd
,
932 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
934 "Establish static routes\n"
935 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
936 "IPv6 gateway address\n"
937 "IPv6 gateway interface name\n"
938 "Distance value for this prefix\n")
940 return static_ipv6_func (vty
, 1, argv
[0], argv
[1], argv
[2], argv
[3]);
943 DEFUN (no_ipv6_route
,
945 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
948 "Establish static routes\n"
949 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
950 "IPv6 gateway address\n"
951 "IPv6 gateway interface name\n")
953 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, NULL
);
956 DEFUN (no_ipv6_route_ifname
,
957 no_ipv6_route_ifname_cmd
,
958 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
961 "Establish static routes\n"
962 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
963 "IPv6 gateway address\n"
964 "IPv6 gateway interface name\n")
966 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], NULL
);
969 DEFUN (no_ipv6_route_pref
,
970 no_ipv6_route_pref_cmd
,
971 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
974 "Establish static routes\n"
975 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
976 "IPv6 gateway address\n"
977 "IPv6 gateway interface name\n"
978 "Distance value for this prefix\n")
980 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], NULL
, argv
[2]);
983 DEFUN (no_ipv6_route_ifname_pref
,
984 no_ipv6_route_ifname_pref_cmd
,
985 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
988 "Establish static routes\n"
989 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
990 "IPv6 gateway address\n"
991 "IPv6 gateway interface name\n"
992 "Distance value for this prefix\n")
994 return static_ipv6_func (vty
, 0, argv
[0], argv
[1], argv
[2], argv
[3]);
997 /* New RIB. Detailed information for IPv4 route. */
999 vty_show_ipv6_route_detail (struct vty
*vty
, struct route_node
*rn
)
1002 struct nexthop
*nexthop
;
1005 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
1007 vty_out (vty
, "Routing entry for %s/%d%s",
1008 inet_ntop (AF_INET6
, &rn
->p
.u
.prefix6
, buf
, BUFSIZ
),
1011 vty_out (vty
, " Known via \"%s\"", route_type_str (rib
->type
));
1012 vty_out (vty
, ", distance %d, metric %d", rib
->distance
, rib
->metric
);
1013 if (CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
))
1014 vty_out (vty
, ", best");
1016 vty_out (vty
, ", refcnt %ld", rib
->refcnt
);
1017 vty_out (vty
, "%s", VTY_NEWLINE
);
1019 #define ONE_DAY_SECOND 60*60*24
1020 #define ONE_WEEK_SECOND 60*60*24*7
1021 if (rib
->type
== ZEBRA_ROUTE_RIPNG
1022 || rib
->type
== ZEBRA_ROUTE_OSPF6
1023 || rib
->type
== ZEBRA_ROUTE_BGP
)
1028 uptime
= time (NULL
);
1029 uptime
-= rib
->uptime
;
1030 tm
= gmtime (&uptime
);
1032 vty_out (vty
, " Last update ");
1034 if (uptime
< ONE_DAY_SECOND
)
1035 vty_out (vty
, "%02d:%02d:%02d",
1036 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
1037 else if (uptime
< ONE_WEEK_SECOND
)
1038 vty_out (vty
, "%dd%02dh%02dm",
1039 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
1041 vty_out (vty
, "%02dw%dd%02dh",
1043 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
1044 vty_out (vty
, " ago%s", VTY_NEWLINE
);
1047 for (nexthop
= rib
->nexthop
; nexthop
; nexthop
= nexthop
->next
)
1049 vty_out (vty
, " %c",
1050 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
) ? '*' : ' ');
1052 switch (nexthop
->type
)
1054 case NEXTHOP_TYPE_IPV6
:
1055 case NEXTHOP_TYPE_IPV6_IFINDEX
:
1056 case NEXTHOP_TYPE_IPV6_IFNAME
:
1057 vty_out (vty
, " %s",
1058 inet_ntop (AF_INET6
, &nexthop
->gate
.ipv6
, buf
, BUFSIZ
));
1059 if (nexthop
->type
== NEXTHOP_TYPE_IPV6_IFNAME
)
1060 vty_out (vty
, ", %s", nexthop
->ifname
);
1061 else if (nexthop
->ifindex
)
1062 vty_out (vty
, ", via %s", ifindex2ifname (nexthop
->ifindex
));
1064 case NEXTHOP_TYPE_IFINDEX
:
1065 vty_out (vty
, " directly connected, %s",
1066 ifindex2ifname (nexthop
->ifindex
));
1068 case NEXTHOP_TYPE_IFNAME
:
1069 vty_out (vty
, " directly connected, %s",
1075 if (! CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ACTIVE
))
1076 vty_out (vty
, " inactive");
1078 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_RECURSIVE
))
1080 vty_out (vty
, " (recursive");
1082 switch (nexthop
->rtype
)
1084 case NEXTHOP_TYPE_IPV6
:
1085 case NEXTHOP_TYPE_IPV6_IFINDEX
:
1086 case NEXTHOP_TYPE_IPV6_IFNAME
:
1087 vty_out (vty
, " via %s)",
1088 inet_ntop (AF_INET6
, &nexthop
->rgate
.ipv6
,
1090 if (nexthop
->rifindex
)
1091 vty_out (vty
, ", %s", ifindex2ifname (nexthop
->rifindex
));
1093 case NEXTHOP_TYPE_IFINDEX
:
1094 case NEXTHOP_TYPE_IFNAME
:
1095 vty_out (vty
, " is directly connected, %s)",
1096 ifindex2ifname (nexthop
->rifindex
));
1102 vty_out (vty
, "%s", VTY_NEWLINE
);
1104 vty_out (vty
, "%s", VTY_NEWLINE
);
1109 vty_show_ipv6_route (struct vty
*vty
, struct route_node
*rn
,
1112 struct nexthop
*nexthop
;
1116 /* Nexthop information. */
1117 for (nexthop
= rib
->nexthop
; nexthop
; nexthop
= nexthop
->next
)
1119 if (nexthop
== rib
->nexthop
)
1121 /* Prefix information. */
1122 len
= vty_out (vty
, "%c%c%c %s/%d",
1123 route_type_char (rib
->type
),
1124 CHECK_FLAG (rib
->flags
, ZEBRA_FLAG_SELECTED
)
1126 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
)
1128 inet_ntop (AF_INET6
, &rn
->p
.u
.prefix6
, buf
, BUFSIZ
),
1131 /* Distance and metric display. */
1132 if (rib
->type
!= ZEBRA_ROUTE_CONNECT
1133 && rib
->type
!= ZEBRA_ROUTE_KERNEL
)
1134 len
+= vty_out (vty
, " [%d/%d]", rib
->distance
,
1138 vty_out (vty
, " %c%*c",
1139 CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_FIB
)
1143 switch (nexthop
->type
)
1145 case NEXTHOP_TYPE_IPV6
:
1146 case NEXTHOP_TYPE_IPV6_IFINDEX
:
1147 case NEXTHOP_TYPE_IPV6_IFNAME
:
1148 vty_out (vty
, " via %s",
1149 inet_ntop (AF_INET6
, &nexthop
->gate
.ipv6
, buf
, BUFSIZ
));
1150 if (nexthop
->type
== NEXTHOP_TYPE_IPV6_IFNAME
)
1151 vty_out (vty
, ", %s", nexthop
->ifname
);
1152 else if (nexthop
->ifindex
)
1153 vty_out (vty
, ", %s", ifindex2ifname (nexthop
->ifindex
));
1155 case NEXTHOP_TYPE_IFINDEX
:
1156 vty_out (vty
, " is directly connected, %s",
1157 ifindex2ifname (nexthop
->ifindex
));
1159 case NEXTHOP_TYPE_IFNAME
:
1160 vty_out (vty
, " is directly connected, %s",
1166 if (! CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_ACTIVE
))
1167 vty_out (vty
, " inactive");
1169 if (CHECK_FLAG (nexthop
->flags
, NEXTHOP_FLAG_RECURSIVE
))
1171 vty_out (vty
, " (recursive");
1173 switch (nexthop
->rtype
)
1175 case NEXTHOP_TYPE_IPV6
:
1176 case NEXTHOP_TYPE_IPV6_IFINDEX
:
1177 case NEXTHOP_TYPE_IPV6_IFNAME
:
1178 vty_out (vty
, " via %s)",
1179 inet_ntop (AF_INET6
, &nexthop
->rgate
.ipv6
,
1181 if (nexthop
->rifindex
)
1182 vty_out (vty
, ", %s", ifindex2ifname (nexthop
->rifindex
));
1184 case NEXTHOP_TYPE_IFINDEX
:
1185 case NEXTHOP_TYPE_IFNAME
:
1186 vty_out (vty
, " is directly connected, %s)",
1187 ifindex2ifname (nexthop
->rifindex
));
1194 if (rib
->type
== ZEBRA_ROUTE_RIPNG
1195 || rib
->type
== ZEBRA_ROUTE_OSPF6
1196 || rib
->type
== ZEBRA_ROUTE_BGP
)
1201 uptime
= time (NULL
);
1202 uptime
-= rib
->uptime
;
1203 tm
= gmtime (&uptime
);
1205 #define ONE_DAY_SECOND 60*60*24
1206 #define ONE_WEEK_SECOND 60*60*24*7
1208 if (uptime
< ONE_DAY_SECOND
)
1209 vty_out (vty
, ", %02d:%02d:%02d",
1210 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
1211 else if (uptime
< ONE_WEEK_SECOND
)
1212 vty_out (vty
, ", %dd%02dh%02dm",
1213 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
1215 vty_out (vty
, ", %02dw%dd%02dh",
1217 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
1219 vty_out (vty
, "%s", VTY_NEWLINE
);
1223 #define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s B - BGP, * - FIB route.%s%s"
1225 DEFUN (show_ipv6_route
,
1226 show_ipv6_route_cmd
,
1230 "IPv6 routing table\n")
1232 struct route_table
*table
;
1233 struct route_node
*rn
;
1237 table
= vrf_table (AFI_IP6
, SAFI_UNICAST
, 0);
1241 /* Show all IPv6 route. */
1242 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
1243 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
1247 vty_out (vty
, SHOW_ROUTE_V6_HEADER
, VTY_NEWLINE
, VTY_NEWLINE
, VTY_NEWLINE
);
1250 vty_show_ipv6_route (vty
, rn
, rib
);
1255 DEFUN (show_ipv6_route_prefix_longer
,
1256 show_ipv6_route_prefix_longer_cmd
,
1257 "show ipv6 route X:X::X:X/M longer-prefixes",
1260 "IPv6 routing table\n"
1262 "Show route matching the specified Network/Mask pair only\n")
1264 struct route_table
*table
;
1265 struct route_node
*rn
;
1271 table
= vrf_table (AFI_IP6
, SAFI_UNICAST
, 0);
1275 ret
= str2prefix (argv
[0], &p
);
1278 vty_out (vty
, "%% Malformed Prefix%s", VTY_NEWLINE
);
1282 /* Show matched type IPv6 routes. */
1283 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
1284 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
1285 if (prefix_match (&p
, &rn
->p
))
1289 vty_out (vty
, SHOW_ROUTE_V6_HEADER
, VTY_NEWLINE
, VTY_NEWLINE
, VTY_NEWLINE
);
1292 vty_show_ipv6_route (vty
, rn
, rib
);
1297 DEFUN (show_ipv6_route_protocol
,
1298 show_ipv6_route_protocol_cmd
,
1299 "show ipv6 route (bgp|connected|kernel|ospf6|ripng|static)",
1302 "IP routing table\n"
1303 "Border Gateway Protocol (BGP)\n"
1306 "Open Shortest Path First (OSPFv3)\n"
1307 "Routing Information Protocol (RIPng)\n"
1311 struct route_table
*table
;
1312 struct route_node
*rn
;
1316 if (strncmp (argv
[0], "b", 1) == 0)
1317 type
= ZEBRA_ROUTE_BGP
;
1318 else if (strncmp (argv
[0], "c", 1) == 0)
1319 type
= ZEBRA_ROUTE_CONNECT
;
1320 else if (strncmp (argv
[0], "k", 1) ==0)
1321 type
= ZEBRA_ROUTE_KERNEL
;
1322 else if (strncmp (argv
[0], "o", 1) == 0)
1323 type
= ZEBRA_ROUTE_OSPF6
;
1324 else if (strncmp (argv
[0], "r", 1) == 0)
1325 type
= ZEBRA_ROUTE_RIPNG
;
1326 else if (strncmp (argv
[0], "s", 1) == 0)
1327 type
= ZEBRA_ROUTE_STATIC
;
1330 vty_out (vty
, "Unknown route type%s", VTY_NEWLINE
);
1334 table
= vrf_table (AFI_IP6
, SAFI_UNICAST
, 0);
1338 /* Show matched type IPv6 routes. */
1339 for (rn
= route_top (table
); rn
; rn
= route_next (rn
))
1340 for (rib
= rn
->info
; rib
; rib
= rib
->next
)
1341 if (rib
->type
== type
)
1345 vty_out (vty
, SHOW_ROUTE_V6_HEADER
, VTY_NEWLINE
, VTY_NEWLINE
, VTY_NEWLINE
);
1348 vty_show_ipv6_route (vty
, rn
, rib
);
1353 DEFUN (show_ipv6_route_addr
,
1354 show_ipv6_route_addr_cmd
,
1355 "show ipv6 route X:X::X:X",
1358 "IPv6 routing table\n"
1362 struct prefix_ipv6 p
;
1363 struct route_table
*table
;
1364 struct route_node
*rn
;
1366 ret
= str2prefix_ipv6 (argv
[0], &p
);
1369 vty_out (vty
, "Malformed IPv6 address%s", VTY_NEWLINE
);
1373 table
= vrf_table (AFI_IP6
, SAFI_UNICAST
, 0);
1377 rn
= route_node_match (table
, (struct prefix
*) &p
);
1380 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
1384 vty_show_ipv6_route_detail (vty
, rn
);
1386 route_unlock_node (rn
);
1391 DEFUN (show_ipv6_route_prefix
,
1392 show_ipv6_route_prefix_cmd
,
1393 "show ipv6 route X:X::X:X/M",
1396 "IPv6 routing table\n"
1400 struct prefix_ipv6 p
;
1401 struct route_table
*table
;
1402 struct route_node
*rn
;
1404 ret
= str2prefix_ipv6 (argv
[0], &p
);
1407 vty_out (vty
, "Malformed IPv6 prefix%s", VTY_NEWLINE
);
1411 table
= vrf_table (AFI_IP6
, SAFI_UNICAST
, 0);
1415 rn
= route_node_match (table
, (struct prefix
*) &p
);
1416 if (! rn
|| rn
->p
.prefixlen
!= p
.prefixlen
)
1418 vty_out (vty
, "%% Network not in table%s", VTY_NEWLINE
);
1422 vty_show_ipv6_route_detail (vty
, rn
);
1424 route_unlock_node (rn
);
1430 /* Write IPv6 static route configuration. */
1432 static_config_ipv6 (struct vty
*vty
)
1434 struct route_node
*rn
;
1435 struct static_ipv6
*si
;
1438 struct route_table
*stable
;
1443 stable
= vrf_static_table (AFI_IP6
, SAFI_UNICAST
, 0);
1447 for (rn
= route_top (stable
); rn
; rn
= route_next (rn
))
1448 for (si
= rn
->info
; si
; si
= si
->next
)
1450 vty_out (vty
, "ipv6 route %s/%d",
1451 inet_ntop (AF_INET6
, &rn
->p
.u
.prefix6
, buf
, BUFSIZ
),
1456 case STATIC_IPV6_GATEWAY
:
1457 vty_out (vty
, " %s", inet_ntop (AF_INET6
, &si
->ipv6
, buf
, BUFSIZ
));
1459 case STATIC_IPV6_IFNAME
:
1460 vty_out (vty
, " %s", si
->ifname
);
1462 case STATIC_IPV6_GATEWAY_IFNAME
:
1463 vty_out (vty
, " %s %s",
1464 inet_ntop (AF_INET6
, &si
->ipv6
, buf
, BUFSIZ
), si
->ifname
);
1468 if (si
->distance
!= ZEBRA_STATIC_DISTANCE_DEFAULT
)
1469 vty_out (vty
, " %d", si
->distance
);
1470 vty_out (vty
, "%s", VTY_NEWLINE
);
1476 #endif /* HAVE_IPV6 */
1478 /* Static ip route configuration write function. */
1480 zebra_ip_config (struct vty
*vty
)
1484 write
+= static_config_ipv4 (vty
);
1486 write
+= static_config_ipv6 (vty
);
1487 #endif /* HAVE_IPV6 */
1492 /* IP node for static routes. */
1493 struct cmd_node ip_node
= { IP_NODE
, "", 1 };
1497 zebra_vty_route_init ()
1499 install_node (&ip_node
, zebra_ip_config
);
1501 install_element (CONFIG_NODE
, &ip_route_cmd
);
1502 install_element (CONFIG_NODE
, &ip_route_mask_cmd
);
1503 install_element (CONFIG_NODE
, &no_ip_route_cmd
);
1504 install_element (CONFIG_NODE
, &no_ip_route_mask_cmd
);
1505 install_element (CONFIG_NODE
, &ip_route_distance_cmd
);
1506 install_element (CONFIG_NODE
, &ip_route_mask_distance_cmd
);
1507 install_element (CONFIG_NODE
, &no_ip_route_distance_cmd
);
1508 install_element (CONFIG_NODE
, &no_ip_route_mask_distance_cmd
);
1510 install_element (VIEW_NODE
, &show_ip_route_cmd
);
1511 install_element (VIEW_NODE
, &show_ip_route_addr_cmd
);
1512 install_element (VIEW_NODE
, &show_ip_route_prefix_cmd
);
1513 install_element (VIEW_NODE
, &show_ip_route_prefix_longer_cmd
);
1514 install_element (VIEW_NODE
, &show_ip_route_protocol_cmd
);
1515 install_element (VIEW_NODE
, &show_ip_route_supernets_cmd
);
1516 install_element (ENABLE_NODE
, &show_ip_route_cmd
);
1517 install_element (ENABLE_NODE
, &show_ip_route_addr_cmd
);
1518 install_element (ENABLE_NODE
, &show_ip_route_prefix_cmd
);
1519 install_element (ENABLE_NODE
, &show_ip_route_prefix_longer_cmd
);
1520 install_element (ENABLE_NODE
, &show_ip_route_protocol_cmd
);
1521 install_element (ENABLE_NODE
, &show_ip_route_supernets_cmd
);
1524 install_element (VIEW_NODE
, &show_ip_route_summary_cmd
);
1525 install_element (ENABLE_NODE
, &show_ip_route_summary_cmd
);
1529 install_element (CONFIG_NODE
, &ipv6_route_cmd
);
1530 install_element (CONFIG_NODE
, &ipv6_route_ifname_cmd
);
1531 install_element (CONFIG_NODE
, &no_ipv6_route_cmd
);
1532 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_cmd
);
1533 install_element (CONFIG_NODE
, &ipv6_route_pref_cmd
);
1534 install_element (CONFIG_NODE
, &ipv6_route_ifname_pref_cmd
);
1535 install_element (CONFIG_NODE
, &no_ipv6_route_pref_cmd
);
1536 install_element (CONFIG_NODE
, &no_ipv6_route_ifname_pref_cmd
);
1537 install_element (VIEW_NODE
, &show_ipv6_route_cmd
);
1538 install_element (VIEW_NODE
, &show_ipv6_route_protocol_cmd
);
1539 install_element (VIEW_NODE
, &show_ipv6_route_addr_cmd
);
1540 install_element (VIEW_NODE
, &show_ipv6_route_prefix_cmd
);
1541 install_element (VIEW_NODE
, &show_ipv6_route_prefix_longer_cmd
);
1542 install_element (ENABLE_NODE
, &show_ipv6_route_cmd
);
1543 install_element (ENABLE_NODE
, &show_ipv6_route_protocol_cmd
);
1544 install_element (ENABLE_NODE
, &show_ipv6_route_addr_cmd
);
1545 install_element (ENABLE_NODE
, &show_ipv6_route_prefix_cmd
);
1546 install_element (ENABLE_NODE
, &show_ipv6_route_prefix_longer_cmd
);
1547 #endif /* HAVE_IPV6 */
1553 zebra_vty_route_init ();