diff options
author | Feng Lu <lu.feng@6wind.com> | 2015-05-22 11:40:00 +0200 |
---|---|---|
committer | Vipin Kumar <vipin@cumulusnetworks.com> | 2015-10-30 02:08:53 +0100 |
commit | cd2a8a42e10a81f84b8c4dd061f1125b06b06bc5 (patch) | |
tree | 7c1990f9bfc610b63679d3192b0420c70dd5b6b8 /vtysh | |
parent | lib: move the interface list into "struct vrf" (diff) | |
download | frr-cd2a8a42e10a81f84b8c4dd061f1125b06b06bc5.tar.xz frr-cd2a8a42e10a81f84b8c4dd061f1125b06b06bc5.zip |
lib, zebra, vtysh: configure an interface in non-default VRF
Introduce a new command "interface IFNAME vrf N" to configure an
interface in the non-default VRF.
Till now, only zebra uses this command. Other daemons will install
the command when they support multiple VRFs.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Conflicts:
zebra/interface.c
Diffstat (limited to 'vtysh')
-rwxr-xr-x | vtysh/extract.pl.in | 1 | ||||
-rw-r--r-- | vtysh/vtysh.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in index 2249b4092..56e711592 100755 --- a/vtysh/extract.pl.in +++ b/vtysh/extract.pl.in @@ -31,6 +31,7 @@ print <<EOF; EOF $ignore{'"interface IFNAME"'} = "ignore"; +$ignore{'"interface IFNAME " "vrf <0-65535>"'} = "ignore"; $ignore{'"ip vrf NAME"'} = "ignore"; $ignore{'"router rip"'} = "ignore"; $ignore{'"router ripng"'} = "ignore"; diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 54e3e4f6c..58014c2e0 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -39,6 +39,7 @@ #include "vtysh/vtysh.h" #include "log.h" #include "bgpd/bgp_vty.h" +#include "vrf.h" /* Struct VTY. */ struct vty *vty; @@ -1498,6 +1499,14 @@ DEFUNSH (VTYSH_INTERFACE, return CMD_SUCCESS; } +ALIAS_SH (VTYSH_ZEBRA, + vtysh_interface, + vtysh_interface_vrf_cmd, + "interface IFNAME " VRF_CMD_STR, + "Select an interface to configure\n" + "Interface's name\n" + VRF_CMD_HELP_STR) + /* TODO Implement "no interface command in isisd. */ DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D, vtysh_no_interface_cmd, @@ -1506,6 +1515,14 @@ DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D, "Delete a pseudo interface's configuration\n" "Interface's name\n") +DEFSH (VTYSH_ZEBRA, + vtysh_no_interface_vrf_cmd, + "no interface IFNAME " VRF_CMD_STR, + NO_STR + "Delete a pseudo interface's configuration\n" + "Interface's name\n" + VRF_CMD_HELP_STR) + /* TODO Implement interface description commands in ripngd, ospf6d * and isisd. */ DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD, @@ -2823,6 +2840,8 @@ vtysh_init_vty (void) install_element (KEYCHAIN_KEY_NODE, &key_chain_cmd); install_element (CONFIG_NODE, &vtysh_interface_cmd); install_element (CONFIG_NODE, &vtysh_no_interface_cmd); + install_element (CONFIG_NODE, &vtysh_interface_vrf_cmd); + install_element (CONFIG_NODE, &vtysh_no_interface_vrf_cmd); install_element (ENABLE_NODE, &vtysh_show_running_config_cmd); install_element (ENABLE_NODE, &vtysh_show_running_config_daemon_cmd); install_element (ENABLE_NODE, &vtysh_copy_runningconfig_startupconfig_cmd); |