summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.c
diff options
context:
space:
mode:
authorhasso <hasso>2003-05-25 11:43:52 +0000
committerhasso <hasso>2003-05-25 11:43:52 +0000
commitbf1ac7e300f2b6fc547f1f701077ac5e7fb36adf (patch)
tree03ad9f1a4517a71d7f2625eac4c310d1756048a6 /zebra/zserv.c
parente813cd021a3b8947492609fd34fd2b23047e71a8 (diff)
downloadquagga-bf1ac7e300f2b6fc547f1f701077ac5e7fb36adf.tar.bz2
quagga-bf1ac7e300f2b6fc547f1f701077ac5e7fb36adf.tar.xz
"ip forwarding" command. Patch from Jim Crumpler.
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index e27db449..61b1cc8a 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1748,6 +1748,32 @@ DEFUN (config_table,
return CMD_SUCCESS;
}
+DEFUN (ip_forwarding,
+ ip_forwarding_cmd,
+ "ip forwarding",
+ IP_STR
+ "Turn on IP forwarding")
+{
+ int ret;
+
+ ret = ipforward ();
+
+ if (ret != 0)
+ {
+ vty_out (vty, "IP forwarding is already on%s", VTY_NEWLINE);
+ return CMD_ERR_NOTHING_TODO;
+ }
+
+ ret = ipforward_on ();
+ if (ret == 0)
+ {
+ vty_out (vty, "Can't turn on IP forwarding%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN (no_ip_forwarding,
no_ip_forwarding_cmd,
"no ip forwarding",
@@ -1932,6 +1958,7 @@ zebra_init ()
install_element (VIEW_NODE, &show_ip_forwarding_cmd);
install_element (ENABLE_NODE, &show_ip_forwarding_cmd);
+ install_element (CONFIG_NODE, &ip_forwarding_cmd);
install_element (CONFIG_NODE, &no_ip_forwarding_cmd);
install_element (ENABLE_NODE, &show_zebra_client_cmd);