bug-zebra
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"ip forwarding" command.


From: Jim Crumpler
Subject: "ip forwarding" command.
Date: Tue, 11 Jun 2002 06:12:47 +1000

Hi, there is a command for "no ip forwarding", but the "ip forwarding"
command seems missing..  Here's a preliminary patch..

I noticed these commands don't "stick" in the config.. Do they need to be
moved to rib.c where the install_node is for ip?

One last comment - would it not be better to replace "[no] ip forwarding"
with the Cisco style "[no] ip routing"?

Jim..


Index: zserv.c
===================================================================
RCS file: /cvsroot/zebra/zebra/zserv.c,v
retrieving revision 1.53
diff -c -r1.53 zserv.c
*** zserv.c     27 Aug 2001 08:59:37 -0000      1.53
--- zserv.c     10 Jun 2002 20:12:00 -0000
***************
*** 1602,1607 ****
--- 1602,1633 ----
    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",
***************
*** 1763,1768 ****
--- 1789,1795 ----

    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);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]