From: Martin Winter Date: Wed, 12 Jul 2017 01:33:24 +0000 (-0700) Subject: doc: Update Building Doc for RedHat-style Distro's (CentOS / Fedora) X-Git-Tag: frr-2.0.1~7^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F801%2Fhead;p=mirror%2Ffrr.git doc: Update Building Doc for RedHat-style Distro's (CentOS / Fedora) Signed-off-by: Martin Winter --- diff --git a/doc/Building_FRR_on_CentOS6.md b/doc/Building_FRR_on_CentOS6.md index c0c8efafdd..d66be446be 100644 --- a/doc/Building_FRR_on_CentOS6.md +++ b/doc/Building_FRR_on_CentOS6.md @@ -1,6 +1,10 @@ Building FRR on CentOS 6 from Git Source ======================================== +(As an alternative to this installation, you may prefer to create a FRR +rpm package yourself and install that package instead. See instructions +in redhat/README.rpm_build.md on how to build a rpm package) + Instructions are tested with `CentOS 6.8` on `x86_64` platform CentOS 6 restrictions: @@ -16,13 +20,14 @@ 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 + sudo yum install git autoconf automake libtool make gawk \ + readline-devel texinfo net-snmp-devel groff pkgconfig \ + json-c-devel pam-devel flex epel-release Install newer version of bison (CentOS 6 package source is too old) from CentOS 7 + sudo yum install rpm-build 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 @@ -50,14 +55,14 @@ 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 + sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm + sudo rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm + sudo yum install python27 python27-pip + sudo 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) --------------------------------------------- @@ -75,17 +80,16 @@ any packages** (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/frrouting/frr.git frr cd frr git checkout stable/2.0 ./bootstrap.sh ./configure \ + --bindir=/usr/bin \ + --sbindir=/usr/lib/frr \ --sysconfdir=/etc/frr \ - --libdir=/usr/lib64/frr \ - --libexecdir=/usr/lib64/frr \ + --libdir=/usr/lib/frr \ + --libexecdir=/usr/lib/frr \ --localstatedir=/var/run/frr \ --disable-pimd \ --enable-snmp=agentx \ @@ -99,9 +103,10 @@ them if you are not building on a x86_64 architecture --disable-exampledir \ --enable-watchfrr \ --enable-tcp-zebra \ + --disable-ldpd \ --enable-fpm \ --with-pkg-git-version \ - --with-pkg-extra-version=-MyOwnFRRVersion + --with-pkg-extra-version=-MyOwnFRRVersion make make check PYTHON=/usr/bin/python2.7 sudo make install @@ -121,6 +126,15 @@ them if you are not building on a x86_64 architecture sudo chown frr:frrvt /etc/frr/vtysh.conf sudo chmod 640 /etc/frr/*.conf +### Install daemon config file + sudo install -p -m 644 redhat/daemons /etc/frr/ + sudo chown frr:frr /etc/frr/daemons + +### Edit /etc/frr/daemons as needed to select the required daemons + +Look for the section with `watchfrr_enable=...` and `zebra=...` etc. +Enable the daemons as required by changing the value to `yes` + ### Enable IP & IPv6 forwarding Edit `/etc/sysctl.conf` and set the following values (ignore the other @@ -133,28 +147,16 @@ settings) # Controls source route verification net.ipv4.conf.default.rp_filter = 0 -**Reboot** or use `sysctl` to apply the same config to the running system +Load the modifed sysctl's on the system: + + sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf ### 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) + sudo install -p -m 755 redhat/frr.init /etc/init.d/frr + sudo chkconfig --add frr + +### Enable frr daemon at startup + sudo chkconfig frr on + +### Start FRR manually (or reboot) + sudo /etc/init.d/frr start diff --git a/doc/Building_FRR_on_CentOS7.md b/doc/Building_FRR_on_CentOS7.md index 570d14dee8..3aad84f3c8 100644 --- a/doc/Building_FRR_on_CentOS7.md +++ b/doc/Building_FRR_on_CentOS7.md @@ -1,6 +1,10 @@ Building FRR on CentOS 7 from Git Source ======================================== +(As an alternative to this installation, you may prefer to create a FRR +rpm package yourself and install that package instead. See instructions +in redhat/README.rpm_build.md on how to build a rpm package) + CentOS 7 restrictions: ---------------------- @@ -10,12 +14,11 @@ CentOS 7 restrictions: 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 + 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) --------------------------------------------- @@ -34,18 +37,18 @@ any packages** (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/frrouting/frr.git frr cd frr git checkout stable/2.0 ./bootstrap.sh ./configure \ + --bindir=/usr/bin \ + --sbindir=/usr/lib/frr \ --sysconfdir=/etc/frr \ - --libdir=/usr/lib64/frr \ - --libexecdir=/usr/lib64/frr \ + --libdir=/usr/lib/frr \ + --libexecdir=/usr/lib/frr \ --localstatedir=/var/run/frr \ + --enable-pimd \ --enable-snmp=agentx \ --enable-multipath=64 \ --enable-ospfclient=yes \ @@ -57,9 +60,10 @@ them if you are not building on a x86_64 architecture --disable-exampledir \ --enable-watchfrr \ --enable-tcp-zebra \ + --disable-ldpd \ --enable-fpm \ --with-pkg-git-version \ - --with-pkg-extra-version=-MyOwnFRRVersion + --with-pkg-extra-version=-MyOwnFRRVersion make make check sudo make install @@ -80,6 +84,15 @@ them if you are not building on a x86_64 architecture sudo chown frr:frrvt /etc/frr/vtysh.conf sudo chmod 640 /etc/frr/*.conf +### Install daemon config file + sudo install -p -m 644 redhat/daemons /etc/frr/ + sudo chown frr:frr /etc/frr/daemons + +### Edit /etc/frr/daemons as needed to select the required daemons + +Look for the section with `watchfrr_enable=...` and `zebra=...` etc. +Enable the daemons as required by changing the value to `yes` + ### Enable IP & IPv6 forwarding Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the @@ -91,33 +104,19 @@ following content: 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 +Load the modifed sysctl's on the system: + + sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf -### 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 +### Install frr Service and redhat init files + sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service + sudo install -p -m 755 redhat/frr.init /usr/lib/frr/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) + sudo systemctl preset frr.service + +### Enable required frr at startup + sudo systemctl enable frr + +### Reboot or start FRR manually + sudo systemctl start frr diff --git a/doc/Building_FRR_on_Fedora24.md b/doc/Building_FRR_on_Fedora24.md index 6c5b78b1eb..a1a1c1c0f6 100644 --- a/doc/Building_FRR_on_Fedora24.md +++ b/doc/Building_FRR_on_Fedora24.md @@ -1,14 +1,18 @@ Building FRR on Fedora 24 from Git Source ========================================= +(As an alternative to this installation, you may prefer to create a FRR +rpm package yourself and install that package instead. See instructions +in redhat/README.rpm_build.md on how to build a rpm package) + 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 + 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) --------------------------------------------- @@ -27,17 +31,16 @@ using any packages** (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/frrouting/frr.git frr cd frr git checkout stable/2.0 ./bootstrap.sh ./configure \ + --bindir=/usr/bin \ + --sbindir=/usr/lib/frr \ --sysconfdir=/etc/frr \ - --libdir=/usr/lib64/frr \ - --libexecdir=/usr/lib64/frr \ + --libdir=/usr/lib/frr \ + --libexecdir=/usr/lib/frr \ --localstatedir=/var/run/frr \ --enable-pimd \ --enable-snmp=agentx \ @@ -51,9 +54,10 @@ them if you are not building on a x86_64 architecture --disable-exampledir \ --enable-watchfrr \ --enable-tcp-zebra \ + --enable-ldpd \ --enable-fpm \ --with-pkg-git-version \ - --with-pkg-extra-version=-MyOwnFRRVersion + --with-pkg-extra-version=-MyOwnFRRVersion make make check sudo make install @@ -75,6 +79,15 @@ them if you are not building on a x86_64 architecture sudo chown frr:frrvt /etc/frr/vtysh.conf sudo chmod 640 /etc/frr/*.conf +### Install daemon config file + sudo install -p -m 644 redhat/daemons /etc/frr/ + sudo chown frr:frr /etc/frr/daemons + +### Edit /etc/frr/daemons as needed to select the required daemons + +Look for the section with `watchfrr_enable=...` and `zebra=...` etc. +Enable the daemons as required by changing the value to `yes` + ### Enable IP & IPv6 forwarding (and MPLS) Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the @@ -94,41 +107,26 @@ to `net.mpls.conf.eth0.input=1`) net.mpls.conf.eth2.input=1 net.mpls.platform_labels=100000 +Load the modifed sysctl's on the system: + + sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf + 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) +And load the kernel modules on the running system: + + sudo modprobe mpls-router mpls-iptunnel + +### Install frr Service and redhat init files + sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service + sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frr + +### Enable required frr at startup + sudo systemctl enable frr + +### Reboot or start FRR manually + sudo systemctl start frr