2002-12-13 21:15:29 +01:00
|
|
|
/* Zebra VTY functions
|
|
|
|
* Copyright (C) 2002 Kunihiro Ishiguro
|
|
|
|
*
|
|
|
|
* This file is part of GNU Zebra.
|
|
|
|
*
|
|
|
|
* GNU Zebra is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* GNU Zebra is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNU Zebra; see the file COPYING. If not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
2007-05-02 18:05:35 +02:00
|
|
|
#include "memory.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
#include "if.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "table.h"
|
|
|
|
#include "rib.h"
|
2015-05-20 02:40:34 +02:00
|
|
|
#include "nexthop.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2005-06-28 19:17:12 +02:00
|
|
|
#include "zebra/zserv.h"
|
2015-05-20 02:40:34 +02:00
|
|
|
#include "zebra/zebra_rnh.h"
|
2015-05-20 03:03:42 +02:00
|
|
|
#include "zebra/redistribute.h"
|
2005-06-28 19:17:12 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* General fucntion for static route. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static int
|
2004-10-12 22:50:58 +02:00
|
|
|
zebra_static_ipv4 (struct vty *vty, int add_cmd, const char *dest_str,
|
|
|
|
const char *mask_str, const char *gate_str,
|
2015-05-20 02:46:33 +02:00
|
|
|
const char *flag_str, const char *tag_str,
|
|
|
|
const char *distance_str)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
u_char distance;
|
|
|
|
struct prefix p;
|
|
|
|
struct in_addr gate;
|
|
|
|
struct in_addr mask;
|
2004-10-12 22:50:58 +02:00
|
|
|
const char *ifname;
|
2003-05-25 21:21:25 +02:00
|
|
|
u_char flag = 0;
|
2015-05-20 02:46:33 +02:00
|
|
|
u_short tag = 0;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
ret = str2prefix (dest_str, &p);
|
|
|
|
if (ret <= 0)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Cisco like mask notation. */
|
|
|
|
if (mask_str)
|
|
|
|
{
|
|
|
|
ret = inet_aton (mask_str, &mask);
|
|
|
|
if (ret == 0)
|
2003-05-25 23:35:06 +02:00
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
p.prefixlen = ip_masklen (mask);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Apply mask for given prefix. */
|
|
|
|
apply_mask (&p);
|
|
|
|
|
2003-05-25 23:35:06 +02:00
|
|
|
/* Administrative distance. */
|
|
|
|
if (distance_str)
|
|
|
|
distance = atoi (distance_str);
|
|
|
|
else
|
|
|
|
distance = ZEBRA_STATIC_DISTANCE_DEFAULT;
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
/* tag */
|
|
|
|
if (tag_str)
|
|
|
|
tag = atoi(tag_str);
|
|
|
|
|
2003-05-25 23:35:06 +02:00
|
|
|
/* Null0 static route. */
|
2003-05-28 14:02:15 +02:00
|
|
|
if ((gate_str != NULL) && (strncasecmp (gate_str, "Null0", strlen (gate_str)) == 0))
|
2003-05-25 23:35:06 +02:00
|
|
|
{
|
|
|
|
if (flag_str)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% can not have flag %s with Null0%s", flag_str, VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
if (add_cmd)
|
2015-05-20 02:46:33 +02:00
|
|
|
static_add_ipv4 (&p, NULL, NULL, ZEBRA_FLAG_BLACKHOLE, tag, distance, 0);
|
2003-05-25 23:35:06 +02:00
|
|
|
else
|
2015-05-20 02:46:33 +02:00
|
|
|
static_delete_ipv4 (&p, NULL, NULL, tag, distance, 0);
|
2003-05-25 23:35:06 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
/* Route flags */
|
|
|
|
if (flag_str) {
|
|
|
|
switch(flag_str[0]) {
|
|
|
|
case 'r':
|
|
|
|
case 'R': /* XXX */
|
|
|
|
SET_FLAG (flag, ZEBRA_FLAG_REJECT);
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
case 'B': /* XXX */
|
|
|
|
SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE);
|
2003-05-25 23:35:06 +02:00
|
|
|
return CMD_WARNING;
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
if (gate_str == NULL)
|
|
|
|
{
|
|
|
|
if (add_cmd)
|
2015-05-20 02:46:33 +02:00
|
|
|
static_add_ipv4 (&p, NULL, NULL, flag, tag, distance, 0);
|
2003-05-28 14:02:15 +02:00
|
|
|
else
|
2015-05-20 02:46:33 +02:00
|
|
|
static_delete_ipv4 (&p, NULL, NULL, tag, distance, 0);
|
2003-05-28 14:02:15 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* When gateway is A.B.C.D format, gate is treated as nexthop
|
|
|
|
address other case gate is treated as interface name. */
|
|
|
|
ret = inet_aton (gate_str, &gate);
|
|
|
|
if (ret)
|
|
|
|
ifname = NULL;
|
|
|
|
else
|
|
|
|
ifname = gate_str;
|
|
|
|
|
|
|
|
if (add_cmd)
|
2015-05-20 02:46:33 +02:00
|
|
|
static_add_ipv4 (&p, ifname ? NULL : &gate, ifname, flag, tag, distance, 0);
|
2002-12-13 21:15:29 +01:00
|
|
|
else
|
2015-05-20 02:46:33 +02:00
|
|
|
static_delete_ipv4 (&p, ifname ? NULL : &gate, ifname, tag, distance, 0);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Static route configuration. */
|
|
|
|
DEFUN (ip_route,
|
|
|
|
ip_route_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
|
2003-05-25 21:21:25 +02:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n")
|
2003-05-25 21:21:25 +02:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_tag,
|
|
|
|
ip_route_tag_cmd,
|
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], NULL, argv[2], NULL);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_flags,
|
|
|
|
ip_route_flags_cmd,
|
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
|
2002-12-13 21:15:29 +01:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], argv[2], NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_flags_tag,
|
|
|
|
ip_route_flags_tag_cmd,
|
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], argv[2], argv[3], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (ip_route_flags2,
|
|
|
|
ip_route_flags2_cmd,
|
|
|
|
"ip route A.B.C.D/M (reject|blackhole)",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, NULL, argv[1], NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_flags2_tag,
|
|
|
|
ip_route_flags2_tag_cmd,
|
|
|
|
"ip route A.B.C.D/M (reject|blackhole) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, NULL, argv[1], argv[2], NULL);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Mask as A.B.C.D format. */
|
|
|
|
DEFUN (ip_route_mask,
|
|
|
|
ip_route_mask_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
|
2003-05-25 21:21:25 +02:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n")
|
2003-05-25 21:21:25 +02:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_mask_tag,
|
|
|
|
ip_route_mask_tag_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], NULL);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_mask_flags,
|
|
|
|
ip_route_mask_flags_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
|
2002-12-13 21:15:29 +01:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_mask_flags_tag,
|
|
|
|
ip_route_mask_flags_tag_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (ip_route_mask_flags2,
|
|
|
|
ip_route_mask_flags2_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (reject|blackhole)",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_mask_flags2_tag,
|
|
|
|
ip_route_mask_flags2_tag_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], NULL);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Distance option value. */
|
|
|
|
DEFUN (ip_route_distance,
|
|
|
|
ip_route_distance_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
|
2003-05-25 21:21:25 +02:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"Null interface\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], NULL, NULL, argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_tag_distance,
|
|
|
|
ip_route_tag_distance_cmd,
|
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], NULL, argv[2], argv[3]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_flags_distance,
|
|
|
|
ip_route_flags_distance_cmd,
|
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
|
2002-12-13 21:15:29 +01:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
2002-12-13 21:15:29 +01:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], argv[2], NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_flags_tag_distance,
|
|
|
|
ip_route_flags_tag_distance_cmd,
|
|
|
|
"ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, argv[1], argv[2], argv[3], argv[4]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (ip_route_flags_distance2,
|
|
|
|
ip_route_flags_distance2_cmd,
|
|
|
|
"ip route A.B.C.D/M (reject|blackhole) <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, NULL, argv[1], NULL, argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_flags_tag_distance2,
|
|
|
|
ip_route_flags_tag_distance2_cmd,
|
|
|
|
"ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], NULL, NULL, argv[1], argv[2], argv[3]);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (ip_route_mask_distance,
|
|
|
|
ip_route_mask_distance_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
|
2002-12-13 21:15:29 +01:00
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"Null interface\n"
|
2002-12-13 21:15:29 +01:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, argv[3]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
DEFUN (ip_route_mask_tag_distance,
|
|
|
|
ip_route_mask_tag_distance_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], argv[4]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_mask_flags_tag_distance,
|
|
|
|
ip_route_mask_flags_tag_distance_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
DEFUN (ip_route_mask_flags_distance,
|
|
|
|
ip_route_mask_flags_distance_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
2013-09-30 14:27:49 +02:00
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this route\n")
|
2003-05-25 21:21:25 +02:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (ip_route_mask_flags_distance2,
|
|
|
|
ip_route_mask_flags_distance2_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
2013-09-30 14:27:49 +02:00
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this route\n")
|
2003-05-28 14:02:15 +02:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_route_mask_flags_tag_distance2,
|
|
|
|
ip_route_mask_flags_tag_distance2_cmd,
|
|
|
|
"ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], argv[4]);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_ip_route,
|
|
|
|
no_ip_route_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
|
2002-12-13 21:15:29 +01:00
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_tag,
|
|
|
|
no_ip_route_tag_cmd,
|
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], NULL, argv[2], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
ALIAS (no_ip_route,
|
|
|
|
no_ip_route_flags_cmd,
|
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
ALIAS (no_ip_route_tag,
|
|
|
|
no_ip_route_flags_tag_cmd,
|
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (no_ip_route_flags2,
|
|
|
|
no_ip_route_flags2_cmd,
|
|
|
|
"no ip route A.B.C.D/M (reject|blackhole)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_flags2_tag,
|
|
|
|
no_ip_route_flags2_tag_cmd,
|
|
|
|
"no ip route A.B.C.D/M (reject|blackhole) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, NULL, argv[1], NULL);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_ip_route_mask,
|
|
|
|
no_ip_route_mask_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
|
2002-12-13 21:15:29 +01:00
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_mask_tag,
|
|
|
|
no_ip_route_mask_tag_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
ALIAS (no_ip_route_mask,
|
|
|
|
no_ip_route_mask_flags_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
ALIAS (no_ip_route_mask_tag,
|
|
|
|
no_ip_route_mask_flags_tag_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (no_ip_route_mask_flags2,
|
|
|
|
no_ip_route_mask_flags2_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (reject|blackhole)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_mask_flags2_tag,
|
|
|
|
no_ip_route_mask_flags2_tag_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_ip_route_distance,
|
|
|
|
no_ip_route_distance_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
|
2003-05-25 21:21:25 +02:00
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"Null interface\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], NULL, NULL, argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_tag_distance,
|
|
|
|
no_ip_route_tag_distance_cmd,
|
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], NULL, argv[2], argv[3]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_flags_distance,
|
|
|
|
no_ip_route_flags_distance_cmd,
|
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
|
2002-12-13 21:15:29 +01:00
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
2002-12-13 21:15:29 +01:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], argv[2], NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_flags_tag_distance,
|
|
|
|
no_ip_route_flags_tag_distance_cmd,
|
|
|
|
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], argv[2], argv[3], argv[4]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (no_ip_route_flags_distance2,
|
|
|
|
no_ip_route_flags_distance2_cmd,
|
|
|
|
"no ip route A.B.C.D/M (reject|blackhole) <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, argv[1], NULL, argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_flags_tag_distance2,
|
|
|
|
no_ip_route_flags_tag_distance2_cmd,
|
|
|
|
"no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix (e.g. 10.0.0.0/8)\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, argv[1], argv[2] , argv[3]);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_ip_route_mask_distance,
|
|
|
|
no_ip_route_mask_distance_cmd,
|
2003-05-25 23:35:06 +02:00
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
|
2003-05-25 21:21:25 +02:00
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 23:35:06 +02:00
|
|
|
"Null interface\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_mask_tag_distance,
|
|
|
|
no_ip_route_mask_tag_distance_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Null interface\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], argv[4]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_mask_flags_distance,
|
|
|
|
no_ip_route_mask_flags_distance_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
|
2002-12-13 21:15:29 +01:00
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
2003-05-25 21:21:25 +02:00
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
2002-12-13 21:15:29 +01:00
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_mask_flags_tag_distance,
|
|
|
|
no_ip_route_mask_flags_tag_distance_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"IP gateway address\n"
|
|
|
|
"IP gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-28 14:02:15 +02:00
|
|
|
DEFUN (no_ip_route_mask_flags_distance2,
|
|
|
|
no_ip_route_mask_flags_distance2_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_route_mask_flags_tag_distance2,
|
|
|
|
no_ip_route_mask_flags_tag_distance2_cmd,
|
|
|
|
"no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IP destination prefix\n"
|
|
|
|
"IP destination prefix mask\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Tag of this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this route\n")
|
|
|
|
{
|
|
|
|
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], argv[4]);
|
2003-05-28 14:02:15 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* New RIB. Detailed information for IPv4 route. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static void
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_show_ip_route_detail (struct vty *vty, struct route_node *rn)
|
|
|
|
{
|
|
|
|
struct rib *rib;
|
2013-07-05 17:35:37 +02:00
|
|
|
struct nexthop *nexthop, *tnexthop;
|
|
|
|
int recursing;
|
2015-06-11 18:19:12 +02:00
|
|
|
char buf[BUFSIZ];
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
vty_out (vty, "Routing entry for %s/%d%s",
|
|
|
|
inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
|
|
|
|
VTY_NEWLINE);
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
vty_out (vty, " Known via \"%s", zebra_route_string (rib->type));
|
|
|
|
if (rib->instance)
|
|
|
|
vty_out (vty, "[%d]", rib->instance);
|
|
|
|
vty_out (vty, "\"");
|
2012-04-13 13:46:07 +02:00
|
|
|
vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
|
2015-05-20 02:46:33 +02:00
|
|
|
if (rib->tag)
|
|
|
|
vty_out (vty, ", tag %d", rib->tag);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
|
|
|
|
vty_out (vty, ", best");
|
|
|
|
if (rib->refcnt)
|
|
|
|
vty_out (vty, ", refcnt %ld", rib->refcnt);
|
2003-05-25 21:21:25 +02:00
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
|
|
|
|
vty_out (vty, ", blackhole");
|
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
|
|
|
|
vty_out (vty, ", reject");
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
|
|
|
|
#define ONE_DAY_SECOND 60*60*24
|
|
|
|
#define ONE_WEEK_SECOND 60*60*24*7
|
|
|
|
if (rib->type == ZEBRA_ROUTE_RIP
|
|
|
|
|| rib->type == ZEBRA_ROUTE_OSPF
|
2012-02-09 13:42:28 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BABEL
|
2003-12-23 09:56:18 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_ISIS
|
2015-05-20 03:03:42 +02:00
|
|
|
|| rib->type == ZEBRA_ROUTE_TABLE
|
2002-12-13 21:15:29 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BGP)
|
|
|
|
{
|
|
|
|
time_t uptime;
|
|
|
|
struct tm *tm;
|
|
|
|
|
|
|
|
uptime = time (NULL);
|
|
|
|
uptime -= rib->uptime;
|
|
|
|
tm = gmtime (&uptime);
|
|
|
|
|
|
|
|
vty_out (vty, " Last update ");
|
|
|
|
|
|
|
|
if (uptime < ONE_DAY_SECOND)
|
|
|
|
vty_out (vty, "%02d:%02d:%02d",
|
|
|
|
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
|
|
else if (uptime < ONE_WEEK_SECOND)
|
|
|
|
vty_out (vty, "%dd%02dh%02dm",
|
|
|
|
tm->tm_yday, tm->tm_hour, tm->tm_min);
|
|
|
|
else
|
|
|
|
vty_out (vty, "%02dw%dd%02dh",
|
|
|
|
tm->tm_yday/7,
|
|
|
|
tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
|
|
|
|
vty_out (vty, " ago%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
|
2013-07-05 17:35:37 +02:00
|
|
|
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2007-05-02 18:05:35 +02:00
|
|
|
char addrstr[32];
|
|
|
|
|
2013-07-05 17:35:37 +02:00
|
|
|
vty_out (vty, " %c%s",
|
|
|
|
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) ? '*' : ' ',
|
|
|
|
recursing ? " " : "");
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
switch (nexthop->type)
|
|
|
|
{
|
|
|
|
case NEXTHOP_TYPE_IPV4:
|
|
|
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
|
|
|
vty_out (vty, " %s", inet_ntoa (nexthop->gate.ipv4));
|
|
|
|
if (nexthop->ifindex)
|
|
|
|
vty_out (vty, ", via %s", ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
2015-06-11 18:19:12 +02:00
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
case NEXTHOP_TYPE_IPV6:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFNAME:
|
|
|
|
vty_out (vty, " %s",
|
|
|
|
inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
|
|
|
|
if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
|
|
|
|
vty_out (vty, ", %s", nexthop->ifname);
|
|
|
|
else if (nexthop->ifindex)
|
|
|
|
vty_out (vty, ", via %s", ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
#endif /* HAVE_IPV6 */
|
2002-12-13 21:15:29 +01:00
|
|
|
case NEXTHOP_TYPE_IFINDEX:
|
|
|
|
vty_out (vty, " directly connected, %s",
|
|
|
|
ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
case NEXTHOP_TYPE_IFNAME:
|
|
|
|
vty_out (vty, " directly connected, %s", nexthop->ifname);
|
|
|
|
break;
|
2003-05-25 23:35:06 +02:00
|
|
|
case NEXTHOP_TYPE_BLACKHOLE:
|
2003-07-15 14:52:22 +02:00
|
|
|
vty_out (vty, " directly connected, Null0");
|
2003-05-25 23:35:06 +02:00
|
|
|
break;
|
2003-07-15 14:52:22 +02:00
|
|
|
default:
|
2002-12-13 21:15:29 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
|
|
|
vty_out (vty, " inactive");
|
|
|
|
|
2013-07-05 17:35:39 +02:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ONLINK))
|
|
|
|
vty_out (vty, " onlink");
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
|
2013-07-05 17:35:37 +02:00
|
|
|
vty_out (vty, " (recursive)");
|
|
|
|
|
2007-05-02 18:05:35 +02:00
|
|
|
switch (nexthop->type)
|
|
|
|
{
|
|
|
|
case NEXTHOP_TYPE_IPV4:
|
|
|
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV4_IFNAME:
|
|
|
|
if (nexthop->src.ipv4.s_addr)
|
|
|
|
{
|
|
|
|
if (inet_ntop(AF_INET, &nexthop->src.ipv4, addrstr,
|
|
|
|
sizeof addrstr))
|
|
|
|
vty_out (vty, ", src %s", addrstr);
|
|
|
|
}
|
|
|
|
break;
|
2007-05-30 22:10:34 +02:00
|
|
|
#ifdef HAVE_IPV6
|
2007-05-02 18:05:35 +02:00
|
|
|
case NEXTHOP_TYPE_IPV6:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFNAME:
|
|
|
|
if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any))
|
|
|
|
{
|
|
|
|
if (inet_ntop(AF_INET6, &nexthop->src.ipv6, addrstr,
|
|
|
|
sizeof addrstr))
|
|
|
|
vty_out (vty, ", src %s", addrstr);
|
|
|
|
}
|
|
|
|
break;
|
2007-05-30 22:10:34 +02:00
|
|
|
#endif /* HAVE_IPV6 */
|
2007-05-02 18:05:35 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-28 19:17:12 +02:00
|
|
|
static void
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
|
|
|
|
{
|
2013-07-05 17:35:37 +02:00
|
|
|
struct nexthop *nexthop, *tnexthop;
|
|
|
|
int recursing;
|
2002-12-13 21:15:29 +01:00
|
|
|
int len = 0;
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
|
|
|
|
/* Nexthop information. */
|
2013-07-05 17:35:37 +02:00
|
|
|
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
if (nexthop == rib->nexthop)
|
|
|
|
{
|
|
|
|
/* Prefix information. */
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
len = vty_out (vty, "%c", zebra_route_char (rib->type));
|
|
|
|
if (rib->instance)
|
|
|
|
len += vty_out (vty, "[%d]", rib->instance);
|
|
|
|
len += vty_out (vty, "%c%c %s/%d",
|
2002-12-13 21:15:29 +01:00
|
|
|
CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED)
|
|
|
|
? '>' : ' ',
|
|
|
|
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
|
|
|
|
? '*' : ' ',
|
|
|
|
inet_ntop (AF_INET, &rn->p.u.prefix, buf, BUFSIZ),
|
|
|
|
rn->p.prefixlen);
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Distance and metric display. */
|
|
|
|
if (rib->type != ZEBRA_ROUTE_CONNECT
|
|
|
|
&& rib->type != ZEBRA_ROUTE_KERNEL)
|
|
|
|
len += vty_out (vty, " [%d/%d]", rib->distance,
|
|
|
|
rib->metric);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
vty_out (vty, " %c%*c",
|
|
|
|
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
|
|
|
|
? '*' : ' ',
|
2013-07-05 17:35:37 +02:00
|
|
|
len - 3 + (2 * recursing), ' ');
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
switch (nexthop->type)
|
|
|
|
{
|
|
|
|
case NEXTHOP_TYPE_IPV4:
|
|
|
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
|
|
|
vty_out (vty, " via %s", inet_ntoa (nexthop->gate.ipv4));
|
|
|
|
if (nexthop->ifindex)
|
|
|
|
vty_out (vty, ", %s", ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
2015-06-11 18:19:12 +02:00
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
case NEXTHOP_TYPE_IPV6:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFNAME:
|
|
|
|
vty_out (vty, " via %s",
|
|
|
|
inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
|
|
|
|
if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
|
|
|
|
vty_out (vty, ", %s", nexthop->ifname);
|
|
|
|
else if (nexthop->ifindex)
|
|
|
|
vty_out (vty, ", %s", ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
#endif /* HAVE_IPV6 */
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
case NEXTHOP_TYPE_IFINDEX:
|
|
|
|
vty_out (vty, " is directly connected, %s",
|
|
|
|
ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
case NEXTHOP_TYPE_IFNAME:
|
|
|
|
vty_out (vty, " is directly connected, %s", nexthop->ifname);
|
|
|
|
break;
|
2003-05-25 23:35:06 +02:00
|
|
|
case NEXTHOP_TYPE_BLACKHOLE:
|
2003-07-15 14:52:22 +02:00
|
|
|
vty_out (vty, " is directly connected, Null0");
|
2003-05-25 23:35:06 +02:00
|
|
|
break;
|
2003-07-15 14:52:22 +02:00
|
|
|
default:
|
2002-12-13 21:15:29 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
|
|
|
vty_out (vty, " inactive");
|
|
|
|
|
2013-07-05 17:35:39 +02:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ONLINK))
|
|
|
|
vty_out (vty, " onlink");
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
|
2013-07-05 17:35:37 +02:00
|
|
|
vty_out (vty, " (recursive)");
|
|
|
|
|
2007-05-02 18:05:35 +02:00
|
|
|
switch (nexthop->type)
|
|
|
|
{
|
|
|
|
case NEXTHOP_TYPE_IPV4:
|
|
|
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV4_IFNAME:
|
|
|
|
if (nexthop->src.ipv4.s_addr)
|
|
|
|
{
|
|
|
|
if (inet_ntop(AF_INET, &nexthop->src.ipv4, buf, sizeof buf))
|
|
|
|
vty_out (vty, ", src %s", buf);
|
|
|
|
}
|
|
|
|
break;
|
2007-05-30 22:10:34 +02:00
|
|
|
#ifdef HAVE_IPV6
|
2007-05-02 18:05:35 +02:00
|
|
|
case NEXTHOP_TYPE_IPV6:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFNAME:
|
|
|
|
if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any))
|
|
|
|
{
|
|
|
|
if (inet_ntop(AF_INET6, &nexthop->src.ipv6, buf, sizeof buf))
|
|
|
|
vty_out (vty, ", src %s", buf);
|
|
|
|
}
|
|
|
|
break;
|
2007-05-30 22:10:34 +02:00
|
|
|
#endif /* HAVE_IPV6 */
|
2007-05-02 18:05:35 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
|
|
|
|
vty_out (vty, ", bh");
|
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
|
|
|
|
vty_out (vty, ", rej");
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (rib->type == ZEBRA_ROUTE_RIP
|
|
|
|
|| rib->type == ZEBRA_ROUTE_OSPF
|
2012-02-09 13:42:28 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BABEL
|
2003-12-23 09:56:18 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_ISIS
|
2015-05-20 03:03:42 +02:00
|
|
|
|| rib->type == ZEBRA_ROUTE_TABLE
|
2002-12-13 21:15:29 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BGP)
|
|
|
|
{
|
|
|
|
time_t uptime;
|
|
|
|
struct tm *tm;
|
|
|
|
|
|
|
|
uptime = time (NULL);
|
|
|
|
uptime -= rib->uptime;
|
|
|
|
tm = gmtime (&uptime);
|
|
|
|
|
|
|
|
#define ONE_DAY_SECOND 60*60*24
|
|
|
|
#define ONE_WEEK_SECOND 60*60*24*7
|
|
|
|
|
|
|
|
if (uptime < ONE_DAY_SECOND)
|
|
|
|
vty_out (vty, ", %02d:%02d:%02d",
|
|
|
|
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
|
|
else if (uptime < ONE_WEEK_SECOND)
|
|
|
|
vty_out (vty, ", %dd%02dh%02dm",
|
|
|
|
tm->tm_yday, tm->tm_hour, tm->tm_min);
|
|
|
|
else
|
|
|
|
vty_out (vty, ", %02dw%dd%02dh",
|
|
|
|
tm->tm_yday/7,
|
|
|
|
tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
|
|
|
|
}
|
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ip_route,
|
|
|
|
show_ip_route_cmd,
|
|
|
|
"show ip route",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show all IPv4 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
2015-06-11 18:19:12 +02:00
|
|
|
vty_show_ip_route (vty, rn, rib);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-05-20 02:40:34 +02:00
|
|
|
DEFUN (show_ip_nht,
|
|
|
|
show_ip_nht_cmd,
|
|
|
|
"show ip nht",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP nexthop tracking table\n")
|
|
|
|
{
|
2015-05-20 03:04:20 +02:00
|
|
|
zebra_print_rnh_table(0, AF_INET, vty, RNH_NEXTHOP_TYPE);
|
2015-05-20 02:40:34 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ipv6_nht,
|
|
|
|
show_ipv6_nht_cmd,
|
|
|
|
"show ipv6 nht",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 nexthop tracking table\n")
|
|
|
|
{
|
2015-05-20 03:04:20 +02:00
|
|
|
zebra_print_rnh_table(0, AF_INET6, vty, RNH_NEXTHOP_TYPE);
|
2015-05-20 02:40:34 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-05-20 03:04:16 +02:00
|
|
|
DEFUN (ip_nht_default_route,
|
|
|
|
ip_nht_default_route_cmd,
|
|
|
|
"ip nht resolve-via-default",
|
|
|
|
IP_STR
|
|
|
|
"Filter Next Hop tracking route resolution\n"
|
|
|
|
"Resolve via default route\n")
|
|
|
|
{
|
|
|
|
if (zebra_rnh_ip_default_route)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
zebra_rnh_ip_default_route = 1;
|
2015-05-20 03:04:20 +02:00
|
|
|
zebra_evaluate_rnh(0, AF_INET, 1, RNH_NEXTHOP_TYPE, NULL);
|
2015-05-20 03:04:16 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_nht_default_route,
|
|
|
|
no_ip_nht_default_route_cmd,
|
|
|
|
"no ip nht resolve-via-default",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Filter Next Hop tracking route resolution\n"
|
|
|
|
"Resolve via default route\n")
|
|
|
|
{
|
|
|
|
if (!zebra_rnh_ip_default_route)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
zebra_rnh_ip_default_route = 0;
|
2015-05-20 03:04:20 +02:00
|
|
|
zebra_evaluate_rnh(0, AF_INET, 1, RNH_NEXTHOP_TYPE, NULL);
|
2015-05-20 03:04:16 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_nht_default_route,
|
|
|
|
ipv6_nht_default_route_cmd,
|
|
|
|
"ipv6 nht resolve-via-default",
|
|
|
|
IP6_STR
|
|
|
|
"Filter Next Hop tracking route resolution\n"
|
|
|
|
"Resolve via default route\n")
|
|
|
|
{
|
|
|
|
if (zebra_rnh_ipv6_default_route)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
zebra_rnh_ipv6_default_route = 1;
|
2015-05-20 03:04:20 +02:00
|
|
|
zebra_evaluate_rnh(0, AF_INET6, 1, RNH_NEXTHOP_TYPE, NULL);
|
2015-05-20 03:04:16 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_nht_default_route,
|
|
|
|
no_ipv6_nht_default_route_cmd,
|
|
|
|
"no ipv6 nht resolve-via-default",
|
|
|
|
NO_STR
|
|
|
|
IP6_STR
|
|
|
|
"Filter Next Hop tracking route resolution\n"
|
|
|
|
"Resolve via default route\n")
|
|
|
|
{
|
|
|
|
if (!zebra_rnh_ipv6_default_route)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
zebra_rnh_ipv6_default_route = 0;
|
2015-05-20 03:04:20 +02:00
|
|
|
zebra_evaluate_rnh(0, AF_INET6, 1, RNH_NEXTHOP_TYPE, NULL);
|
2015-05-20 03:04:16 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
DEFUN (show_ip_route_tag,
|
|
|
|
show_ip_route_tag_cmd,
|
|
|
|
"show ip route tag <1-65535>",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"Show only routes with tag\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
u_short tag = 0;
|
|
|
|
|
|
|
|
if (argv[0])
|
|
|
|
tag = atoi(argv[0]);
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show all IPv4 routes with matching tag value. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
|
|
|
{
|
|
|
|
if (rib->tag != tag)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (first)
|
|
|
|
{
|
2015-05-20 03:04:26 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
2015-05-20 02:46:33 +02:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ip_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (show_ip_route_prefix_longer,
|
|
|
|
show_ip_route_prefix_longer_cmd,
|
|
|
|
"show ip route A.B.C.D/M longer-prefixes",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
|
|
|
|
"Show route matching the specified Network/Mask pair only\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
struct prefix p;
|
|
|
|
int ret;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
ret = str2prefix (argv[0], &p);
|
|
|
|
if (! ret)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show matched type IPv4 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
if (prefix_match (&p, &rn->p))
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ip_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ip_route_supernets,
|
|
|
|
show_ip_route_supernets_cmd,
|
|
|
|
"show ip route supernets-only",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"Show supernet entries only\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
u_int32_t addr;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show matched type IPv4 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
addr = ntohl (rn->p.u.prefix4.s_addr);
|
|
|
|
|
|
|
|
if ((IN_CLASSC (addr) && rn->p.prefixlen < 24)
|
|
|
|
|| (IN_CLASSB (addr) && rn->p.prefixlen < 16)
|
|
|
|
|| (IN_CLASSA (addr) && rn->p.prefixlen < 8))
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ip_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ip_route_protocol,
|
|
|
|
show_ip_route_protocol_cmd,
|
2009-09-16 01:52:42 +02:00
|
|
|
"show ip route " QUAGGA_IP_REDIST_STR_ZEBRA,
|
2002-12-13 21:15:29 +01:00
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
2009-09-16 01:52:42 +02:00
|
|
|
QUAGGA_IP_REDIST_HELP_STR_ZEBRA)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
|
2009-09-16 01:52:42 +02:00
|
|
|
type = proto_redistnum (AFI_IP, argv[0]);
|
|
|
|
if (type < 0)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show matched type IPv4 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
if (rib->type == type)
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ip_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
DEFUN (show_ip_route_ospf_instance,
|
|
|
|
show_ip_route_ospf_instance_cmd,
|
|
|
|
"show ip route ospf <1-65535>",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"Open Shortest Path First (OSPFv2)\n"
|
|
|
|
"Instance ID\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
u_short instance = 0;
|
|
|
|
|
|
|
|
VTY_GET_INTEGER ("Instance", instance, argv[0]);
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show matched type IPv4 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
|
|
|
if (rib->type == ZEBRA_ROUTE_OSPF && rib->instance == instance)
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ip_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (show_ip_route_addr,
|
|
|
|
show_ip_route_addr_cmd,
|
|
|
|
"show ip route A.B.C.D",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"Network in the IP routing table to display\n")
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
struct prefix_ipv4 p;
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
|
|
|
|
ret = str2prefix_ipv4 (argv[0], &p);
|
|
|
|
if (ret <= 0)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
rn = route_node_match (table, (struct prefix *) &p);
|
|
|
|
if (! rn)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_show_ip_route_detail (vty, rn);
|
|
|
|
|
|
|
|
route_unlock_node (rn);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ip_route_prefix,
|
|
|
|
show_ip_route_prefix_cmd,
|
|
|
|
"show ip route A.B.C.D/M",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
struct prefix_ipv4 p;
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
|
|
|
|
ret = str2prefix_ipv4 (argv[0], &p);
|
|
|
|
if (ret <= 0)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
rn = route_node_match (table, (struct prefix *) &p);
|
|
|
|
if (! rn || rn->p.prefixlen != p.prefixlen)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_show_ip_route_detail (vty, rn);
|
|
|
|
|
|
|
|
route_unlock_node (rn);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-06-28 19:17:12 +02:00
|
|
|
static void
|
2008-11-05 00:45:07 +01:00
|
|
|
vty_show_ip_route_summary (struct vty *vty, struct route_table *table)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2008-11-05 00:45:07 +01:00
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
struct nexthop *nexthop;
|
|
|
|
#define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
|
|
|
|
#define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
|
|
|
|
u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
|
|
|
|
u_int32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
|
|
|
|
u_int32_t i;
|
|
|
|
|
|
|
|
memset (&rib_cnt, 0, sizeof(rib_cnt));
|
|
|
|
memset (&fib_cnt, 0, sizeof(fib_cnt));
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2008-11-05 00:45:07 +01:00
|
|
|
for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
|
|
|
|
{
|
|
|
|
rib_cnt[ZEBRA_ROUTE_TOTAL]++;
|
|
|
|
rib_cnt[rib->type]++;
|
2013-07-05 17:35:37 +02:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
|
|
|
|
|| nexthop_has_fib_child(nexthop))
|
2008-11-05 00:45:07 +01:00
|
|
|
{
|
|
|
|
fib_cnt[ZEBRA_ROUTE_TOTAL]++;
|
|
|
|
fib_cnt[rib->type]++;
|
|
|
|
}
|
|
|
|
if (rib->type == ZEBRA_ROUTE_BGP &&
|
|
|
|
CHECK_FLAG (rib->flags, ZEBRA_FLAG_IBGP))
|
|
|
|
{
|
|
|
|
rib_cnt[ZEBRA_ROUTE_IBGP]++;
|
2013-07-05 17:35:37 +02:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
|
|
|
|
|| nexthop_has_fib_child(nexthop))
|
2008-11-05 00:45:07 +01:00
|
|
|
fib_cnt[ZEBRA_ROUTE_IBGP]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_out (vty, "%-20s %-20s %-20s %s",
|
|
|
|
"Route Source", "Routes", "FIB", VTY_NEWLINE);
|
|
|
|
|
|
|
|
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
|
|
|
|
{
|
|
|
|
if (rib_cnt[i] > 0)
|
|
|
|
{
|
|
|
|
if (i == ZEBRA_ROUTE_BGP)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", "ebgp",
|
|
|
|
rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP],
|
|
|
|
fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP],
|
|
|
|
VTY_NEWLINE);
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", "ibgp",
|
|
|
|
rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_IBGP],
|
|
|
|
VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", zebra_route_string(i),
|
|
|
|
rib_cnt[i], fib_cnt[i], VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_out (vty, "------%s", VTY_NEWLINE);
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL],
|
|
|
|
fib_cnt[ZEBRA_ROUTE_TOTAL], VTY_NEWLINE);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2015-05-20 02:24:41 +02:00
|
|
|
/*
|
|
|
|
* Implementation of the ip route summary prefix command.
|
|
|
|
*
|
|
|
|
* This command prints the primary prefixes that have been installed by various
|
|
|
|
* protocols on the box.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
struct nexthop *nexthop;
|
|
|
|
#define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
|
|
|
|
#define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
|
|
|
|
u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
|
|
|
|
u_int32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
|
|
|
|
u_int32_t i;
|
|
|
|
int cnt;
|
|
|
|
|
|
|
|
memset (&rib_cnt, 0, sizeof(rib_cnt));
|
|
|
|
memset (&fib_cnt, 0, sizeof(fib_cnt));
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
* In case of ECMP, count only once.
|
|
|
|
*/
|
|
|
|
cnt = 0;
|
|
|
|
for (nexthop = rib->nexthop; (!cnt && nexthop); nexthop = nexthop->next)
|
|
|
|
{
|
|
|
|
cnt++;
|
|
|
|
rib_cnt[ZEBRA_ROUTE_TOTAL]++;
|
|
|
|
rib_cnt[rib->type]++;
|
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
|
|
|
|
{
|
|
|
|
fib_cnt[ZEBRA_ROUTE_TOTAL]++;
|
|
|
|
fib_cnt[rib->type]++;
|
|
|
|
}
|
|
|
|
if (rib->type == ZEBRA_ROUTE_BGP &&
|
|
|
|
CHECK_FLAG (rib->flags, ZEBRA_FLAG_IBGP))
|
|
|
|
{
|
|
|
|
rib_cnt[ZEBRA_ROUTE_IBGP]++;
|
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
|
|
|
|
fib_cnt[ZEBRA_ROUTE_IBGP]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_out (vty, "%-20s %-20s %-20s %s",
|
|
|
|
"Route Source", "Prefix Routes", "FIB", VTY_NEWLINE);
|
|
|
|
|
|
|
|
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
|
|
|
|
{
|
|
|
|
if (rib_cnt[i] > 0)
|
|
|
|
{
|
|
|
|
if (i == ZEBRA_ROUTE_BGP)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", "ebgp",
|
|
|
|
rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP],
|
|
|
|
fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP],
|
|
|
|
VTY_NEWLINE);
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", "ibgp",
|
|
|
|
rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_IBGP],
|
|
|
|
VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", zebra_route_string(i),
|
|
|
|
rib_cnt[i], fib_cnt[i], VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_out (vty, "------%s", VTY_NEWLINE);
|
|
|
|
vty_out (vty, "%-20s %-20d %-20d %s", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL],
|
|
|
|
fib_cnt[ZEBRA_ROUTE_TOTAL], VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Show route summary. */
|
|
|
|
DEFUN (show_ip_route_summary,
|
|
|
|
show_ip_route_summary_cmd,
|
|
|
|
"show ip route summary",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"Summary of all routes\n")
|
|
|
|
{
|
2008-11-05 00:45:07 +01:00
|
|
|
struct route_table *table;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2008-11-05 00:45:07 +01:00
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2008-11-05 00:45:07 +01:00
|
|
|
vty_show_ip_route_summary (vty, table);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-05-20 02:24:41 +02:00
|
|
|
/* Show route summary prefix. */
|
|
|
|
DEFUN (show_ip_route_summary_prefix,
|
|
|
|
show_ip_route_summary_prefix_cmd,
|
|
|
|
"show ip route summary prefix",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
|
|
|
"Summary of all routes\n"
|
|
|
|
"Prefix routes\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
vty_show_ip_route_summary_prefix (vty, table);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Write IPv4 static route configuration. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static int
|
2002-12-13 21:15:29 +01:00
|
|
|
static_config_ipv4 (struct vty *vty)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct static_ipv4 *si;
|
|
|
|
struct route_table *stable;
|
|
|
|
int write;
|
|
|
|
|
|
|
|
write = 0;
|
|
|
|
|
|
|
|
/* Lookup table. */
|
|
|
|
stable = vrf_static_table (AFI_IP, SAFI_UNICAST, 0);
|
|
|
|
if (! stable)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
for (rn = route_top (stable); rn; rn = route_next (rn))
|
|
|
|
for (si = rn->info; si; si = si->next)
|
|
|
|
{
|
2003-07-15 14:52:22 +02:00
|
|
|
vty_out (vty, "ip route %s/%d", inet_ntoa (rn->p.u.prefix4),
|
|
|
|
rn->p.prefixlen);
|
|
|
|
|
|
|
|
switch (si->type)
|
|
|
|
{
|
|
|
|
case STATIC_IPV4_GATEWAY:
|
|
|
|
vty_out (vty, " %s", inet_ntoa (si->gate.ipv4));
|
|
|
|
break;
|
|
|
|
case STATIC_IPV4_IFNAME:
|
|
|
|
vty_out (vty, " %s", si->gate.ifname);
|
|
|
|
break;
|
|
|
|
case STATIC_IPV4_BLACKHOLE:
|
|
|
|
vty_out (vty, " Null0");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* flags are incompatible with STATIC_IPV4_BLACKHOLE */
|
|
|
|
if (si->type != STATIC_IPV4_BLACKHOLE)
|
|
|
|
{
|
|
|
|
if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
|
|
|
|
vty_out (vty, " %s", "reject");
|
|
|
|
|
|
|
|
if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
|
|
|
|
vty_out (vty, " %s", "blackhole");
|
|
|
|
}
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
if (si->tag)
|
|
|
|
vty_out (vty, " tag %d", si->tag);
|
|
|
|
|
2003-07-15 14:52:22 +02:00
|
|
|
if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
|
|
|
|
vty_out (vty, " %d", si->distance);
|
|
|
|
|
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
|
|
|
|
write = 1;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
return write;
|
|
|
|
}
|
2007-05-30 22:10:34 +02:00
|
|
|
|
2012-05-09 13:38:36 +02:00
|
|
|
/*
|
|
|
|
* Show IP mroute command to dump the BGP Multicast
|
|
|
|
* routing table
|
|
|
|
*/
|
|
|
|
DEFUN (show_ip_mroute,
|
|
|
|
show_ip_mroute_cmd,
|
|
|
|
"show ip mroute",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP Multicast routing table\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP, SAFI_MULTICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show all IPv4 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2012-05-09 13:38:36 +02:00
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
|
|
|
vty_out (vty, SHOW_ROUTE_V4_HEADER);
|
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ip_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2014-06-04 06:53:35 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
/* General fucntion for IPv6 static route. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static int
|
2004-10-12 22:50:58 +02:00
|
|
|
static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
|
|
|
|
const char *gate_str, const char *ifname,
|
2015-05-20 02:46:33 +02:00
|
|
|
const char *flag_str, const char *tag_str,
|
|
|
|
const char *distance_str)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
u_char distance;
|
|
|
|
struct prefix p;
|
|
|
|
struct in6_addr *gate = NULL;
|
|
|
|
struct in6_addr gate_addr;
|
|
|
|
u_char type = 0;
|
|
|
|
int table = 0;
|
2003-05-25 21:21:25 +02:00
|
|
|
u_char flag = 0;
|
2015-05-20 02:46:33 +02:00
|
|
|
u_short tag = 0;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
ret = str2prefix (dest_str, &p);
|
|
|
|
if (ret <= 0)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Apply mask for given prefix. */
|
|
|
|
apply_mask (&p);
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
/* Route flags */
|
|
|
|
if (flag_str) {
|
|
|
|
switch(flag_str[0]) {
|
|
|
|
case 'r':
|
|
|
|
case 'R': /* XXX */
|
|
|
|
SET_FLAG (flag, ZEBRA_FLAG_REJECT);
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
case 'B': /* XXX */
|
|
|
|
SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE);
|
2003-05-25 23:35:06 +02:00
|
|
|
return CMD_WARNING;
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Administrative distance. */
|
|
|
|
if (distance_str)
|
|
|
|
distance = atoi (distance_str);
|
|
|
|
else
|
|
|
|
distance = ZEBRA_STATIC_DISTANCE_DEFAULT;
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
/* tag */
|
|
|
|
if (tag_str)
|
|
|
|
tag = atoi(tag_str);
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* When gateway is valid IPv6 addrees, then gate is treated as
|
|
|
|
nexthop address other case gate is treated as interface name. */
|
|
|
|
ret = inet_pton (AF_INET6, gate_str, &gate_addr);
|
|
|
|
|
|
|
|
if (ifname)
|
|
|
|
{
|
|
|
|
/* When ifname is specified. It must be come with gateway
|
|
|
|
address. */
|
|
|
|
if (ret != 1)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
type = STATIC_IPV6_GATEWAY_IFNAME;
|
|
|
|
gate = &gate_addr;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ret == 1)
|
|
|
|
{
|
|
|
|
type = STATIC_IPV6_GATEWAY;
|
|
|
|
gate = &gate_addr;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
type = STATIC_IPV6_IFNAME;
|
|
|
|
ifname = gate_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (add_cmd)
|
2015-05-20 02:46:33 +02:00
|
|
|
static_add_ipv6 (&p, type, gate, ifname, flag, tag, distance, table);
|
2002-12-13 21:15:29 +01:00
|
|
|
else
|
2015-05-20 02:46:33 +02:00
|
|
|
static_delete_ipv6 (&p, type, gate, ifname, tag, distance, table);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route,
|
|
|
|
ipv6_route_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_tag,
|
|
|
|
ipv6_route_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, argv[2], NULL);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_flags,
|
|
|
|
ipv6_route_flags_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_flags_tag,
|
|
|
|
ipv6_route_flags_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname,
|
|
|
|
ipv6_route_ifname_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
DEFUN (ipv6_route_ifname_tag,
|
|
|
|
ipv6_route_ifname_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], NULL);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname_flags,
|
|
|
|
ipv6_route_ifname_flags_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname_flags_tag,
|
|
|
|
ipv6_route_ifname_flags_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_pref,
|
|
|
|
ipv6_route_pref_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_pref_tag,
|
|
|
|
ipv6_route_pref_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, argv[2], argv[3]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_flags_pref,
|
|
|
|
ipv6_route_flags_pref_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_flags_pref_tag,
|
|
|
|
ipv6_route_flags_pref_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], argv[4]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname_pref,
|
|
|
|
ipv6_route_ifname_pref_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname_pref_tag,
|
|
|
|
ipv6_route_ifname_pref_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], argv[4]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname_flags_pref,
|
|
|
|
ipv6_route_ifname_flags_pref_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_route_ifname_flags_pref_tag,
|
|
|
|
ipv6_route_ifname_flags_pref_tag_cmd,
|
|
|
|
"ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route,
|
|
|
|
no_ipv6_route_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_tag,
|
|
|
|
no_ipv6_route_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
ALIAS (no_ipv6_route,
|
|
|
|
no_ipv6_route_flags_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
ALIAS (no_ipv6_route_tag,
|
|
|
|
no_ipv6_route_flags_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_ipv6_route_ifname,
|
|
|
|
no_ipv6_route_ifname_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_ifname_tag,
|
|
|
|
no_ipv6_route_ifname_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
ALIAS (no_ipv6_route_ifname,
|
|
|
|
no_ipv6_route_ifname_flags_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n")
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
ALIAS (no_ipv6_route_ifname_tag,
|
|
|
|
no_ipv6_route_ifname_flags_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n")
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_ipv6_route_pref,
|
|
|
|
no_ipv6_route_pref_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, argv[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_pref_tag,
|
|
|
|
no_ipv6_route_pref_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], argv[3]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_flags_pref,
|
|
|
|
no_ipv6_route_flags_pref_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
/* We do not care about argv[2] */
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_flags_pref_tag,
|
|
|
|
no_ipv6_route_flags_pref_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
/* We do not care about argv[2] */
|
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], argv[4]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_ifname_pref,
|
|
|
|
no_ipv6_route_ifname_pref_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, argv[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_ifname_pref_tag,
|
|
|
|
no_ipv6_route_ifname_pref_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], argv[4]);
|
2003-05-25 21:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_ifname_flags_pref,
|
|
|
|
no_ipv6_route_ifname_flags_pref_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
2015-05-20 02:46:33 +02:00
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_route_ifname_flags_pref_tag,
|
|
|
|
no_ipv6_route_ifname_flags_pref_tag_cmd,
|
|
|
|
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"Establish static routes\n"
|
|
|
|
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
|
|
|
|
"IPv6 gateway address\n"
|
|
|
|
"IPv6 gateway interface name\n"
|
|
|
|
"Emit an ICMP unreachable when matched\n"
|
|
|
|
"Silently discard pkts when matched\n"
|
|
|
|
"Set tag for this route\n"
|
|
|
|
"Tag value\n"
|
|
|
|
"Distance value for this prefix\n")
|
|
|
|
{
|
|
|
|
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2003-05-25 23:35:06 +02:00
|
|
|
/* New RIB. Detailed information for IPv6 route. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static void
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_show_ipv6_route_detail (struct vty *vty, struct route_node *rn)
|
|
|
|
{
|
|
|
|
struct rib *rib;
|
2013-07-05 17:35:37 +02:00
|
|
|
struct nexthop *nexthop, *tnexthop;
|
|
|
|
int recursing;
|
2002-12-13 21:15:29 +01:00
|
|
|
char buf[BUFSIZ];
|
|
|
|
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
vty_out (vty, "Routing entry for %s/%d%s",
|
|
|
|
inet_ntop (AF_INET6, &rn->p.u.prefix6, buf, BUFSIZ),
|
|
|
|
rn->p.prefixlen,
|
|
|
|
VTY_NEWLINE);
|
2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* zebra.h: Declare new functions zebra_route_string() and
zebra_route_char().
* log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New
functions to map zebra route numbers to strings.
* zebra_vty.c: (route_type_str) Remove obsolete function: use new
library function zebra_route_string() instead. Note that there
are a few differences: for IPv6 routes, we now get "ripng" and
"ospf6" instead of the old behavior ("rip" and "ospf").
(route_type_char) Remove obsolete function: ues new library function
zebra_route_char() instead. Note that there is one difference:
the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route,
whereas the new one returns 'X'.
(vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace
route_type_str() with zebra_route_string().
(vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char()
with zebra_route_char().
* bgp_vty.c: (bgp_config_write_redistribute) Use new library function
zebra_route_string instead of a local hard-coded table.
* ospf6_asbr.c: Remove local hard-coded tables zroute_name and
zroute_abname. Change the ZROUTE_NAME macro to use new library
function zebra_route_string(). Remove the ZROUTE_ABNAME macro.
(ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
a call to zebra_route_char(), and be sure to fix the format string,
since we now have a char instead of a char *.
* ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
zebra_route_abname. Note that the zebra_route_name[] table
contained mixed-case strings, whereas the zebra_route_string()
function returns lower-case strings.
(ospf6_zebra_read_ipv6): Change debug message to use new library
function zebra_route_string() instead of zebra_route_name[].
(show_zebra): Use new library function zebra_route_string() instead
of zebra_route_name[].
* ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto.
(ospf_redist_string) New function implemented using new library
function zebra_route_string(). Note that there are a few differences
in the output that will result: the new function returns strings
that are lower-case, whereas the old table was mixed case. Also,
the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the
new function returns "ospf6".
* ospfd.h: Remove extern struct message ospf_redistributed_proto[],
and add extern const char *ospf_redist_string(u_int route_type)
instead.
* ospf_asbr.c: (ospf_external_info_add) In two messages, use
ospf_redist_string instead of LOOKUP(ospf_redistributed_proto).
* ospf_vty.c: Remove local hard-coded table distribute_str.
(config_write_ospf_redistribute,config_write_ospf_distribute): Use
new library function zebra_route_string() instead of distribute_str[].
* ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset,
ospf_redistribute_default_set,ospf_redistribute_check)
In debug messages, use ospf_redist_string() instead of
LOOKUP(ospf_redistributed_proto).
* rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
table str[]. Replace str[] with calls to new library function
zebra_route_string().
* ripd.c: Remove local hard-coded table route_info[].
(show_ip_rip) Replace uses of str[] with calls to new library
functions zebra_route_char and zebra_route_string.
* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
table str[]. Replace str[i] with new library function
zebra_route_string(i).
* ripngd.c: Remove local hard-coded table route_info[].
(show_ipv6_ripng) Use new library function zebra_route_char() instead
of table route_info[].
2005-10-01 19:38:06 +02:00
|
|
|
vty_out (vty, " Known via \"%s\"", zebra_route_string (rib->type));
|
2012-04-13 13:46:07 +02:00
|
|
|
vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
|
2015-05-20 02:46:33 +02:00
|
|
|
if (rib->tag)
|
|
|
|
vty_out (vty, ", tag %d", rib->tag);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
|
|
|
|
vty_out (vty, ", best");
|
|
|
|
if (rib->refcnt)
|
|
|
|
vty_out (vty, ", refcnt %ld", rib->refcnt);
|
2003-05-25 21:21:25 +02:00
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
|
|
|
|
vty_out (vty, ", blackhole");
|
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
|
|
|
|
vty_out (vty, ", reject");
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
|
|
|
|
#define ONE_DAY_SECOND 60*60*24
|
|
|
|
#define ONE_WEEK_SECOND 60*60*24*7
|
|
|
|
if (rib->type == ZEBRA_ROUTE_RIPNG
|
|
|
|
|| rib->type == ZEBRA_ROUTE_OSPF6
|
2012-02-09 13:42:28 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BABEL
|
2003-12-23 09:56:18 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_ISIS
|
2002-12-13 21:15:29 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BGP)
|
|
|
|
{
|
|
|
|
time_t uptime;
|
|
|
|
struct tm *tm;
|
|
|
|
|
|
|
|
uptime = time (NULL);
|
|
|
|
uptime -= rib->uptime;
|
|
|
|
tm = gmtime (&uptime);
|
|
|
|
|
|
|
|
vty_out (vty, " Last update ");
|
|
|
|
|
|
|
|
if (uptime < ONE_DAY_SECOND)
|
|
|
|
vty_out (vty, "%02d:%02d:%02d",
|
|
|
|
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
|
|
else if (uptime < ONE_WEEK_SECOND)
|
|
|
|
vty_out (vty, "%dd%02dh%02dm",
|
|
|
|
tm->tm_yday, tm->tm_hour, tm->tm_min);
|
|
|
|
else
|
|
|
|
vty_out (vty, "%02dw%dd%02dh",
|
|
|
|
tm->tm_yday/7,
|
|
|
|
tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
|
|
|
|
vty_out (vty, " ago%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
|
2013-07-05 17:35:37 +02:00
|
|
|
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2013-07-05 17:35:37 +02:00
|
|
|
vty_out (vty, " %c%s",
|
|
|
|
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) ? '*' : ' ',
|
|
|
|
recursing ? " " : "");
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
switch (nexthop->type)
|
|
|
|
{
|
|
|
|
case NEXTHOP_TYPE_IPV6:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFNAME:
|
|
|
|
vty_out (vty, " %s",
|
|
|
|
inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
|
|
|
|
if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
|
|
|
|
vty_out (vty, ", %s", nexthop->ifname);
|
|
|
|
else if (nexthop->ifindex)
|
|
|
|
vty_out (vty, ", via %s", ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
case NEXTHOP_TYPE_IFINDEX:
|
|
|
|
vty_out (vty, " directly connected, %s",
|
|
|
|
ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
case NEXTHOP_TYPE_IFNAME:
|
|
|
|
vty_out (vty, " directly connected, %s",
|
|
|
|
nexthop->ifname);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
|
|
|
vty_out (vty, " inactive");
|
|
|
|
|
2013-07-05 17:35:39 +02:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ONLINK))
|
|
|
|
vty_out (vty, " onlink");
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
|
2013-07-05 17:35:37 +02:00
|
|
|
vty_out (vty, " (recursive)");
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-28 19:17:12 +02:00
|
|
|
static void
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_show_ipv6_route (struct vty *vty, struct route_node *rn,
|
|
|
|
struct rib *rib)
|
|
|
|
{
|
2013-07-05 17:35:37 +02:00
|
|
|
struct nexthop *nexthop, *tnexthop;
|
|
|
|
int recursing;
|
2002-12-13 21:15:29 +01:00
|
|
|
int len = 0;
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
|
|
|
|
/* Nexthop information. */
|
2013-07-05 17:35:37 +02:00
|
|
|
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
if (nexthop == rib->nexthop)
|
|
|
|
{
|
|
|
|
/* Prefix information. */
|
|
|
|
len = vty_out (vty, "%c%c%c %s/%d",
|
2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* zebra.h: Declare new functions zebra_route_string() and
zebra_route_char().
* log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New
functions to map zebra route numbers to strings.
* zebra_vty.c: (route_type_str) Remove obsolete function: use new
library function zebra_route_string() instead. Note that there
are a few differences: for IPv6 routes, we now get "ripng" and
"ospf6" instead of the old behavior ("rip" and "ospf").
(route_type_char) Remove obsolete function: ues new library function
zebra_route_char() instead. Note that there is one difference:
the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route,
whereas the new one returns 'X'.
(vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace
route_type_str() with zebra_route_string().
(vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char()
with zebra_route_char().
* bgp_vty.c: (bgp_config_write_redistribute) Use new library function
zebra_route_string instead of a local hard-coded table.
* ospf6_asbr.c: Remove local hard-coded tables zroute_name and
zroute_abname. Change the ZROUTE_NAME macro to use new library
function zebra_route_string(). Remove the ZROUTE_ABNAME macro.
(ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
a call to zebra_route_char(), and be sure to fix the format string,
since we now have a char instead of a char *.
* ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
zebra_route_abname. Note that the zebra_route_name[] table
contained mixed-case strings, whereas the zebra_route_string()
function returns lower-case strings.
(ospf6_zebra_read_ipv6): Change debug message to use new library
function zebra_route_string() instead of zebra_route_name[].
(show_zebra): Use new library function zebra_route_string() instead
of zebra_route_name[].
* ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto.
(ospf_redist_string) New function implemented using new library
function zebra_route_string(). Note that there are a few differences
in the output that will result: the new function returns strings
that are lower-case, whereas the old table was mixed case. Also,
the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the
new function returns "ospf6".
* ospfd.h: Remove extern struct message ospf_redistributed_proto[],
and add extern const char *ospf_redist_string(u_int route_type)
instead.
* ospf_asbr.c: (ospf_external_info_add) In two messages, use
ospf_redist_string instead of LOOKUP(ospf_redistributed_proto).
* ospf_vty.c: Remove local hard-coded table distribute_str.
(config_write_ospf_redistribute,config_write_ospf_distribute): Use
new library function zebra_route_string() instead of distribute_str[].
* ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset,
ospf_redistribute_default_set,ospf_redistribute_check)
In debug messages, use ospf_redist_string() instead of
LOOKUP(ospf_redistributed_proto).
* rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
table str[]. Replace str[] with calls to new library function
zebra_route_string().
* ripd.c: Remove local hard-coded table route_info[].
(show_ip_rip) Replace uses of str[] with calls to new library
functions zebra_route_char and zebra_route_string.
* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
table str[]. Replace str[i] with new library function
zebra_route_string(i).
* ripngd.c: Remove local hard-coded table route_info[].
(show_ipv6_ripng) Use new library function zebra_route_char() instead
of table route_info[].
2005-10-01 19:38:06 +02:00
|
|
|
zebra_route_char (rib->type),
|
2002-12-13 21:15:29 +01:00
|
|
|
CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED)
|
|
|
|
? '>' : ' ',
|
|
|
|
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
|
|
|
|
? '*' : ' ',
|
|
|
|
inet_ntop (AF_INET6, &rn->p.u.prefix6, buf, BUFSIZ),
|
|
|
|
rn->p.prefixlen);
|
|
|
|
|
|
|
|
/* Distance and metric display. */
|
|
|
|
if (rib->type != ZEBRA_ROUTE_CONNECT
|
|
|
|
&& rib->type != ZEBRA_ROUTE_KERNEL)
|
|
|
|
len += vty_out (vty, " [%d/%d]", rib->distance,
|
|
|
|
rib->metric);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
vty_out (vty, " %c%*c",
|
|
|
|
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
|
|
|
|
? '*' : ' ',
|
2013-07-05 17:35:37 +02:00
|
|
|
len - 3 + (2 * recursing), ' ');
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
switch (nexthop->type)
|
|
|
|
{
|
|
|
|
case NEXTHOP_TYPE_IPV6:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
|
|
|
case NEXTHOP_TYPE_IPV6_IFNAME:
|
|
|
|
vty_out (vty, " via %s",
|
|
|
|
inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
|
|
|
|
if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
|
|
|
|
vty_out (vty, ", %s", nexthop->ifname);
|
|
|
|
else if (nexthop->ifindex)
|
|
|
|
vty_out (vty, ", %s", ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
case NEXTHOP_TYPE_IFINDEX:
|
|
|
|
vty_out (vty, " is directly connected, %s",
|
|
|
|
ifindex2ifname (nexthop->ifindex));
|
|
|
|
break;
|
|
|
|
case NEXTHOP_TYPE_IFNAME:
|
|
|
|
vty_out (vty, " is directly connected, %s",
|
|
|
|
nexthop->ifname);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
|
|
|
vty_out (vty, " inactive");
|
|
|
|
|
|
|
|
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
|
2013-07-05 17:35:37 +02:00
|
|
|
vty_out (vty, " (recursive)");
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
|
|
|
|
vty_out (vty, ", bh");
|
|
|
|
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
|
|
|
|
vty_out (vty, ", rej");
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (rib->type == ZEBRA_ROUTE_RIPNG
|
|
|
|
|| rib->type == ZEBRA_ROUTE_OSPF6
|
2012-02-09 13:42:28 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BABEL
|
2003-12-23 09:56:18 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_ISIS
|
2002-12-13 21:15:29 +01:00
|
|
|
|| rib->type == ZEBRA_ROUTE_BGP)
|
|
|
|
{
|
|
|
|
time_t uptime;
|
|
|
|
struct tm *tm;
|
|
|
|
|
|
|
|
uptime = time (NULL);
|
|
|
|
uptime -= rib->uptime;
|
|
|
|
tm = gmtime (&uptime);
|
|
|
|
|
|
|
|
#define ONE_DAY_SECOND 60*60*24
|
|
|
|
#define ONE_WEEK_SECOND 60*60*24*7
|
|
|
|
|
|
|
|
if (uptime < ONE_DAY_SECOND)
|
|
|
|
vty_out (vty, ", %02d:%02d:%02d",
|
|
|
|
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
|
|
else if (uptime < ONE_WEEK_SECOND)
|
|
|
|
vty_out (vty, ", %dd%02dh%02dm",
|
|
|
|
tm->tm_yday, tm->tm_hour, tm->tm_min);
|
|
|
|
else
|
|
|
|
vty_out (vty, ", %02dw%dd%02dh",
|
|
|
|
tm->tm_yday/7,
|
|
|
|
tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
|
|
|
|
}
|
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ipv6_route,
|
|
|
|
show_ipv6_route_cmd,
|
|
|
|
"show ipv6 route",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show all IPv6 route. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V6_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ipv6_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
DEFUN (show_ipv6_route_tag,
|
|
|
|
show_ipv6_route_tag_cmd,
|
|
|
|
"show ipv6 route tag <1-65535>",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n"
|
|
|
|
"Show only routes with tag\n"
|
|
|
|
"Tag value\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
u_short tag = 0;
|
|
|
|
|
|
|
|
if (argv[0])
|
|
|
|
tag = atoi(argv[0]);
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show all IPv6 routes with matching tag value. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
|
|
|
{
|
|
|
|
if (rib->tag != tag)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (first)
|
|
|
|
{
|
|
|
|
vty_out (vty, SHOW_ROUTE_V6_HEADER);
|
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ipv6_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (show_ipv6_route_prefix_longer,
|
|
|
|
show_ipv6_route_prefix_longer_cmd,
|
|
|
|
"show ipv6 route X:X::X:X/M longer-prefixes",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n"
|
|
|
|
"IPv6 prefix\n"
|
|
|
|
"Show route matching the specified Network/Mask pair only\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
struct prefix p;
|
|
|
|
int ret;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
ret = str2prefix (argv[0], &p);
|
|
|
|
if (! ret)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Show matched type IPv6 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
if (prefix_match (&p, &rn->p))
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V6_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ipv6_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ipv6_route_protocol,
|
|
|
|
show_ipv6_route_protocol_cmd,
|
2009-09-16 01:52:42 +02:00
|
|
|
"show ipv6 route " QUAGGA_IP6_REDIST_STR_ZEBRA,
|
2002-12-13 21:15:29 +01:00
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IP routing table\n"
|
2009-09-16 01:52:42 +02:00
|
|
|
QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
|
2009-09-16 01:52:42 +02:00
|
|
|
type = proto_redistnum (AFI_IP6, argv[0]);
|
|
|
|
if (type < 0)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show matched type IPv6 routes. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2002-12-13 21:15:29 +01:00
|
|
|
if (rib->type == type)
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2009-09-16 01:52:42 +02:00
|
|
|
vty_out (vty, SHOW_ROUTE_V6_HEADER);
|
2002-12-13 21:15:29 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ipv6_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ipv6_route_addr,
|
|
|
|
show_ipv6_route_addr_cmd,
|
|
|
|
"show ipv6 route X:X::X:X",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n"
|
|
|
|
"IPv6 Address\n")
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
struct prefix_ipv6 p;
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
|
|
|
|
ret = str2prefix_ipv6 (argv[0], &p);
|
|
|
|
if (ret <= 0)
|
|
|
|
{
|
|
|
|
vty_out (vty, "Malformed IPv6 address%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
rn = route_node_match (table, (struct prefix *) &p);
|
|
|
|
if (! rn)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_show_ipv6_route_detail (vty, rn);
|
|
|
|
|
|
|
|
route_unlock_node (rn);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_ipv6_route_prefix,
|
|
|
|
show_ipv6_route_prefix_cmd,
|
|
|
|
"show ipv6 route X:X::X:X/M",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n"
|
|
|
|
"IPv6 prefix\n")
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
struct prefix_ipv6 p;
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
|
|
|
|
ret = str2prefix_ipv6 (argv[0], &p);
|
|
|
|
if (ret <= 0)
|
|
|
|
{
|
|
|
|
vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
rn = route_node_match (table, (struct prefix *) &p);
|
|
|
|
if (! rn || rn->p.prefixlen != p.prefixlen)
|
|
|
|
{
|
|
|
|
vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
vty_show_ipv6_route_detail (vty, rn);
|
|
|
|
|
|
|
|
route_unlock_node (rn);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2008-11-05 00:45:07 +01:00
|
|
|
/* Show route summary. */
|
|
|
|
DEFUN (show_ipv6_route_summary,
|
|
|
|
show_ipv6_route_summary_cmd,
|
|
|
|
"show ipv6 route summary",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n"
|
|
|
|
"Summary of all IPv6 routes\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
vty_show_ip_route_summary (vty, table);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-05-20 02:24:41 +02:00
|
|
|
/* Show ipv6 route summary prefix. */
|
|
|
|
DEFUN (show_ipv6_route_summary_prefix,
|
|
|
|
show_ipv6_route_summary_prefix_cmd,
|
|
|
|
"show ipv6 route summary prefix",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 routing table\n"
|
|
|
|
"Summary of all IPv6 routes\n"
|
|
|
|
"Prefix routes\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
vty_show_ip_route_summary_prefix (vty, table);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2011-11-26 18:59:32 +01:00
|
|
|
/*
|
|
|
|
* Show IPv6 mroute command.Used to dump
|
|
|
|
* the Multicast routing table.
|
|
|
|
*/
|
|
|
|
|
|
|
|
DEFUN (show_ipv6_mroute,
|
|
|
|
show_ipv6_mroute_cmd,
|
|
|
|
"show ipv6 mroute",
|
|
|
|
SHOW_STR
|
|
|
|
IP_STR
|
|
|
|
"IPv6 Multicast routing table\n")
|
|
|
|
{
|
|
|
|
struct route_table *table;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct rib *rib;
|
|
|
|
int first = 1;
|
|
|
|
|
|
|
|
table = vrf_table (AFI_IP6, SAFI_MULTICAST, 0);
|
|
|
|
if (! table)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
/* Show all IPv6 route. */
|
|
|
|
for (rn = route_top (table); rn; rn = route_next (rn))
|
2012-11-13 23:48:53 +01:00
|
|
|
RNODE_FOREACH_RIB (rn, rib)
|
2011-11-26 18:59:32 +01:00
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
2011-11-27 15:39:40 +01:00
|
|
|
vty_out (vty, SHOW_ROUTE_V6_HEADER);
|
2011-11-26 18:59:32 +01:00
|
|
|
first = 0;
|
|
|
|
}
|
|
|
|
vty_show_ipv6_route (vty, rn, rib);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Write IPv6 static route configuration. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static int
|
2002-12-13 21:15:29 +01:00
|
|
|
static_config_ipv6 (struct vty *vty)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct static_ipv6 *si;
|
|
|
|
int write;
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
struct route_table *stable;
|
|
|
|
|
|
|
|
write = 0;
|
|
|
|
|
|
|
|
/* Lookup table. */
|
|
|
|
stable = vrf_static_table (AFI_IP6, SAFI_UNICAST, 0);
|
|
|
|
if (! stable)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
for (rn = route_top (stable); rn; rn = route_next (rn))
|
|
|
|
for (si = rn->info; si; si = si->next)
|
|
|
|
{
|
|
|
|
vty_out (vty, "ipv6 route %s/%d",
|
|
|
|
inet_ntop (AF_INET6, &rn->p.u.prefix6, buf, BUFSIZ),
|
|
|
|
rn->p.prefixlen);
|
|
|
|
|
|
|
|
switch (si->type)
|
|
|
|
{
|
|
|
|
case STATIC_IPV6_GATEWAY:
|
|
|
|
vty_out (vty, " %s", inet_ntop (AF_INET6, &si->ipv6, buf, BUFSIZ));
|
|
|
|
break;
|
|
|
|
case STATIC_IPV6_IFNAME:
|
|
|
|
vty_out (vty, " %s", si->ifname);
|
|
|
|
break;
|
|
|
|
case STATIC_IPV6_GATEWAY_IFNAME:
|
|
|
|
vty_out (vty, " %s %s",
|
|
|
|
inet_ntop (AF_INET6, &si->ipv6, buf, BUFSIZ), si->ifname);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-05-25 21:21:25 +02:00
|
|
|
if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
|
|
|
|
vty_out (vty, " %s", "reject");
|
|
|
|
|
|
|
|
if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
|
|
|
|
vty_out (vty, " %s", "blackhole");
|
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
if (si->tag)
|
|
|
|
vty_out (vty, " tag %d", si->tag);
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
|
|
|
|
vty_out (vty, " %d", si->distance);
|
|
|
|
vty_out (vty, "%s", VTY_NEWLINE);
|
|
|
|
|
|
|
|
write = 1;
|
|
|
|
}
|
|
|
|
return write;
|
|
|
|
}
|
|
|
|
#endif /* HAVE_IPV6 */
|
|
|
|
|
|
|
|
/* Static ip route configuration write function. */
|
2005-06-28 19:17:12 +02:00
|
|
|
static int
|
2002-12-13 21:15:29 +01:00
|
|
|
zebra_ip_config (struct vty *vty)
|
|
|
|
{
|
|
|
|
int write = 0;
|
|
|
|
|
|
|
|
write += static_config_ipv4 (vty);
|
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
write += static_config_ipv6 (vty);
|
|
|
|
#endif /* HAVE_IPV6 */
|
|
|
|
|
2015-05-20 03:03:42 +02:00
|
|
|
write += zebra_import_table_config (vty);
|
2002-12-13 21:15:29 +01:00
|
|
|
return write;
|
|
|
|
}
|
|
|
|
|
2015-05-20 03:03:42 +02:00
|
|
|
DEFUN (ip_zebra_import_table_distance,
|
|
|
|
ip_zebra_import_table_distance_cmd,
|
|
|
|
"ip import-table <1-252> distance <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"import routes from non-main kernel table\n"
|
|
|
|
"kernel routing table id\n"
|
|
|
|
"Distance for imported routes\n"
|
|
|
|
"Default distance value\n")
|
|
|
|
{
|
|
|
|
u_int32_t table_id = 0;
|
|
|
|
int distance = ZEBRA_TABLE_DISTANCE_DEFAULT;
|
|
|
|
|
|
|
|
if (argc)
|
|
|
|
VTY_GET_INTEGER("table", table_id, argv[0]);
|
|
|
|
|
|
|
|
if (!is_zebra_valid_kernel_table(table_id))
|
|
|
|
{
|
|
|
|
vty_out(vty, "Invalid routing table ID, %d. Must be in range 1-252%s",
|
|
|
|
table_id, VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_zebra_main_routing_table(table_id))
|
|
|
|
{
|
|
|
|
vty_out(vty, "Invalid routing table ID, %d. Must be non-default table%s",
|
|
|
|
table_id, VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_zebra_import_table_enabled(AFI_IP, table_id))
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
if (argc > 1)
|
|
|
|
VTY_GET_INTEGER_RANGE("distance", distance, argv[1], 1, 255);
|
|
|
|
|
|
|
|
return (zebra_import_table(AFI_IP, table_id, distance, 1));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ALIAS (ip_zebra_import_table_distance,
|
|
|
|
ip_zebra_import_table_cmd,
|
|
|
|
"ip import-table <1-252>",
|
|
|
|
IP_STR
|
|
|
|
"import routes from non-main kernel table\n"
|
|
|
|
"kernel routing table id\n")
|
|
|
|
|
|
|
|
DEFUN (no_ip_zebra_import_table,
|
|
|
|
no_ip_zebra_import_table_cmd,
|
|
|
|
"no ip import-table <1-252>",
|
|
|
|
NO_STR
|
|
|
|
IP_STR
|
|
|
|
"import routes from non-main kernel table\n"
|
|
|
|
"kernel routing table id\n")
|
|
|
|
{
|
|
|
|
u_int32_t table_id = 0;
|
|
|
|
|
|
|
|
if (argc)
|
|
|
|
VTY_GET_INTEGER("table", table_id, argv[0]);
|
|
|
|
|
|
|
|
if (!is_zebra_valid_kernel_table(table_id))
|
|
|
|
{
|
|
|
|
vty_out(vty, "Invalid routing table ID. Must be in range 1-252%s",
|
|
|
|
VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_zebra_main_routing_table(table_id))
|
|
|
|
{
|
|
|
|
vty_out(vty, "Invalid routing table ID, %d. Must be non-default table%s",
|
|
|
|
table_id, VTY_NEWLINE);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_zebra_import_table_enabled(AFI_IP, table_id))
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
|
|
|
return (zebra_import_table(AFI_IP, table_id, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
ALIAS (no_ip_zebra_import_table,
|
|
|
|
no_ip_zebra_import_table_distance_cmd,
|
|
|
|
"no ip import-table <1-252> distance <1-255>",
|
|
|
|
IP_STR
|
|
|
|
"import routes from non-main kernel table to main table"
|
|
|
|
"kernel routing table id\n"
|
|
|
|
"distance to be used\n")
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* IP node for static routes. */
|
2008-12-01 20:10:34 +01:00
|
|
|
static struct cmd_node ip_node = { IP_NODE, "", 1 };
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Route VTY. */
|
|
|
|
void
|
2005-06-28 19:17:12 +02:00
|
|
|
zebra_vty_init (void)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
install_node (&ip_node, zebra_ip_config);
|
|
|
|
|
|
|
|
install_element (CONFIG_NODE, &ip_route_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_tag_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags_tag_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags2_tag_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_tag_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags_tag_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags2_tag_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_tag_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags_tag_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags2_tag_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_tag_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags2_tag_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &ip_route_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_tag_distance_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags_tag_distance_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags_distance2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_flags_tag_distance2_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_tag_distance_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags_distance2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance2_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_tag_distance_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags_distance2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance2_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_distance_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_tag_distance_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance_cmd);
|
2003-05-28 14:02:15 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance2_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance2_cmd);
|
2015-05-20 03:03:42 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_zebra_import_table_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ip_zebra_import_table_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ip_zebra_import_table_distance_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
install_element (VIEW_NODE, &show_ip_route_cmd);
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
install_element (VIEW_NODE, &show_ip_route_ospf_instance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (VIEW_NODE, &show_ip_route_tag_cmd);
|
2015-05-20 02:40:34 +02:00
|
|
|
install_element (VIEW_NODE, &show_ip_nht_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ipv6_nht_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (VIEW_NODE, &show_ip_route_addr_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ip_route_prefix_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ip_route_prefix_longer_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ip_route_protocol_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ip_route_supernets_cmd);
|
2008-11-05 00:45:07 +01:00
|
|
|
install_element (VIEW_NODE, &show_ip_route_summary_cmd);
|
2015-05-20 02:24:41 +02:00
|
|
|
install_element (VIEW_NODE, &show_ip_route_summary_prefix_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (ENABLE_NODE, &show_ip_route_cmd);
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
install_element (ENABLE_NODE, &show_ip_route_ospf_instance_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (ENABLE_NODE, &show_ip_route_tag_cmd);
|
2015-05-20 02:40:34 +02:00
|
|
|
install_element (ENABLE_NODE, &show_ip_nht_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ipv6_nht_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (ENABLE_NODE, &show_ip_route_addr_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ip_route_prefix_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ip_route_prefix_longer_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ip_route_protocol_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ip_route_supernets_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ip_route_summary_cmd);
|
2015-05-20 02:24:41 +02:00
|
|
|
install_element (ENABLE_NODE, &show_ip_route_summary_prefix_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2011-11-26 18:59:32 +01:00
|
|
|
install_element (VIEW_NODE, &show_ip_mroute_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ip_mroute_cmd);
|
|
|
|
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_flags_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_flags_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_flags_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_pref_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_flags_pref_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_pref_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_pref_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_cmd);
|
2003-05-25 21:21:25 +02:00
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (CONFIG_NODE, &ipv6_route_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_flags_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_flags_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_flags_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_flags_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_tag_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_tag_cmd);
|
2015-05-20 03:04:16 +02:00
|
|
|
install_element (CONFIG_NODE, &ip_nht_default_route_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ip_nht_default_route_cmd);
|
|
|
|
install_element (CONFIG_NODE, &ipv6_nht_default_route_cmd);
|
|
|
|
install_element (CONFIG_NODE, &no_ipv6_nht_default_route_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_tag_cmd);
|
2008-11-05 00:45:07 +01:00
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_summary_cmd);
|
2015-05-20 02:24:41 +02:00
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_summary_prefix_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_protocol_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_addr_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_prefix_cmd);
|
|
|
|
install_element (VIEW_NODE, &show_ipv6_route_prefix_longer_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_cmd);
|
2015-05-20 02:46:33 +02:00
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_tag_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_protocol_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_addr_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_prefix_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_prefix_longer_cmd);
|
2008-11-05 00:45:07 +01:00
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_summary_cmd);
|
2015-05-20 02:24:41 +02:00
|
|
|
install_element (ENABLE_NODE, &show_ipv6_route_summary_prefix_cmd);
|
2011-11-26 18:59:32 +01:00
|
|
|
|
|
|
|
install_element (VIEW_NODE, &show_ipv6_mroute_cmd);
|
|
|
|
install_element (ENABLE_NODE, &show_ipv6_mroute_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_IPV6 */
|
|
|
|
}
|