This patch adds default configs for quagga daemons. It adds password zebra
and restricts vty access to everyone except localhost. If these confs do not 
exist the daemons do not start when running quagga init script.

diff --git a/packages/net/quagga/Makefile b/packages/net/quagga/Makefile
index 4864f57..1346b10 100644
--- a/packages/net/quagga/Makefile
+++ b/packages/net/quagga/Makefile
@@ -120,6 +120,7 @@ define Package/quagga/install
        # avoid /etc being set to 0750
        $(INSTALL_DIR) $(1)/etc/quagga/
        chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
        $(INSTALL_DIR) $(1)/etc/init.d/
        $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
        $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
@@ -177,31 +178,49 @@ endef
 define Package/quagga-bgpd/install     
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/quagga/
+       chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
 endef
 
 define Package/quagga-isisd/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/quagga/
+       chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
 endef
 
 define Package/quagga-ospfd/install    
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/quagga/
+       chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
 endef
 
 define Package/quagga-ospf6d/install   
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/quagga/
+       chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
 endef
 
 define Package/quagga-ripd/install     
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/quagga/
+       chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
 endef
 
 define Package/quagga-ripngd/install   
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/quagga/
+       chmod 0750 $(1)/etc/quagga/
+       $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
 endef
 
 define Package/quagga-vtysh/install    
diff --git a/packages/net/quagga/files/quagga.conf 
b/packages/net/quagga/files/quagga.conf
new file mode 100644
index 0000000..e847c5a
--- /dev/null
+++ b/packages/net/quagga/files/quagga.conf
@@ -0,0 +1,6 @@
+password zebra
+!
+access-list vty permit 127.0.0.0/8
+!
+line vty
+ access-class vty
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to