安装FRRouting

 http://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-centos7.html

 

CentOs7 :
git clone https://github.com/frrouting/frr.git frr

或者
git clone -b stable/7.0 https://github.com/frrouting/frr.git frr

安装json

yum install json-c json-c-devel

 

2、 一键安装解决依赖 

 yum install git autoconf automake libtool make \
  readline-devel texinfo net-snmp-devel groff pkgconfig \
  json-c-devel pam-devel bison flex pytest c-ares-devel \
  python-devel systemd-devel python-sphinx libcap-devel

 yum -y install cmake

 

安装yang

cd libyang
mkdir build; cd build
cmake -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr \
      -D CMAKE_BUILD_TYPE:String="Release" ..
make
sudo make install

 

配置用户组

 

[root@host-10-10-18-195 yang]# vim frr.sh
groupadd -g 92 frr
groupadd -r -g 85 frrvty
useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
  -c "FRR FRRouting suite" -d /var/run/frr frr

[root@host-10-10-18-195 yang]# bash frr.sh
groupadd: group 'frr' already exists
groupadd: GID '85' already exists
useradd: group 'frrvty' does not exist

 

 

配置

 

git clone https://github.com/frrouting/frr.git frr
cd frr
./bootstrap.sh
./configure \
    --bindir=/usr/bin \
    --sbindir=/usr/lib/frr \
    --sysconfdir=/etc/frr \
    --libdir=/usr/lib/frr \
    --libexecdir=/usr/lib/frr \
    --localstatedir=/var/run/frr \
    --with-moduledir=/usr/lib/frr/modules \
    --enable-snmp=agentx \
    --enable-multipath=64 \
    --enable-user=frr \
    --enable-group=frr \
    --enable-vty-group=frrvty \
    --enable-systemd=yes \
    --disable-exampledir \
    --disable-ldpd \
    --enable-fpm \
    --with-pkg-git-version \
    --with-pkg-extra-version=-MyOwnFRRVersion \
    SPHINXBUILD=/usr/bin/sphinx-build

 

 


make
make check
sudo make install


[root@host-10-10-18-195 frr-stable-7.3]# install -p -m 644 tools/etc/frr/daemons /etc/frr/
[root@host-10-10-18-195 frr-stable-7.3]# chown frr:frr /etc/frr/daemons
[root@host-10-10-18-195 frr-stable-7.3]# 

[root@host-10-10-18-195 frr-stable-7.3]# touch /etc/sysctl.d/90-routing-sysctl.conf

[root@host-10-10-18-195 frr-stable-7.3]# vim /etc/sysctl.d/90-routing-sysctl.conf
# Sysctl for routing
# #
# # Routing: We need to forward packets
net.ipv4.conf.all.forwarding=1
net.ipv6.conf.all.forwarding=1

 

 

[root@host-10-10-18-195 frr-stable-7.3]# sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
net.ipv4.conf.all.forwarding = 1
net.ipv6.conf.all.forwarding = 1

 

 

[root@host-10-10-18-195 frr-stable-7.3]# install -p -m 644 tools/frr.service /usr/lib/systemd/system/frr.service
[root@host-10-10-18-195 frr-stable-7.3]# systemctl preset frr.service
[root@host-10-10-18-195 frr-stable-7.3]# systemctl enable frr
Created symlink from /etc/systemd/system/multi-user.target.wants/frr.service to /usr/lib/systemd/system/frr.service.
关掉quagga
[root@host-10-10-18-195 frr-stable-7.3]# service bgpd stop
Redirecting to /bin/systemctl stop bgpd.service
[root@host-10-10-18-195 frr-stable-7.3]# service zebra stop
Redirecting to /bin/systemctl stop zebra.service

 

 

配置文件目录

 

 

 

 

 

 

--enable-vty-group=frrvty \
原来是忘记执行:
useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
  -c "FRR FRRouting suite" -d /var/run/frr frr


 


 

 

 

 

 

posted on 2020-02-18 20:29  tycoon3  阅读(1632)  评论(0编辑  收藏  举报

导航