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 /lib/if.c | |
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 'lib/if.c')
-rw-r--r-- | lib/if.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -712,6 +712,9 @@ DEFUN (interface, return CMD_WARNING; } + if (argc > 1) + VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]); + #ifdef SUNOS_5 ifp = if_sunwzebra_get (argv[0], sl, vrf_id); #else @@ -724,6 +727,13 @@ DEFUN (interface, return CMD_SUCCESS; } +ALIAS (interface, + interface_vrf_cmd, + "interface IFNAME " VRF_CMD_STR, + "Select an interface to configure\n" + "Interface's name\n" + VRF_CMD_HELP_STR) + DEFUN_NOSH (no_interface, no_interface_cmd, "no interface IFNAME", @@ -735,6 +745,9 @@ DEFUN_NOSH (no_interface, struct interface *ifp; vrf_id_t vrf_id = VRF_DEFAULT; + if (argc > 1) + VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]); + ifp = if_lookup_by_name_vrf (argv[0], vrf_id); if (ifp == NULL) @@ -755,6 +768,14 @@ DEFUN_NOSH (no_interface, return CMD_SUCCESS; } +ALIAS (no_interface, + 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) + /* For debug purpose. */ DEFUN (show_address, show_address_cmd, |