diff options
-rw-r--r-- | bgpd/bgp_updgrp_packet.c | 4 | ||||
-rw-r--r-- | doc/Building_FRR_on_CentOS6.md | 160 | ||||
-rw-r--r-- | doc/Building_FRR_on_CentOS7.md | 123 | ||||
-rw-r--r-- | doc/Building_FRR_on_Debian8.md | 98 | ||||
-rw-r--r-- | doc/Building_FRR_on_Fedora24.md | 134 | ||||
-rw-r--r-- | doc/Building_FRR_on_FreeBSD10.md | 96 | ||||
-rw-r--r-- | doc/Building_FRR_on_FreeBSD11.md | 96 | ||||
-rw-r--r-- | doc/Building_FRR_on_FreeBSD9.md | 96 | ||||
-rw-r--r-- | doc/Building_FRR_on_NetBSD6.md | 117 | ||||
-rw-r--r-- | doc/Building_FRR_on_NetBSD7.md | 110 | ||||
-rw-r--r-- | doc/Building_FRR_on_OmniOS.md | 124 | ||||
-rw-r--r-- | doc/Building_FRR_on_OpenBSD6.md | 129 | ||||
-rw-r--r-- | doc/Building_FRR_on_Ubuntu1204.md | 136 | ||||
-rw-r--r-- | doc/Building_FRR_on_Ubuntu1404.md | 94 | ||||
-rw-r--r-- | doc/Building_FRR_on_Ubuntu1604.md | 116 | ||||
-rw-r--r-- | isisd/dict.c | 1 | ||||
-rw-r--r-- | isisd/isis_circuit.c | 4 | ||||
-rw-r--r-- | isisd/isis_lsp.c | 3 | ||||
-rw-r--r-- | isisd/isis_pdu.c | 4 | ||||
-rw-r--r-- | isisd/isis_route.c | 6 | ||||
-rw-r--r-- | isisd/isis_te.c | 17 | ||||
-rw-r--r-- | lib/log.c | 1 | ||||
-rw-r--r-- | ospfd/ospf_main.c | 4 | ||||
-rw-r--r-- | vtysh/vtysh.c | 2 | ||||
-rw-r--r-- | zebra/zserv.c | 2 |
25 files changed, 1655 insertions, 22 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 02979602b..8839de391 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -547,7 +547,7 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf) } if (gnh_modified) - stream_put_in6_addr_at (s, vec->offset + 1 + (nhlen-IPV6_MAX_BYTELEN), mod_v6nhg); + stream_put_in6_addr_at (s, vec->offset + 1, mod_v6nhg); if (lnh_modified) stream_put_in6_addr_at (s, vec->offset + 1 + (nhlen-IPV6_MAX_BYTELEN), mod_v6nhl); @@ -621,6 +621,8 @@ bgp_info_addpath_tx_str (int addpath_encode, u_int32_t addpath_tx_id, buf[0] = '\0'; if (addpath_encode) sprintf(buf, " with addpath ID %d", addpath_tx_id); + else + buf[0] = '\0'; } /* Make BGP update packet. */ diff --git a/doc/Building_FRR_on_CentOS6.md b/doc/Building_FRR_on_CentOS6.md new file mode 100644 index 000000000..ccb07fb2a --- /dev/null +++ b/doc/Building_FRR_on_CentOS6.md @@ -0,0 +1,160 @@ +Building FRR on CentOS 6 from Git Source +======================================== + +Instructions are tested with `CentOS 6.8` on `x86_64` platform + +CentOS 6 restrictions: +---------------------- + +- PIMd is not supported on `CentOS 6`. Upgrade to `CentOS 7` if PIMd is + needed +- MPLS is not supported on `CentOS 6`. MPLS requires Linux Kernel 4.5 or + higher (LDP can be built, but may have limited use without MPLS) + +Install required packages +------------------------- + +Add packages: + + sudo yum install git autoconf automake libtool make gawk readline-devel \ + texinfo net-snmp-devel groff pkgconfig json-c-devel pam-devel \ + flex pytest + +Install newer version of bison (CentOS 6 package source is too old) from +CentOS 7 + + curl -O http://vault.centos.org/7.0.1406/os/Source/SPackages/bison-2.7-4.el7.src.rpm + rpmbuild --rebuild ./bison-2.7-4.el7.src.rpm + sudo yum install ./rpmbuild/RPMS/x86_64/bison-2.7-4.el6.x86_64.rpm + rm -rf rpmbuild + +Install newer version of autoconf and automake (Package versions are too old) + + curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz + tar xvf autoconf-2.69.tar.gz + cd autoconf-2.69 + ./configure --prefix=/usr + make + sudo make install + cd .. + + curl -O http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz + tar xvf automake-1.15.tar.gz + cd automake-1.15 + ./configure --prefix=/usr + make + sudo make install + cd .. + +Install `Python 2.7` in parallel to default 2.6 (needed for `make check` to +run unittests). +Pick correct EPEL based on CentOS version used. Then install current `pytest` + + rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm + rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm + yum install python27 python27-pip + pip2.7 install pytest + +Please note that `CentOS 6` needs to keep python pointing to version 2.6 +for `yum` to keep working, so don't create a symlink for python2.7 to python + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -r -g 85 frrvt + sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \ + -c "FRR FreeRangeRouting suite" -d /var/run/frr frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + +You may want to pay special attention to `/usr/lib64` paths and change +them if you are not building on a x86_64 architecture + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --sysconfdir=/etc/frr \ + --libdir=/usr/lib64/frr \ + --libexecdir=/usr/lib64/frr \ + --localstatedir=/var/run/frr \ + --disable-pimd \ + --enable-snmp=agentx \ + --enable-multipath=64 \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvt \ + --enable-rtadv \ + --disable-exampledir \ + --enable-watchfrr \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check PYTHON=/usr/bin/python2.7 + sudo make install + +### Create empty FRR configuration files + sudo mkdir /var/log/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/zebra.conf + sudo touch /etc/frr/bgpd.conf + sudo touch /etc/frr/ospfd.conf + sudo touch /etc/frr/ospf6d.conf + sudo touch /etc/frr/isisd.conf + sudo touch /etc/frr/ripd.conf + sudo touch /etc/frr/ripngd.conf + sudo chown -R frr:frr /etc/frr/ + sudo touch /etc/frr/vtysh.conf + sudo chown frr:frrvt /etc/frr/vtysh.conf + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Edit `/etc/sysctl.conf` and set the following values (ignore the other +settings) + + # Controls IP packet forwarding + net.ipv4.ip_forward = 1 + net.ipv6.conf.all.forwarding=1 + + # Controls source route verification + net.ipv4.conf.default.rp_filter = 0 + +**Reboot** or use `sysctl` to apply the same config to the running system + +### Add init.d startup files + sudo cp redhat/bgpd.init /etc/init.d/bgpd + sudo cp redhat/isisd.init /etc/init.d/isisd + sudo cp redhat/ospfd.init /etc/init.d/ospfd + sudo cp redhat/ospf6d.init /etc/init.d/ospf6d + sudo cp redhat/ripngd.init /etc/init.d/ripngd + sudo cp redhat/ripd.init /etc/init.d/ripd + sudo cp redhat/zebra.init /etc/init.d/zebra + sudo chkconfig --add zebra + sudo chkconfig --add ripd + sudo chkconfig --add ripngd + sudo chkconfig --add ospf6d + sudo chkconfig --add ospfd + sudo chkconfig --add bgpd + sudo chkconfig --add isisd + +### Enable required daemons at startup +Only enable zebra and the daemons which are needed for your setup + + sudo chkconfig zebra on + sudo chkconfig ospfd on + sudo chkconfig bgpd on + [...] etc (as needed) diff --git a/doc/Building_FRR_on_CentOS7.md b/doc/Building_FRR_on_CentOS7.md new file mode 100644 index 000000000..cd10a91ed --- /dev/null +++ b/doc/Building_FRR_on_CentOS7.md @@ -0,0 +1,123 @@ +Building FRR on CentOS 7 from Git Source +======================================== + +CentOS 7 restrictions: +---------------------- + +- MPLS is not supported on `CentOS 7` with default kernel. MPLS requires + Linux Kernel 4.5 or higher (LDP can be built, but may have limited use + without MPLS) + +Install required packages +------------------------- + +Add packages: + + sudo yum install git autoconf automake libtool make gawk readline-devel \ + texinfo net-snmp-devel groff pkgconfig json-c-devel pam-devel \ + bison flex pytest + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -r -g 85 frrvt + sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \ + -c "FRR FreeRangeRouting suite" -d /var/run/frr frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + +You may want to pay special attention to `/usr/lib64` paths and change +them if you are not building on a x86_64 architecture + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --sysconfdir=/etc/frr \ + --libdir=/usr/lib64/frr \ + --libexecdir=/usr/lib64/frr \ + --localstatedir=/var/run/frr \ + --enable-snmp=agentx \ + --enable-multipath=64 \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvt \ + --enable-rtadv \ + --disable-exampledir \ + --enable-watchfrr \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check + sudo make install + +### Create empty FRR configuration files + sudo mkdir /var/log/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/zebra.conf + sudo touch /etc/frr/bgpd.conf + sudo touch /etc/frr/ospfd.conf + sudo touch /etc/frr/ospf6d.conf + sudo touch /etc/frr/isisd.conf + sudo touch /etc/frr/ripd.conf + sudo touch /etc/frr/ripngd.conf + sudo touch /etc/frr/pimd.conf + sudo chown -R frr:frr /etc/frr/ + sudo touch /etc/frr/vtysh.conf + sudo chown frr:frrvt /etc/frr/vtysh.conf + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the +following content: + + # Sysctl for routing + # + # Routing: We need to forward packets + net.ipv4.conf.all.forwarding=1 + net.ipv6.conf.all.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system + +### Install Service files + sudo install -p -m 644 redhat/zebra.service /usr/lib/systemd/system/zebra.service + sudo install -p -m 644 redhat/isisd.service /usr/lib/systemd/system/isisd.service + sudo install -p -m 644 redhat/ripd.service /usr/lib/systemd/system/ripd.service + sudo install -p -m 644 redhat/ospfd.service /usr/lib/systemd/system/ospfd.service + sudo install -p -m 644 redhat/bgpd.service /usr/lib/systemd/system/bgpd.service + sudo install -p -m 644 redhat/ospf6d.service /usr/lib/systemd/system/ospf6d.service + sudo install -p -m 644 redhat/ripngd.service /usr/lib/systemd/system/ripngd.service + sudo install -p -m 644 redhat/pimd.service /usr/lib/systemd/system/pimd.service + sudo install -p -m 644 redhat/frr.sysconfig /etc/sysconfig/frr + sudo install -p -m 644 redhat/frr.logrotate /etc/logrotate.d/frr + +### Register the systemd files + sudo systemctl preset zebra.service + sudo systemctl preset ripd.service + sudo systemctl preset ospfd.service + sudo systemctl preset bgpd.service + sudo systemctl preset ospf6d.service + sudo systemctl preset ripngd.service + sudo systemctl preset pimd.service + +### Enable required daemons at startup +Only enable zebra and the daemons which are needed for your setup + + sudo systemctl enable zebra + sudo systemctl enable ospfd + sudo systemctl enable bgpd + [...] etc (as needed) diff --git a/doc/Building_FRR_on_Debian8.md b/doc/Building_FRR_on_Debian8.md new file mode 100644 index 000000000..902f8c623 --- /dev/null +++ b/doc/Building_FRR_on_Debian8.md @@ -0,0 +1,98 @@ +Building FRR on Debian 8 from Git Source +======================================== + +Debian 8 restrictions: +---------------------- + +- MPLS is not supported on `Debian 8` with default kernel. MPLS requires + Linux Kernel 4.5 or higher (LDP can be built, but may have limited use + without MPLS) + +Install required packages +------------------------- + +Add packages: + + sudo apt-get install git autoconf automake libtool make gawk \ + libreadline-dev texinfo libjson-c-dev pkg-config bison flex \ + python-pip + +Install newer pytest (>3.0) from pip + + sudo pip install pytest + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr groups and user + + sudo addgroup --system --gid 92 frr + sudo addgroup --system --gid 85 frrvty + sudo adduser --system --ingroup frr --groups frrvty --home /var/run/frr/ \ + --gecos "FRR FreeRangeRouting suite" --shell /bin/false frr + sudo usermode + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --enable-exampledir=/usr/share/doc/frr/examples/ \ + --localstatedir=/var/run/frr \ + --sbindir=/usr/lib/frr \ + --sysconfdir=/etc/frr \ + --enable-vtysh \ + --enable-isisd \ + --enable-pimd \ + --enable-watchfrr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check + sudo make install + +### Create empty FRR configuration files + sudo install -m 755 -o frr -g frr -d /var/log/frr + sudo install -m 775 -o frr -g frrvty -d /etc/frr + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf + sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf + sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf + +### Enable IP & IPv6 forwarding + +Edit `/etc/sysctl.conf` and uncomment the following values (ignore the +other settings) + + # Uncomment the next line to enable packet forwarding for IPv4 + net.ipv4.ip_forward=1 + + # Uncomment the next line to enable packet forwarding for IPv6 + # Enabling this option disables Stateless Address Autoconfiguration + # based on Router Advertisements for this host + net.ipv6.conf.all.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/doc/Building_FRR_on_Fedora24.md b/doc/Building_FRR_on_Fedora24.md new file mode 100644 index 000000000..9617afc73 --- /dev/null +++ b/doc/Building_FRR_on_Fedora24.md @@ -0,0 +1,134 @@ +Building FRR on Fedora 24 from Git Source +========================================= + +Install required packages +------------------------- + +Add packages: + + sudo dnf install git autoconf automake libtool make gawk \ + readline-devel texinfo net-snmp-devel groff pkgconfig \ + json-c-devel pam-devel perl-XML-LibXML pytest + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not +using any packages** + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -r -g 85 frrvt + sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \ + -c "FRR FreeRangeRouting suite" -d /var/run/frr frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + +You may want to pay special attention to `/usr/lib64` paths and change +them if you are not building on a x86_64 architecture + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --sysconfdir=/etc/frr \ + --libdir=/usr/lib64/frr \ + --libexecdir=/usr/lib64/frr \ + --localstatedir=/var/run/frr \ + --enable-pimd \ + --enable-snmp=agentx \ + --enable-multipath=64 \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvt \ + --enable-rtadv \ + --disable-exampledir \ + --enable-watchfrr \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check + sudo make install + +### Create empty FRR configuration files + sudo mkdir /var/log/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/zebra.conf + sudo touch /etc/frr/bgpd.conf + sudo touch /etc/frr/ospfd.conf + sudo touch /etc/frr/ospf6d.conf + sudo touch /etc/frr/isisd.conf + sudo touch /etc/frr/ripd.conf + sudo touch /etc/frr/ripngd.conf + sudo touch /etc/frr/pimd.conf + sudo touch /etc/frr/ldpd.conf + sudo chown -R frr:frr /etc/frr/ + sudo touch /etc/frr/vtysh.conf + sudo chown frr:frrvt /etc/frr/vtysh.conf + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding (and MPLS) + +Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the +following content: +(Please make sure to list all interfaces with required MPLS similar +to `net.mpls.conf.eth0.input=1`) + + # Sysctl for routing + # + # Routing: We need to forward packets + net.ipv4.conf.all.forwarding=1 + net.ipv6.conf.all.forwarding=1 + # + # Enable MPLS Label processing on all interfaces + net.mpls.conf.eth0.input=1 + net.mpls.conf.eth1.input=1 + net.mpls.conf.eth2.input=1 + net.mpls.platform_labels=100000 + +Create a new file `/etc/modules-load.d/mpls.conf` with the following content: + + # Load MPLS Kernel Modules + mpls-router + mpls-iptunnel + +**Reboot** or use `sysctl` to apply the same config to the running system + +### Install Service files + install -p -m 644 redhat/zebra.service /usr/lib/systemd/system/zebra.service + install -p -m 644 redhat/isisd.service /usr/lib/systemd/system/isisd.service + install -p -m 644 redhat/ripd.service /usr/lib/systemd/system/ripd.service + install -p -m 644 redhat/ospfd.service /usr/lib/systemd/system/ospfd.service + install -p -m 644 redhat/bgpd.service /usr/lib/systemd/system/bgpd.service + install -p -m 644 redhat/ospf6d.service /usr/lib/systemd/system/ospf6d.service + install -p -m 644 redhat/ripngd.service /usr/lib/systemd/system/ripngd.service + install -p -m 644 redhat/pimd.service /usr/lib/systemd/system/pimd.service + install -p -m 644 redhat/pimd.service /usr/lib/systemd/system/ldpd.service + install -p -m 644 redhat/frr.sysconfig /etc/sysconfig/frr + install -p -m 644 redhat/frr.logrotate /etc/logrotate.d/frr + +### Register the systemd files + systemctl preset zebra.service + systemctl preset ripd.service + systemctl preset ospfd.service + systemctl preset bgpd.service + systemctl preset ospf6d.service + systemctl preset ripngd.service + systemctl preset pimd.service + systemctl preset ldpd.service + +### Enable required daemons at startup +Only enable zebra and the daemons which are needed for your setup + + systemctl enable zebra + systemctl enable ospfd + systemctl enable bgpd + [...] etc (as needed) diff --git a/doc/Building_FRR_on_FreeBSD10.md b/doc/Building_FRR_on_FreeBSD10.md new file mode 100644 index 000000000..696b7d5d2 --- /dev/null +++ b/doc/Building_FRR_on_FreeBSD10.md @@ -0,0 +1,96 @@ +Building FRR on FreeBSD 10 from Git Source +========================================== + +FreeBSD 10 restrictions: +------------------------ + +- MPLS is not supported on `FreeBSD`. MPLS requires a Linux Kernel + (4.5 or higher). LDP can be built, but may have limited use + without MPLS + +Install required packages +------------------------- + +Add packages: +(Allow the install of the package managment tool if this is first package +install and asked) + + pkg install git autoconf automake libtool gmake gawk json-c pkgconf \ + bison flex py27-pytest + +Make sure there is no /usr/bin/flex preinstalled (and use the newly +installed in /usr/local/bin): +(FreeBSD frequently provides a older flex as part of the base OS which +takes preference in path) + + rm -f /usr/bin/flex + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not +using any packages** + +### Add frr group and user + + pw groupadd frr -g 101 + pw groupadd frrvty -g 102 + pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \ + -d /usr/local/etc/frr -s /usr/sbin/nologin + +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + export MAKE=gmake + export LDFLAGS="-L/usr/local/lib" + export CPPFLAGS="-I/usr/local/include" + ./configure \ + --sysconfdir=/usr/local/etc/frr \ + --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ + --localstatedir=/var/run/frr \ + --prefix=/usr/local \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Create empty FRR configuration files + sudo mkdir /usr/local/etc/frr + sudo touch /usr/local/etc/frr/zebra.conf + sudo touch /usr/local/etc/frr/bgpd.conf + sudo touch /usr/local/etc/frr/ospfd.conf + sudo touch /usr/local/etc/frr/ospf6d.conf + sudo touch /usr/local/etc/frr/isisd.conf + sudo touch /usr/local/etc/frr/ripd.conf + sudo touch /usr/local/etc/frr/ripngd.conf + sudo touch /usr/local/etc/frr/pimd.conf + sudo chown -R frr:frr /usr/local/etc/frr + sudo touch /usr/local/etc/frr/vtysh.conf + sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf + sudo chmod 640 /usr/local/etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Add the following lines to the end of `/etc/sysctl.conf`: + + # Routing: We need to forward packets + net.inet.ip.forwarding=1 + net.inet6.ip6.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/doc/Building_FRR_on_FreeBSD11.md b/doc/Building_FRR_on_FreeBSD11.md new file mode 100644 index 000000000..d0b8a7bf8 --- /dev/null +++ b/doc/Building_FRR_on_FreeBSD11.md @@ -0,0 +1,96 @@ +Building FRR on FreeBSD 11 from Git Source +========================================== + +FreeBSD 11 restrictions: +------------------------ + +- MPLS is not supported on `FreeBSD`. MPLS requires a Linux Kernel + (4.5 or higher). LDP can be built, but may have limited use + without MPLS + +Install required packages +------------------------- + +Add packages: +(Allow the install of the package managment tool if this is first package +install and asked) + + pkg install git autoconf automake libtool gmake gawk json-c pkgconf \ + bison flex py27-pytest + +Make sure there is no /usr/bin/flex preinstalled (and use the newly +installed in /usr/local/bin): +(FreeBSD frequently provides a older flex as part of the base OS which +takes preference in path) + + rm -f /usr/bin/flex + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not +using any packages** + +### Add frr group and user + + pw groupadd frr -g 101 + pw groupadd frrvty -g 102 + pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \ + -d /usr/local/etc/frr -s /usr/sbin/nologin + +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + export MAKE=gmake + export LDFLAGS="-L/usr/local/lib" + export CPPFLAGS="-I/usr/local/include" + ./configure \ + --sysconfdir=/usr/local/etc/frr \ + --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ + --localstatedir=/var/run/frr \ + --prefix=/usr/local \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Create empty FRR configuration files + sudo mkdir /usr/local/etc/frr + sudo touch /usr/local/etc/frr/zebra.conf + sudo touch /usr/local/etc/frr/bgpd.conf + sudo touch /usr/local/etc/frr/ospfd.conf + sudo touch /usr/local/etc/frr/ospf6d.conf + sudo touch /usr/local/etc/frr/isisd.conf + sudo touch /usr/local/etc/frr/ripd.conf + sudo touch /usr/local/etc/frr/ripngd.conf + sudo touch /usr/local/etc/frr/pimd.conf + sudo chown -R frr:frr /usr/local/etc/frr + sudo touch /usr/local/etc/frr/vtysh.conf + sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf + sudo chmod 640 /usr/local/etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Add the following lines to the end of `/etc/sysctl.conf`: + + # Routing: We need to forward packets + net.inet.ip.forwarding=1 + net.inet6.ip6.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/doc/Building_FRR_on_FreeBSD9.md b/doc/Building_FRR_on_FreeBSD9.md new file mode 100644 index 000000000..d470d0046 --- /dev/null +++ b/doc/Building_FRR_on_FreeBSD9.md @@ -0,0 +1,96 @@ +Building FRR on FreeBSD 9 from Git Source +========================================= + +FreeBSD 9 restrictions: +----------------------- + +- MPLS is not supported on `FreeBSD`. MPLS requires a Linux Kernel + (4.5 or higher). LDP can be built, but may have limited use + without MPLS + +Install required packages +------------------------- + +Add packages: +(Allow the install of the package managment tool if this is first package +install and asked) + + pkg install -y git autoconf automake libtool gmake gawk \ + pkgconf texinfo json-c bison flex py27-pytest + +Make sure there is no /usr/bin/flex preinstalled (and use the newly +installed in /usr/local/bin): +(FreeBSD frequently provides a older flex as part of the base OS which +takes preference in path) + + rm -f /usr/bin/flex + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not +using any packages** + +### Add frr group and user + + pw groupadd frr -g 101 + pw groupadd frrvty -g 102 + pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \ + -d /usr/local/etc/frr -s /usr/sbin/nologin + +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + export MAKE=gmake + export LDFLAGS="-L/usr/local/lib" + export CPPFLAGS="-I/usr/local/include" + ./configure \ + --sysconfdir=/usr/local/etc/frr \ + --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ + --localstatedir=/var/run/frr \ + --prefix=/usr/local \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Create empty FRR configuration files + sudo mkdir /usr/local/etc/frr + sudo touch /usr/local/etc/frr/zebra.conf + sudo touch /usr/local/etc/frr/bgpd.conf + sudo touch /usr/local/etc/frr/ospfd.conf + sudo touch /usr/local/etc/frr/ospf6d.conf + sudo touch /usr/local/etc/frr/isisd.conf + sudo touch /usr/local/etc/frr/ripd.conf + sudo touch /usr/local/etc/frr/ripngd.conf + sudo touch /usr/local/etc/frr/pimd.conf + sudo chown -R frr:frr /usr/local/etc/frr + sudo touch /usr/local/etc/frr/vtysh.conf + sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf + sudo chmod 640 /usr/local/etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Add the following lines to the end of `/etc/sysctl.conf`: + + # Routing: We need to forward packets + net.inet.ip.forwarding=1 + net.inet6.ip6.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/doc/Building_FRR_on_NetBSD6.md b/doc/Building_FRR_on_NetBSD6.md new file mode 100644 index 000000000..03d04ce95 --- /dev/null +++ b/doc/Building_FRR_on_NetBSD6.md @@ -0,0 +1,117 @@ +Building FRR on NetBSD 6 from Git Source +======================================== + +NetBSD 6 restrictions: +---------------------- + +- MPLS is not supported on `NetBSD`. MPLS requires a Linux Kernel + (4.5 or higher). LDP can be built, but may have limited use + without MPLS + +Install required packages +------------------------- +Configure Package location: + + PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All" + export PKG_PATH + +Add packages: + + sudo pkg_add git autoconf automake libtool gmake gawk openssl \ + pkg-config json-c p5-XML-LibXML python27 py27-test + +Install SSL Root Certificates (for git https access): + + sudo pkg_add mozilla-rootcerts + sudo touch /etc/openssl/openssl.cnf + sudo mozilla-rootcerts install + +Select default Python and py.test + + sudo ln -s /usr/pkg/bin/python2.7 /usr/bin/python + sudo ln -s /usr/pkg/bin/py.test-2.7 /usr/bin/py.test + +Get FRR, compile it and install it (from Git) +------------------------------------------------ + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -g 93 frrvty + sudo useradd -g 92 -u 92 -G frrvty -c "FRR suite" \ + -d /nonexistent -s /sbin/nologin frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + MAKE=gmake + export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" + export CPPFLAGS="-I/usr/pkg/include" + ./configure \ + --sysconfdir=/usr/pkg/etc/frr \ + --enable-exampledir=/usr/pkg/share/examples/frr \ + --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ + --localstatedir=/var/run/frr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Create empty FRR configuration files + sudo mkdir /var/log/frr + sudo mkdir /usr/pkg/etc/frr + sudo touch /usr/pkg/etc/frr/zebra.conf + sudo touch /usr/pkg/etc/frr/bgpd.conf + sudo touch /usr/pkg/etc/frr/ospfd.conf + sudo touch /usr/pkg/etc/frr/ospf6d.conf + sudo touch /usr/pkg/etc/frr/isisd.conf + sudo touch /usr/pkg/etc/frr/ripd.conf + sudo touch /usr/pkg/etc/frr/ripngd.conf + sudo touch /usr/pkg/etc/frr/pimd.conf + sudo chown -R frr:frr /usr/pkg/etc/frr + sudo touch /usr/local/etc/frr/vtysh.conf + sudo chown frr:frrvty /usr/pkg/etc/frr/*.conf + sudo chmod 640 /usr/pkg/etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Add the following lines to the end of `/etc/sysctl.conf`: + + # Routing: We need to forward packets + net.inet.ip.forwarding=1 + net.inet6.ip6.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system + +### Install rc.d init files + cp pkgsrc/*.sh /etc/rc.d/ + chmod 555 /etc/rc.d/*.sh + +### Enable FRR processes +(Enable the required processes only) + + echo "zebra=YES" >> /etc/rc.conf + echo "bgpd=YES" >> /etc/rc.conf + echo "ospfd=YES" >> /etc/rc.conf + echo "ospf6d=YES" >> /etc/rc.conf + echo "isisd=YES" >> /etc/rc.conf + echo "ripngd=YES" >> /etc/rc.conf + echo "ripd=YES" >> /etc/rc.conf + echo "pimd=YES" >> /etc/rc.conf diff --git a/doc/Building_FRR_on_NetBSD7.md b/doc/Building_FRR_on_NetBSD7.md new file mode 100644 index 000000000..d9b4b47ea --- /dev/null +++ b/doc/Building_FRR_on_NetBSD7.md @@ -0,0 +1,110 @@ +Building FRR on NetBSD 7 from Git Source +======================================== + +NetBSD 7 restrictions: +---------------------- + +- MPLS is not supported on `NetBSD`. MPLS requires a Linux Kernel + (4.5 or higher). LDP can be built, but may have limited use + without MPLS + +Install required packages +------------------------- + + sudo pkgin install git autoconf automake libtool gmake gawk openssl \ + pkg-config json-c p5-XML-LibXML python27 py27-test + +Install SSL Root Certificates (for git https access): + + sudo pkgin install mozilla-rootcerts + sudo touch /etc/openssl/openssl.cnf + sudo mozilla-rootcerts install + +Select default Python and py.test + + sudo ln -s /usr/pkg/bin/python2.7 /usr/bin/python + sudo ln -s /usr/pkg/bin/py.test-2.7 /usr/bin/py.test + +Get FRR, compile it and install it (from Git) +------------------------------------------------ + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -g 93 frrvty + sudo useradd -g 92 -u 92 -G frrvty -c "FRR suite" \ + -d /nonexistent -s /sbin/nologin frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + MAKE=gmake + export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" + export CPPFLAGS="-I/usr/pkg/include" + ./configure \ + --sysconfdir=/usr/pkg/etc/frr \ + --enable-exampledir=/usr/pkg/share/examples/frr \ + --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ + --localstatedir=/var/run/frr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Create empty FRR configuration files + sudo mkdir /usr/pkg/etc/frr + sudo touch /usr/pkg/etc/frr/zebra.conf + sudo touch /usr/pkg/etc/frr/bgpd.conf + sudo touch /usr/pkg/etc/frr/ospfd.conf + sudo touch /usr/pkg/etc/frr/ospf6d.conf + sudo touch /usr/pkg/etc/frr/isisd.conf + sudo touch /usr/pkg/etc/frr/ripd.conf + sudo touch /usr/pkg/etc/frr/ripngd.conf + sudo touch /usr/pkg/etc/frr/pimd.conf + sudo chown -R frr:frr /usr/pkg/etc/frr + sudo touch /usr/local/etc/frr/vtysh.conf + sudo chown frr:frrvty /usr/pkg/etc/frr/*.conf + sudo chmod 640 /usr/pkg/etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Add the following lines to the end of `/etc/sysctl.conf`: + + # Routing: We need to forward packets + net.inet.ip.forwarding=1 + net.inet6.ip6.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system + +### Install rc.d init files + cp pkgsrc/*.sh /etc/rc.d/ + chmod 555 /etc/rc.d/*.sh + +### Enable FRR processes +(Enable the required processes only) + + echo "zebra=YES" >> /etc/rc.conf + echo "bgpd=YES" >> /etc/rc.conf + echo "ospfd=YES" >> /etc/rc.conf + echo "ospf6d=YES" >> /etc/rc.conf + echo "isisd=YES" >> /etc/rc.conf + echo "ripngd=YES" >> /etc/rc.conf + echo "ripd=YES" >> /etc/rc.conf + echo "pimd=YES" >> /etc/rc.conf diff --git a/doc/Building_FRR_on_OmniOS.md b/doc/Building_FRR_on_OmniOS.md new file mode 100644 index 000000000..f158c80a7 --- /dev/null +++ b/doc/Building_FRR_on_OmniOS.md @@ -0,0 +1,124 @@ +Building FRR on OmniOS (OpenSolaris) from Git Source +==================================================== + +OmniOS restrictions: +-------------------- + +- MPLS is not supported on `OmniOS` or `Solaris`. MPLS requires a Linux + Kernel (4.5 or higher). LDP can be built, but may have limited use + without MPLS + +### Enable IP & IPv6 forwarding + + routeadm -e ipv4-forwarding + routeadm -e ipv6-forwarding + +Install required packages +------------------------- + +Add packages: + + pkg install \ + developer/build/autoconf \ + developer/build/automake \ + developer/lexer/flex \ + developer/parser/bison \ + developer/object-file \ + developer/linker \ + developer/library/lint \ + developer/build/gnu-make \ + developer/gcc51 \ + library/idnkit \ + library/idnkit/header-idnkit \ + system/header \ + system/library/math/header-math \ + git libtool gawk pkg-config + +Add additional Solaris packages: + + pkgadd -d http://get.opencsw.org/now + /opt/csw/bin/pkgutil -U + /opt/csw/bin/pkgutil -y -i texinfo + /opt/csw/bin/pkgutil -y -i perl + /opt/csw/bin/pkgutil -y -i libjson_c_dev + /opt/csw/bin/pkgutil -y -i python27 py_pip + +Add libjson to Solaris equivalent of ld.so.conf + + crle -l /opt/csw/lib -u + +Add Perl packages: + + cpan + cpan[1]> install XML::LibXML + cpan[2]> exit + +Add pytest: + + pip install pytest + +Select Python 2.7 as default (required for pytest) + + rm -f /usr/bin/python + ln -s /opt/csw/bin/python2.7 /usr/bin/python + +Fix PATH for all users and non-interactive sessions. Edit `/etc/default/login` +and add the following default PATH: + + PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/opt/csw/bin + +Edit `~/.profile` and add the following default PATH: + + PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/opt/csw/bin + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr group and user + + sudo groupadd -g 93 frr + sudo groupadd -g 94 frrvty + sudo useradd -g 93 -u 93 -G frrvty -c "FRR suite" \ + -d /nonexistent -s /bin/false frr + +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + export MAKE=gmake + export LDFLAGS="-L/opt/csw/lib" + export CPPFLAGS="-I/opt/csw/include" + ./configure \ + --sysconfdir=/etc/frr \ + --enable-exampledir=/usr/share/doc/frr/examples/ \ + --localstatedir=/var/run/frr \ + --sbindir=/usr/lib/frr \ + --enable-vtysh \ + --enable-watchfrr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Enable IP & IPv6 forwarding + + routeadm -e ipv4-forwarding + routeadm -e ipv6-forwarding diff --git a/doc/Building_FRR_on_OpenBSD6.md b/doc/Building_FRR_on_OpenBSD6.md new file mode 100644 index 000000000..9e13d5ce4 --- /dev/null +++ b/doc/Building_FRR_on_OpenBSD6.md @@ -0,0 +1,129 @@ +Building FRR on OpenBSD 6 from Git Source +========================================= + +OpenBSD restrictions: +--------------------- + +- MPLS is not tested on `OpenBSD`. It may work as it shares the + sources with the LDPd on OpenBSD. Bug reports and fixes are welcome + +Install required packages +------------------------- + +Configure PKG_PATH + + export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/ + +Add packages: + + pkg_add git autoconf-2.69p2 automake-1.15p0 libtool + pkg_add gmake gawk dejagnu openssl json-c p5-XML-LibXML py-test + +Select Python2.7 as default (required for pytest) + + ln -s /usr/local/bin/python2.7 /usr/local/bin/python + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr group and user + + groupadd -g 525 _frr + groupadd -g 526 _frrvty + useradd -g 525 -u 525 -c "FRR suite" -G _frrvty \ + -d /nonexistent -s /sbin/nologin _frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + export LDFLAGS="-L/usr/local/lib" + export CPPFLAGS="-I/usr/local/include" + ./configure \ + --sysconfdir=/etc/frr \ + --localstatedir=/var/frr \ + --enable-pimd \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=_frr \ + --enable-group=_frr \ + --enable-vty-group=_frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --enable-ldpd \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + gmake + gmake check + sudo gmake install + +### Create empty FRR configuration files + + sudo mkdir /var/frr + sudo chown _frr:_frr /var/frr + sudo chmod 755 /var/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/zebra.conf + sudo touch /etc/frr/bgpd.conf + sudo touch /etc/frr/ospfd.conf + sudo touch /etc/frr/ospf6d.conf + sudo touch /etc/frr/isisd.conf + sudo touch /etc/frr/ripd.conf + sudo touch /etc/frr/ripngd.conf + sudo touch /etc/frr/pimd.conf + sudo touch /etc/frr/ldpd.conf + sudo chown -R _frr:_frr /etc/frr + sudo touch /etc/frr/vtysh.conf + sudo chown -R _frr:_frrvty /etc/frr/vtysh.conf + sudo chmod 750 /etc/frr + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Add the following lines to the end of `/etc/rc.conf`: + + net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets + net.inet6.ip6.mforwarding=1 # 1=Permit forwarding of IPv6 multicast packets + net.inet6.ip6.multipath=1 # 1=Enable IPv6 multipath routing + +**Reboot** to apply the config to the system + +### Install rc.d init files +(create them in /etc/rc.d - no example are included at this time with +FRR source) + +Example (for zebra - store as `/etc/rc.d/frr_zebra.sh`) + + #!/bin/sh + # + # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $ + + daemon="/usr/local/sbin/zebra -d" + + . /etc/rc.d/rc.subr + + rc_cmd $1 + +### Enable FRR processes +(Enable the required processes only) + + echo "frr_zebra=YES" >> /etc/rc.conf + echo "frr_bgpd=YES" >> /etc/rc.conf + echo "frr_ospfd=YES" >> /etc/rc.conf + echo "frr_ospf6d=YES" >> /etc/rc.conf + echo "frr_isisd=YES" >> /etc/rc.conf + echo "frr_ripngd=YES" >> /etc/rc.conf + echo "frr_ripd=YES" >> /etc/rc.conf + echo "frr_pimd=YES" >> /etc/rc.conf + echo "frr_ldpd=YES" >> /etc/rc.conf diff --git a/doc/Building_FRR_on_Ubuntu1204.md b/doc/Building_FRR_on_Ubuntu1204.md new file mode 100644 index 000000000..3312a2c9c --- /dev/null +++ b/doc/Building_FRR_on_Ubuntu1204.md @@ -0,0 +1,136 @@ +Building FRR on Ubuntu 12.04LTS from Git Source +=============================================== + +- MPLS is not supported on `Ubuntu 12.04` with default kernel. MPLS requires + Linux Kernel 4.5 or higher (LDP can be built, but may have limited use + without MPLS) + For an updated Ubuntu Kernel, see http://kernel.ubuntu.com/~kernel-ppa/mainline/ + +Install required packages +------------------------- + +Add packages: + + apt-get install git autoconf automake libtool make gawk libreadline-dev \ + texinfo libpam0g-dev dejagnu libjson0 pkg-config libpam0g-dev \ + libjson0-dev flex python-pip + +Install newer bison from 14.04 package source (Ubuntu 12.04 package source +is too old) + + mkdir builddir + cd builddir + wget http://archive.ubuntu.com/ubuntu/pool/main/b/bison/bison_3.0.2.dfsg-2.dsc + wget http://archive.ubuntu.com/ubuntu/pool/main/b/bison/bison_3.0.2.dfsg.orig.tar.bz2 + wget http://archive.ubuntu.com/ubuntu/pool/main/b/bison/bison_3.0.2.dfsg-2.debian.tar.gz + tar -jxvf bison_3.0.2.dfsg.orig.tar.bz2 + cd bison-3.0.2.dfsg/ + tar xzf ../bison_3.0.2.dfsg-2.debian.tar.gz + sudo apt-get build-dep bison + debuild -b -uc -us + cd .. + sudo dpkg -i ./libbison-dev_3.0.2.dfsg-2_amd64.deb ./bison_3.0.2.dfsg-2_amd64.deb + cd .. + rm -rf builddir + +Install newer version of autoconf and automake: + + wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz + tar xvf autoconf-2.69.tar.gz + cd autoconf-2.69 + ./configure --prefix=/usr + make + sudo make install + cd .. + + wget http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz + tar xvf automake-1.15.tar.gz + cd automake-1.15 + ./configure --prefix=/usr + make + sudo make install + cd .. + +Install pytest: + + pip install pytest + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -r -g 85 frrvty + sudo adduser --system --ingroup frr --groups frrvty --home /var/run/frr/ \ + --gecos "FRR suite" --shell /sbin/nologin frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --enable-exampledir=/usr/share/doc/frr/examples/ \ + --localstatedir=/var/run/frr \ + --sbindir=/usr/lib/frr \ + --sysconfdir=/etc/frr \ + --enable-pimd \ + --enable-watchfrr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --enable-ldpd \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check + sudo make install + +### Create empty FRR configuration files + + sudo mkdir /var/log/frr + sudo chown frr:fee /var/log/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/etc/zebra.conf + sudo touch /etc/frr/etc/bgpd.conf + sudo touch /etc/frr/etc/ospfd.conf + sudo touch /etc/frr/etc/ospf6d.conf + sudo touch /etc/frr/etc/isisd.conf + sudo touch /etc/frr/etc/ripd.conf + sudo touch /etc/frr/etc/ripngd.conf + sudo touch /etc/frr/etc/pimd.conf + sudo touch /etc/frr/etc/ldpd.conf + sudo chown frr:frr /etc/frr/ + sudo touch /etc/frr/etc/vtysh.conf + sudo chown frr:frrvty /etc/frr/etc/vtysh.conf + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Edit `/etc/sysctl.conf` and uncomment the following values (ignore the +other settings) + + # Uncomment the next line to enable packet forwarding for IPv4 + net.ipv4.ip_forward=1 + + # Uncomment the next line to enable packet forwarding for IPv6 + # Enabling this option disables Stateless Address Autoconfiguration + # based on Router Advertisements for this host + net.ipv6.conf.all.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/doc/Building_FRR_on_Ubuntu1404.md b/doc/Building_FRR_on_Ubuntu1404.md new file mode 100644 index 000000000..ac0a45acd --- /dev/null +++ b/doc/Building_FRR_on_Ubuntu1404.md @@ -0,0 +1,94 @@ +Building FRR on Ubuntu 14.04LTS from Git Source +=============================================== + +- MPLS is not supported on `Ubuntu 14.04` with default kernel. MPLS requires + Linux Kernel 4.5 or higher (LDP can be built, but may have limited use + without MPLS) + For an updated Ubuntu Kernel, see http://kernel.ubuntu.com/~kernel-ppa/mainline/ + +Install required packages +------------------------- + +Add packages: + + apt-get install git autoconf automake libtool make gawk libreadline-dev \ + texinfo dejagnu pkg-config libpam0g-dev libjson-c-dev bison flex \ + python-pytest + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -r -g 85 frrvty + sudo adduser --system --ingroup frr --groups frrvty --home /var/run/frr/ \ + --gecos "FRR suite" --shell /sbin/nologin frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --enable-exampledir=/usr/share/doc/frr/examples/ \ + --localstatedir=/var/run/frr \ + --sbindir=/usr/lib/frr \ + --sysconfdir=/etc/frr \ + --enable-pimd \ + --enable-watchfrr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check + sudo make install + +### Create empty FRR configuration files + + sudo mkdir /var/log/frr + sudo chown frr:fee /var/log/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/etc/zebra.conf + sudo touch /etc/frr/etc/bgpd.conf + sudo touch /etc/frr/etc/ospfd.conf + sudo touch /etc/frr/etc/ospf6d.conf + sudo touch /etc/frr/etc/isisd.conf + sudo touch /etc/frr/etc/ripd.conf + sudo touch /etc/frr/etc/ripngd.conf + sudo touch /etc/frr/etc/pimd.conf + sudo chown frr:frr /etc/frr/ + sudo touch /etc/frr/etc/vtysh.conf + sudo chown frr:frrvty /etc/frr/etc/vtysh.conf + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Edit `/etc/sysctl.conf` and uncomment the following values (ignore the +other settings) + + # Uncomment the next line to enable packet forwarding for IPv4 + net.ipv4.ip_forward=1 + + # Uncomment the next line to enable packet forwarding for IPv6 + # Enabling this option disables Stateless Address Autoconfiguration + # based on Router Advertisements for this host + net.ipv6.conf.all.forwarding=1 + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/doc/Building_FRR_on_Ubuntu1604.md b/doc/Building_FRR_on_Ubuntu1604.md new file mode 100644 index 000000000..d1e1a377d --- /dev/null +++ b/doc/Building_FRR_on_Ubuntu1604.md @@ -0,0 +1,116 @@ +Building FRR on Ubuntu 16.04LTS from Git Source +=============================================== + +- MPLS is not supported on `Ubuntu 16.04` with default kernel. MPLS requires + Linux Kernel 4.5 or higher (LDP can be built, but may have limited use + without MPLS) + For an updated Ubuntu Kernel, see + http://kernel.ubuntu.com/~kernel-ppa/mainline/ + +Install required packages +------------------------- + +Add packages: + + apt-get install git autoconf automake libtool make gawk libreadline-dev \ + texinfo dejagnu pkg-config libpam0g-dev libjson-c-dev bison flex \ + python-pytest + +Get FRR, compile it and install it (from Git) +--------------------------------------------- + +**This assumes you want to build and install FRR from source and not using +any packages** + +### Add frr groups and user + + sudo groupadd -g 92 frr + sudo groupadd -r -g 85 frrvty + sudo adduser --system --ingroup frr --groups frrvty --home /var/run/frr/ \ + --gecos "FRR suite" --shell /sbin/nologin frr + +### Download Source, configure and compile it +(You may prefer different options on configure statement. These are just +an example.) + + git clone https://github.com/freerangerouting/frr.git frr + cd frr + git checkout stable/2.0 + ./bootstrap.sh + ./configure \ + --enable-exampledir=/usr/share/doc/frr/examples/ \ + --localstatedir=/var/run/frr \ + --sbindir=/usr/lib/frr \ + --sysconfdir=/etc/frr \ + --enable-pimd \ + --enable-watchfrr \ + --enable-ospfclient=yes \ + --enable-ospfapi=yes \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-rtadv \ + --enable-tcp-zebra \ + --enable-fpm \ + --enable-ldpd \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion + make + make check + sudo make install + +### Create empty FRR configuration files + + sudo mkdir /var/log/frr + sudo chown frr:fee /var/log/frr + sudo mkdir /etc/frr + sudo touch /etc/frr/etc/zebra.conf + sudo touch /etc/frr/etc/bgpd.conf + sudo touch /etc/frr/etc/ospfd.conf + sudo touch /etc/frr/etc/ospf6d.conf + sudo touch /etc/frr/etc/isisd.conf + sudo touch /etc/frr/etc/ripd.conf + sudo touch /etc/frr/etc/ripngd.conf + sudo touch /etc/frr/etc/pimd.conf + sudo touch /etc/frr/etc/ldpd.conf + sudo chown frr:frr /etc/frr/ + sudo touch /etc/frr/etc/vtysh.conf + sudo chown frr:frrvty /etc/frr/etc/vtysh.conf + sudo chmod 640 /etc/frr/*.conf + +### Enable IP & IPv6 forwarding + +Edit `/etc/sysctl.conf` and uncomment the following values (ignore the +other settings) + + # Uncomment the next line to enable packet forwarding for IPv4 + net.ipv4.ip_forward=1 + + # Uncomment the next line to enable packet forwarding for IPv6 + # Enabling this option disables Stateless Address Autoconfiguration + # based on Router Advertisements for this host + net.ipv6.conf.all.forwarding=1 + +### Enable MPLS Forwarding (with Linux Kernel >= 4.5) + +Edit `/etc/sysctl.conf` and the following lines. Make sure to add a line +equal to `net.mpls.conf.eth0.input` or each interface used with MPLS + + # Enable MPLS Label processing on all interfaces + net.mpls.conf.eth0.input=1 + net.mpls.conf.eth1.input=1 + net.mpls.conf.eth2.input=1 + net.mpls.platform_labels=100000 + +### Add MPLS kernel modules + +Add the following lines to `/etc/modules-load.d/modules.conf`: + + # Load MPLS Kernel Modules + mpls-router + mpls-iptunnel + +**Reboot** or use `sysctl` to apply the same config to the running system diff --git a/isisd/dict.c b/isisd/dict.c index a038028d2..56676edaf 100644 --- a/isisd/dict.c +++ b/isisd/dict.c @@ -649,6 +649,7 @@ dnode_t *dict_delete(dict_t *dict, dnode_t *delete) if (delete->left != nil && delete->right != nil) { dnode_t *next = dict_next(dict, delete); + assert (next); dnode_t *nextparent = next->parent; dnode_color_t nextcolor = next->color; diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index b138b8950..6207ae189 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -306,12 +306,12 @@ isis_circuit_del_addr (struct isis_circuit *circuit, else { prefix2str (connected->address, buf, sizeof (buf)); - zlog_warn ("Nonexitant ip address %s removal attempt from \ + zlog_warn ("Nonexistant ip address %s removal attempt from \ circuit %d", buf, circuit->circuit_id); zlog_warn ("Current ip addresses on %s:", circuit->interface->name); for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node, ip)) { - prefix2str((struct prefix*)ip, (char *)buf, BUFSIZ); + prefix2str(ip, buf, sizeof(buf)); zlog_warn(" %s", buf); } zlog_warn("End of addresses"); diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index da24a7f0d..fac62f6e1 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -2460,8 +2460,7 @@ lsp_regenerate_schedule_pseudo (struct isis_circuit *circuit, int level) int lvl; struct isis_area *area = circuit->area; - if (circuit == NULL || - circuit->circ_type != CIRCUIT_T_BROADCAST || + if (circuit->circ_type != CIRCUIT_T_BROADCAST || circuit->state != C_STATE_UP) return ISIS_OK; diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index e111a17de..5fbf6c194 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -2408,7 +2408,7 @@ send_lan_l1_hello (struct thread *thread) } if (circuit->u.bc.run_dr_elect[0]) - retval = isis_dr_elect (circuit, 1); + isis_dr_elect (circuit, 1); retval = send_hello (circuit, 1); @@ -2438,7 +2438,7 @@ send_lan_l2_hello (struct thread *thread) } if (circuit->u.bc.run_dr_elect[1]) - retval = isis_dr_elect (circuit, 2); + isis_dr_elect (circuit, 2); retval = send_hello (circuit, 2); diff --git a/isisd/isis_route.c b/isisd/isis_route.c index b2b858feb..4f82edaef 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -570,6 +570,12 @@ isis_route_validate_merge (struct isis_area *area, int family) table = area->route_table[0]; else if (family == AF_INET6) table = area->route_table6[0]; + else + { + zlog_warn ("ISIS-Rte (%s) %s called for unknown family %d", + area->area_tag, __func__, family); + return; + } for (rnode = route_top (table); rnode; rnode = route_next (rnode)) { diff --git a/isisd/isis_te.c b/isisd/isis_te.c index 34cd8397f..830ccb37c 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -985,17 +985,15 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh) void mpls_te_print_detail(struct vty *vty, struct te_is_neigh *te) { - struct subtlv_header *tlvh, *next; + struct subtlv_header *tlvh; u_int16_t sum = 0; zlog_debug ("ISIS MPLS-TE: Show database TE detail"); tlvh = (struct subtlv_header *)te->sub_tlvs; - for (; sum < te->sub_tlvs_length; tlvh = (next ? next : SUBTLV_HDR_NEXT (tlvh))) + for (; sum < te->sub_tlvs_length; tlvh = SUBTLV_HDR_NEXT (tlvh)) { - next = NULL; - switch (tlvh->type) { case TE_SUBTLV_ADMIN_GRP: @@ -1223,13 +1221,10 @@ DEFUN (show_isis_mpls_te_router, { vty_out (vty, "--- MPLS-TE router parameters ---%s", VTY_NEWLINE); - if (vty != NULL) - { - if (ntohs (isisMplsTE.router_id.s_addr) != 0) - vty_out (vty, " Router-Address: %s%s", inet_ntoa (isisMplsTE.router_id), VTY_NEWLINE); - else - vty_out (vty, " N/A%s", VTY_NEWLINE); - } + if (ntohs (isisMplsTE.router_id.s_addr) != 0) + vty_out (vty, " Router-Address: %s%s", inet_ntoa (isisMplsTE.router_id), VTY_NEWLINE); + else + vty_out (vty, " N/A%s", VTY_NEWLINE); } else vty_out (vty, " MPLS-TE is disable on this router%s", VTY_NEWLINE); @@ -983,6 +983,7 @@ static const struct zebra_desc_table command_types[] = { DESC_ENTRY (ZEBRA_INTERFACE_ENABLE_RADV), DESC_ENTRY (ZEBRA_INTERFACE_DISABLE_RADV), DESC_ENTRY (ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB), + DESC_ENTRY (ZEBRA_INTERFACE_LINK_PARAMS), DESC_ENTRY (ZEBRA_MPLS_LABELS_ADD), DESC_ENTRY (ZEBRA_MPLS_LABELS_DELETE), DESC_ENTRY (ZEBRA_IPV4_NEXTHOP_ADD), diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 845d96032..edb1ca470 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -383,7 +383,7 @@ main (int argc, char **argv) pid_file[0] = '\0'; snprintf(pidfile_temp, sizeof(pidfile_temp), "%s/ospfd-%d.pid", pid_file, instance ); - strncpy(pid_file, pidfile_temp, sizeof(pid_file)); + strlcpy(pid_file, pidfile_temp, sizeof(pid_file)); } /* Process id file create. */ pid_output (pid_file); @@ -407,7 +407,7 @@ main (int argc, char **argv) } else { - strcpy(vty_path, vty_sock_path); + strlcpy(vty_path, vty_sock_path, sizeof(vty_path)); } vty_serv_sock (vty_addr, vty_port, vty_path); diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 579c0fc59..c2e3bbbca 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2919,7 +2919,7 @@ vtysh_connect (struct vtysh_client *vclient) memset (&addr, 0, sizeof (struct sockaddr_un)); addr.sun_family = AF_UNIX; - strncpy (addr.sun_path, path, strlen (path)); + strlcpy (addr.sun_path, path, sizeof (addr.sun_path)); #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN len = addr.sun_len = SUN_LEN(&addr); #else diff --git a/zebra/zserv.c b/zebra/zserv.c index 37c048f62..29515e918 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -1197,7 +1197,7 @@ zread_ipv4_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf) api.safi = stream_getw (s); /* IPv4 prefix. */ - memset (&p, 0, sizeof (struct prefix_ipv4)); + memset (&p, 0, sizeof (struct prefix)); p.family = AF_INET; p.prefixlen = stream_getc (s); stream_get (&p.u.prefix4, s, PSIZE (p.prefixlen)); |