FRR编译及配置(旧版)

2023-10-27

本文最新状态可点击查看https://turbock79.cn/?p=334

CSDN可点击查看https://blog.csdn.net/turbock/article/details/107039031

爬坑

本文基于官方文档进行编译,发现构建文档并未及时更新,其中部分爬坑过程在此记录一下。此处用make install,出现如下报错;

     1. CentOS7 默认Git版本为1.8.3,版本过早,导致编译之前一些依赖无法安装。需要升级Git版本,本文升级2.25。升级方法可参看文章https://blog.csdn.net/turbock/article/details/103761644

     2.官方文档http://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-centos7.html ,其中可能安装frr服务和初始化文件存在问题。无法找到路径redhat/frr.service中文件,现在已转移到tools目录下面。同时没有frr.init文件生成,此处可忽略。

编译FRR方法

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

#make install命令之后
sudo find . -name frr.service
sudo cp ./tools/frr.service /etc/systemd/system/frr.service
#install -p -m 644 ./tools/frr.service /usr/lib/systemd/system/frr.service

参考文档http://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-centos7.html#install-required-packages 

创建FRR 配置文件

#./configure命令之后
mkdir -p /etc/frr
sudo chmod -R 777 /etc/frr
mkdir -p /var/run/frr
sudo chmod -R 777 /var/run/frr

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/nhrpd.conf
sudo touch /etc/frr/eigrpd.conf
sudo touch /etc/frr/babeld.conf
sudo chown -R frr:frr /etc/frr/
sudo touch /etc/frr/vtysh.conf
sudo chown frr:frrvty /etc/frr/vtysh.conf
sudo chmod 640 /etc/frr/*.conf

Install daemon config file

sudo install -p -m 644 tools/etc/frr/daemons /etc/frr/
sudo chown frr:frr /etc/frr/daemons

启动服务frr(systemctl start frr)后,通过修改配置文件,修改配置。通过命令systemctl reload frr热加载配置。配置文件都在/etc/frr目录中通过命令vtysh进入frr操作界面

 

Edit /etc/frr/daemons as needed to select the required daemons

创建frr默认配置文件/etc/frr/daemon,修改相关配置如下。判断是否开启zebra、bgp等功能;设置watchfrr_enable=... 和zebra=...为yes。查看官方文档http://docs.frrouting.org/en/latest/setup.html

创建frr默认配置文件/etc/frr/frr.conf

!
! Zebra configuration file
!
frr version 6.0
frr defaults traditional
!
hostname Router
password zebra
enable password zebra
!
log stdout
!
!

4.启动服务后,可以动态启动其中插件。可以参看文章http://docs.frrouting.org/en/latest/setup.html#starting-a-new-daemon修改文件/etc/frr/daemons。例如启动bgpd则修改如下图,然后通过命令service frr reload热加载配置。通过netstat -tunlp| grep bgpd可以查看是否开启bgp守护进程。


官方文档编译

CentOS 7

文章描述如何通过源码安装FRR。如果想要构建一个RPM包,查看 Packaging Red Hat

CentOS 7 限制:

CentOS 7 默认内核不支持MPLS,需要内核级别4.5或更高。

安装依赖包

Add packages:

sudo 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

FRR depends on the relatively new libyang library to provide YANG/NETCONF support. Unfortunately, most distributions do not yet offer a libyang package from their repositories. Therefore we offer two options to install this library.

1: 二进制安装

The FRR project builds binary libyang packages, which we offer for download here.

Warning

libyang version 0.16.105 or newer is required to build FRR.

Note

The libyang development packages need to be installed in addition to the libyang core package in order to build FRR successfully. Make sure to download and install those from the link above alongside the binary packages.

Depending on your platform, you may also need to install the PCRE development package. Typically this is libpcre-dev or pcre-devel.

Note

For Debian-based systems, the official libyang package requires recent versions of swig(3.0.12) and debhelper (11) which are only available in Debian buster (10). However, libyangpackages built on Debian buster can be installed on both Debian jessie (8) and Debian stretch (9), as well as various Ubuntu systems. The python3-yang package will not work, but the other packages (libyang-dev is the one needed for FRR) will.

Option 2:源码安装

Note

Ensure that the libyang build requirements are met before continuing. Usually this entails installing cmake and libpcre-dev or pcre-devel.

git clone https://github.com/CESNET/libyang.git
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

When building libyang version 0.16.x it’s also necessary to pass the -DENABLE_CACHE=OFFparameter to cmake to work around a known bug in libyang.

获取FRR,编译并安装 (from Git)

Add frr groups and user

sudo groupadd -g 92 frr
sudo groupadd -r -g 85 frrvty
sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
  -c "FRR FRRouting 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.)

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

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/nhrpd.conf
sudo touch /etc/frr/eigrpd.conf
sudo touch /etc/frr/babeld.conf
sudo chown -R frr:frr /etc/frr/
sudo touch /etc/frr/vtysh.conf
sudo chown frr:frrvty /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 following content:

# Sysctl for routing
#
# Routing: We need to forward packets
net.ipv4.conf.all.forwarding=1
net.ipv6.conf.all.forwarding=1

Load the modified sysctl’s on the system:

sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf

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 frr.service

Enable required frr at startup

sudo systemctl enable frr

Reboot or start FRR manually

sudo systemctl start frr
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

FRR编译及配置(旧版) 的相关文章

  • VR引擎哪家强?主流VR开发引擎大起底

    转载自 http www hiavr com news tech 22826 html ref myread 在VR浪潮面前 Unreal Unity CryENGINE各大游戏引擎纷纷跟进 都决心抓住这个绝无仅有的机会 一举奠定自己的江湖
  • AutoML-A survey of the state-of-the art翻译+总结

    AutoML A Survey of the State of the Art Abstract 深度学习 DL 技术已经渗透到我们生活的各个方面 给我们带来了极大的方便 然而 为特定任务构建高质量的DL系统高度依赖于人类的专业知识 这阻碍
  • Docker 镜像基本命令操作

    目录标题 Docker 镜像基本命令操作 一 Docker 安装 二 镜像操作 Docker 镜像基本命令操作 一 Docker 安装 Docker要求运行在Centos 7上 要求系统为64位 系统内核版本3 10以上 1 uname a
  • 鸿蒙os更新名单,鸿蒙系统首批升级名单 华为鸿蒙系统升级机型名单时间表

    2021年6月2日 在这天华为公布了一直津津乐道的鸿蒙系统 并且推出了HarmonyOS2百机升级计划 一共是分为四个阶段来进行升级 很多朋友还不清楚升级的机型名单和时间都是多少 下面就来为大家分享一下 第一批升级名单 6月2日就可以升级
  • 单电源运放滤波器设计

    在很多情况中 为了阻挡由于虚地引起的直流电平 在 运放的输入端串入了电容 这个电容实际上是一个高通滤波器 在某种意义上说 像这样的单电源运放电 路都有这样的电容 设计者必须确定这个电容的容量必须要比电路中的其他电容器的容量大 100倍以上
  • 模拟开关选型、多路复用器选型

    只列举常用的 芯片均出自TI ADI SGM Nexperia等 国产只考虑CH 泌恒 个人整理 tb均能买到 如有纰漏欢迎纠错
  • 残差网络、Dropout正则化、Batch Normalization浅了解

    残差网络 为什么需要残差网络 残差网络的目的是为了解决深度神经网络在训练过程中遇到的退化问题 即随着网络层数的增加 训练集的误差反而增大 而不是过拟合 残差网络的优点有以下几点 残差网络可以有效地缓解梯度消失或爆炸的问题 因为跳跃连接可以提
  • Python中如何将浮点型数据转换成整型

    在 Python 中 可以使用内置函数 int 将浮点型数据转换为整型 例如 a 3 14 b int a print b 输出结果为 3 注意 转换为整型时 会将浮点数四舍五入到最接近的整数
  • Android 创建淡入淡出动画的详解

    博主前些天发现了一个巨牛的人工智能学习网站 通俗易懂 风趣幽默 忍不住也分享一下给大家 点击跳转到网站 介绍 淡入淡出动画 也称为 叠化 逐渐淡出一个 View 或 ViewGroup 同时淡入另一个 此动画适用于您希望在应用中切换内容或视
  • 华为机考 创建二叉树 javascript

    请按下列描达构建一颗二叉树 并返回该树的根节点 1 先创建值为 1的根结点 根节点在第0层 2 然后根据operations依次添加节点 operations i height index 表示对第 height 层的第index 个节点n
  • 适合小白入门Spark的全面教程

    问题导读1 spark有哪些使用场景 2 spark有包含哪些组件 3 spark在哪些厂商已经应用 4 spark如何实现地震检测 Apache Spark是一个用于实时处理的开源集群计算框架 它是Apache软件基金会中最成功的项目 S
  • python学习3. 无重复字符的最长子串(滑动窗口)

    makcooo 2019 04 19 15 47 32 271 收藏 分类专栏 python 版权 给定一个字符串 请你找出其中不含有重复字符的 最长子串 的长度 示例 1 输入 abcabcbb 输出 3 解释 因为无重复字符的最长子串是
  • impala对元数据的界面更新操作

    执行 impala shell 即能进入界面操作sql 如果在hive更新了数据之后 而在impala中却无法看到更新后的数据的话 意味着impala里元数据信息还没有刷新 此时在impala操作界面里 执行 invalidate meta
  • 随机数生成方法及其应用

    目录 一 前言 二 伪随机数发生器介绍 三 均匀随机数发生器 四 任意概率分布的随机数发生器 五 产生特定要求的随机数 六 参考资料 一 前言 最近公司的一个项目 需要对一个功能模块进行性能验证 具体什么模块就不说了 验证过程中需要生成大量
  • 2022 年 5 个新 sudo 功能

    导读 最近的 sudo 版本增加了新的功能 使你能够观察和控制以前隐藏的问题 当你想授予你的一些用户管理权限 同时控制和检查他们在你的系统上做什么时 你会使用 sudo 然而 即使是 sudo 也有相当多不可控的地方 想想给予 shell
  • G1收集器特质以及分代理论

    特征 被视为JDK1 7以上版本Java虚拟机的一个重要进化特征 它具备以下特点 并行与并发 G1能充分利用CPU 多核环境下的硬件优势 使用多个CPU CPU或者CPU核心 来缩短Stop The World停顿时间 部分其他收集器原本需
  • 3dsmax Node Event System

    Node Event System 3dsmax 节点事件系统 https help autodesk com view MAXDEV 2022 ENU guid GUID 7C91D285 5683 4606 9F7C B8D3A7CA5
  • Linux网络——PXE高效批量网络装机

    Linux网络 PXE高效批量网络装机 一 PXE远程安装服务 1 PXE批量部署的优点 2 搭建PXE网络体系的安装条件 二 PXE 安装进行前的配置 1 PXE装机所需的文件 2 搭建 PXE 过程中使用的服务和程序 DHCP服务 vs
  • Linux上安装JDK、mysql、tomcat,以及将springboot项目部署到Linux上

    安装jdk 1下载jdk并放入linux系统 2解压 mkdir usr local java 创建文件夹 等下就将jdk解压到这里 tar zxvf jdk 8u181 linux x64 tar gz C usr local java

随机推荐

  • 最新模拟登录12306(破解12306验证码)

    最新模拟登录12306 破解12306验证码 重点 对12306验证码的破解 仅供学习交流 请勿 1 找到验证码的图片信息 2 点开headers查看 不难发现是经过base64加密的图片 但是没有请求的url 3 再查看分析发现 上面的一
  • 时序预测

    时序预测 Matlab实现CNN XGBoost卷积神经网络结合极限梯度提升树时间序列预测 目录 时序预测 Matlab实现CNN XGBoost卷积神经网络结合极限梯度提升树时间序列预测 效果一览 基本描述 程序设计 参考资料 效果一览
  • OL-CC:首个众包形式、人工生成的开源中文对话指令集

    数据是训练大模型必不可少的 燃料 但目前的数据集由不同的机构构建 存储分散 难以整合 高质量数据集的建设成本高昂 当前由于商业竞争等原因 导致数据上形成了各自为战的局面 大家无法将分散的数据整合到一起发挥更大的作用 2 月底 智源研究院发布
  • mycat2.0 分库分表报错 3002 - ERROR-CODE: [MYCAT-3002][ERR_FETCH_METADATA] MetadataManager init fail

    1 安装好mycat2 0之后 执行sql进行分库分表 DROP TABLE sys user CREATE TABLE sys user id bigint 0 NOT NULL AUTO INCREMENT COMMENT id use
  • 程序员在囧途之垃圾创业团队 .

    转载地址 https yq aliyun com articles 48175 utm campaign wenzhang utm medium article utm source QQ qun 2017316 utm content m
  • JMeter —— Jar包性能测试 完整流程教学

    本文只使用简单用例演示项目打包为Jar并上JMeter测试的整个过程 关于高级用法请看官方文档 官方文档链接 http jmeter apache org usermanual 一 下载JMeter 官网链接 https jmeter ap
  • Chisel Tutorial(五)——Bundles与Vecs

    以下内容依据2015 7 10版的Chisel 2 2 Tutorial整理 此处的Bundles Vecs就不翻译了 免得因为翻译不准引起一些误解 童鞋们有没有好的建议 lt
  • SpringBoot+Hutool工具类Excel工具-ExcelUtil实现excel文件的导入导出

    Hutool会用的话极大了简化了操作Excel的过程 提高开发效率 废话少说上代码 excel文件导出 public void downLoadFile UserDto dto HttpServletResponse response St
  • kvm虚拟化简介

    1 KVM介绍 KVM是一个基于Linux内核的虚拟机 它属于完全虚拟化范畴 从Linux 2 6 20开始被包含在Linux内核中 KVM基于x86硬件虚拟化技术 它的运行要求Intel VT x或AMD SVM的支持 一般认为 虚拟机监
  • synchronized原理分析

    Java 高并发专题之synchronized关键字 1 synchronized作为jvm关键字有三个作用域 synchronized作用于实例方法 锁住的当前对象 只有当前对象被锁住 新new出来的对象不会被锁住 synchronize
  • 基于python+MobileNetV2算法模型实现一个图像识别分类系统

    一 目录 算法模型介绍 模型使用训练 模型评估 项目扩展 二 算法模型介绍 图像识别是计算机视觉领域的重要研究方向 它在人脸识别 物体检测 图像分类等领域有着广泛的应用 随着移动设备的普及和计算资源的限制 设计高效的图像识别算法变得尤为重要
  • 代理IP与Socks5代理:跨界电商智能爬虫的引擎与安全壁垒

    一 代理IP 智能爬虫的引擎 多地区数据采集 代理IP允许企业模拟不同地区的IP地址 轻松实现多地区数据采集 这为企业洞察全球市场需求提供了重要数据支持 规避反爬虫机制 代理IP通过随机切换IP地址 规避了网站的反爬虫机制 确保数据采集的稳
  • 7.31黄金最新行情走势分析及多空交易策略

    近期有哪些消息面影响黄金走势 黄金多空该如何研判 黄金消息面解析 上周有重磅数据美联储加息的消息 黄金受其影响波动比较频繁 总体空间40美金 但这个过程跌宕起伏 收线来看黄金在连续上涨三周后迎来一根小阴十字星线 多头动能有所减弱 上周四加息
  • 【读书笔记】Java NIO (中文版) 读书笔记

    概述 这本书讲解的一般吧 主要是讲解了 缓冲区 通道 选择器 正则表达式 字符集 主要是讲解了api的使用 以及部分系统知识 比较底层了 而且大部分都是代码的源码讲解 或者api使用的讲解 太细致了 学netty之前可以看看这个 或者两者互
  • 协同过滤推荐算法

    一 协同过滤思想简介 二 协同过滤算法原理介绍 三 基于用户的协同过滤算法描述 四 基于物品的协同过滤算法 基于物品的协同过滤算法的优缺点 一 协同过滤思想简介 协同过滤 从字面上理解 包括协同和过滤两个操作 首先我们在外出和朋友吃饭的时候
  • 【操作系统】王道考研 p54-56 文件共享、文件保护、文件系统的层次结构

    文件共享 文件保护 文件系统的层次结构 知识总览 以下是文件共享的内容 基于索引结点的共享方式 硬链接 用一个count来记录在使用这个文件的用户的个数 当用户删除文件 则用户目录的该文件目录项删除 并count 1 当count 0 则系
  • 安装Oracle EE

    前期 进入自己需要设置的目录 创建文件夹 文件夹授权 mkdir xxx chmod o w oracle oradata chmod 777 oracle oradata 安装ORACLE EE 1 查找镜像 docker search
  • 【Java基础】File类 IO流

    个人简介 gt 个人主页 是Lay的主页 gt 学习方向 JAVA后端开发 gt 种一棵树最好的时间是十年前 其次是现在 gt 往期文章 Java基础 面向对象进阶 二 gt 喜欢的话麻烦点点关注喔 你们的支持是我的最大动力 目录 1 Fi
  • SeetaFaceEngine安装和测试

    一 介绍 必须安装好opencv SeetaFace人脸识别引擎包括了搭建一套全自动人脸识别系统所需的三个核心模块 即 人脸检测模块SeetaFace Detection 面部特征点定位模块SeetaFace Alignment以及人脸特征
  • FRR编译及配置(旧版)

    本文最新状态可点击查看https turbock79 cn p 334 CSDN可点击查看https blog csdn net turbock article details 107039031 爬坑 本文基于官方文档进行编译 发现构建文