Add ebuild for FRRouting - Quagga fork with some additional features

This commit is contained in:
2017-09-14 16:44:00 +03:00
parent 40a44fe1d7
commit 515e475c99
17 changed files with 431 additions and 0 deletions

View File

@ -0,0 +1,22 @@
Fix for missing definitions on some Hardened configurations
Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=437292
diff -Naur quagga-0.99.16.orig/zebra/ipforward_sysctl.c quagga-0.99.16/zebra/ipforward_sysctl.c
--- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-03-11 12:11:32.000000000 -0500
+++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-03-11 12:11:39.000000000 -0500
@@ -31,6 +31,15 @@
#define MIB_SIZ 4
+/* Fix for recent (2.6.14) kernel headers */
+#ifndef IPCTL_FORWARDING
+ #define IPCTL_FORWARDING NET_IPV4_FORWARD
+#endif
+
+#ifndef IP6CTL_FORWARDING
+ #define IP6CTL_FORWARDING NET_IPV6_FORWARDING
+#endif
+
extern struct zebra_privs_t zserv_privs;
/* IPv4 forwarding control MIB. */

View File

@ -0,0 +1,43 @@
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
: ${CFGFILE:=/etc/frr/${SVCNAME}.conf}
pidfile=/run/frr/${SVCNAME}.pid
command=/usr/sbin/${SVCNAME}
command_args="-d -f ${CFGFILE} ${EXTRA_OPTS} --pid_file ${pidfile}"
get_service_config() {
[ -e "$CFGFILE" ] || return
awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
}
depend() {
config "$CFGFILE"
[ ${SVCNAME} = "zebra" ] && need net || need zebra
[ "$(get_service_config log)" = "syslog" ] && \
use logger
}
start_pre() {
if [ ! -e "${CFGFILE}" ] ; then
eerror "Before starting ${SVCNAME} you have to configure it, by creating"
eerror "a ${CFGFILE} file."
eerror ""
eerror "A sample file has been installed in `echo /usr/share/doc/frr-*/samples/${SVCNAME}.conf.sample*`"
return 1
fi
checkpath -d -m 0750 -o quagga:quagga /run/frr
if [ ${SVCNAME} = "zebra" ]; then
ebegin "Cleaning up stale zebra routes..."
ip route flush proto zebra
eend $?
fi
}

View File

@ -0,0 +1,26 @@
#%PAM-1.0
#
##### if running frr as root:
# Only allow root (and possibly wheel) to use this because enable access
# is unrestricted.
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
###########################################################
# If using frr privileges and with a seperate group for vty access, then
# access can be controlled via the vty access group, and pam can simply
# check for valid user/password, eg:
#
# only allow local users.
#auth required pam_securetty.so
#auth include system-auth
#auth required pam_nologin.so
#account include system-auth
#password include system-auth
#session include system-auth
#session optional pam_console.so

View File

@ -0,0 +1,16 @@
[Unit]
Description=BGP routing daemon
Documentation=man:bgpd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/bgpd.conf
[Service]
Type=forking
PIDFile=/run/frr/bgpd.pid
ExecStart=/usr/sbin/bgpd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /run/frr 0750 quagga quagga

View File

@ -0,0 +1,16 @@
[Unit]
Description=IS-IS routing daemon
Documentation=man:isis(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/isisd.conf
[Service]
Type=forking
PIDFile=/run/frr/isisd.pid
ExecStart=/usr/sbin/isisd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=LDP daemon
Documentation=man:ldpd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/ldpd.conf
[Service]
Type=forking
PIDFile=/run/frr/ldpd.pid
ExecStart=/usr/sbin/ldpd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=NHRP daemon
Documentation=man:nhrpd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/nhrpd.conf
[Service]
Type=forking
PIDFile=/run/frr/nhrpd.pid
ExecStart=/usr/sbin/nhrpd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=OSPF routing daemon for IPv6
Documentation=man:ospfd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/ospf6d.conf
[Service]
Type=forking
PIDFile=/run/frr/ospf6d.pid
ExecStart=/usr/sbin/ospf6d -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=OSPF routing daemon
Documentation=man:ospfd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/ospfd.conf
[Service]
Type=forking
PIDFile=/run/frr/ospfd.pid
ExecStart=/usr/sbin/ospfd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,17 @@
[Unit]
Description=PIM-SSM routing daemon
Documentation=man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/pimd.conf
[Service]
Type=forking
PIDFile=/run/frr/pimd.pid
ExecStart=/usr/sbin/pimd -d
ExecReload=/bin/kill -HUP $MAINPID
SuccessExitStatus=1
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=RIP routing daemon
Documentation=man:ripd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/ripd.conf
[Service]
Type=forking
PIDFile=/run/frr/ripd.pid
ExecStart=/usr/sbin/ripd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=RIP routing daemon for IPv6
Documentation=man:ripngd(8) man:zebra(8)
BindsTo=zebra.service
After=network.target zebra.service
ConditionPathExists=/etc/frr/ripngd.conf
[Service]
Type=forking
PIDFile=/run/frr/ripngd.pid
ExecStart=/usr/sbin/ripngd -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=GNU Zebra routing manager
Documentation=man:zebra(8)
After=network.target
ConditionPathExists=/etc/frr/zebra.conf
[Service]
Type=forking
PIDFile=/run/frr/zebra.pid
ExecStartPre=/bin/ip route flush proto zebra
ExecStart=/usr/sbin/zebra -d
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
[Install]
WantedBy=multi-user.target