由于学习需要,在LXC内配FRR。

首先进入FRR官网找到Ubuntu20.04版本操作指南

Ubuntu 20.04 LTS — FRR latest documentation

1.安装环境依赖

sudo apt update
sudo apt-get install \git autoconf automake libtool make libreadline-dev texinfo \pkg-config libpam0g-dev libjson-c-dev bison flex \libc-ares-dev python3-dev python3-sphinx \install-info build-essential libsnmp-dev perl \libcap-dev python2 libelf-dev libunwind-dev

2.首先安装curl工具包,在进行如下操作

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 ./get-pip.py# And verify the installation
pip2 --version

3.安装FRR

git clone https://github.com/CESNET/libyang.git
cd libyang
git checkout v2.0.0
mkdir build; cd build
cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr \-D CMAKE_BUILD_TYPE:String="Release" ..
make
sudo make install

注意:在执行cmake前,要安装cmake以及libpcre2-dev工具包

4.执行如下命令

sudo apt-get install protobuf-c-compiler libprotobuf-c-dev
sudo apt-get install libzmq5 libzmq3-dev

5.配置FRR用户

sudo groupadd -r -g 92 frr
sudo groupadd -r -g 85 frrvty
sudo adduser --system --ingroup frr --home /var/run/frr/ \--gecos "FRR suite" --shell /sbin/nologin frr
sudo usermod -a -G frrvty frr

6.编译

git clone https://github.com/frrouting/frr.git frr
cd frr
./bootstrap.sh
./configure \--prefix=/usr \--includedir=\${prefix}/include \--bindir=\${prefix}/bin \--sbindir=\${prefix}/lib/frr \--libdir=\${prefix}/lib/frr \--libexecdir=\${prefix}/lib/frr \--localstatedir=/var/run/frr \--sysconfdir=/etc/frr \--with-moduledir=\${prefix}/lib/frr/modules \--with-libyang-pluginsdir=\${prefix}/lib/frr/libyang_plugins \--enable-configfile-mask=0640 \--enable-logfile-mask=0640 \--enable-snmp=agentx \--enable-multipath=64 \--enable-user=frr \--enable-group=frr \--enable-vty-group=frrvty \--with-pkg-git-version \--with-pkg-extra-version=-MyOwnFRRVersion
make
sudo make install

7.安装FRR文件

sudo install -m 775 -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 frrvty tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf
sudo install -m 640 -o frr -g frr tools/etc/frr/frr.conf /etc/frr/frr.conf
sudo install -m 640 -o frr -g frr tools/etc/frr/daemons.conf /etc/frr/daemons.conf
sudo install -m 640 -o frr -g frr tools/etc/frr/daemons /etc/frr/daemons

8.修改文件

修改 /etc/sysctl.conf

# 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

执行 sysctl -p 刷新 看到net.ipv4.ip_forward=1  net.ipv6.conf.all.forwarding=1即可

9.添加内核

/etc/modules-load.d/modules.conf中添加

# Load MPLS Kernel Modules
mpls_router
mpls_iptunnel

随后,在主机上先执行

sudo modprobe mpls-router mpls-iptunnel

然后在lxc容器中执行一次

如果容器中执行出错,尝试apt-get install linux-modules-extra-`uname -r`-generic

如果以上代码出错,去除generic

10.MPLS

在/etc/sysctl.conf添加

# 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

注意:eth1,eth2网卡如果没有。需要注释掉

执行sysctl -p 刷新一次

11.安装服务文件

sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
sudo systemctl enable frr

注意:命令在你创立的frr目录下进行

12.最后调整

打开 /etc/frr/daemons,找到watchfrr_enable=... and zebra=...,修改为yes

13.开始服务

systemctl start frr

启动frr 使用命令vtysh

Ubuntu20.04环境上在LXC内安装FRR相关推荐

  1. FRR(1):Ubuntu环境上在LXC内安装FRR

    新建一个lxc的Ubuntu容器,再进行下列操作. 1 安装环境依赖 sudo apt-get install \git autoconf automake libtool make libreadl ...

  2. DELL戴尔Win10双硬盘安装Ubuntu20.04双系统(附带ROS安装教程)

    DELL戴尔Win10双硬盘安装Ubuntu20.04双系统(附带ROS安装教程) 1.安装场景及注意事项 1.1.确认电脑的引导方式 1.2.关闭电脑BitLocker硬盘保护 2.安装步骤 2.1 ...

  3. 【Ubuntu系列】Ubuntu20.04系统下3060显卡驱动安装记录

    [Ubuntu系列]Ubuntu20.04系统下3060显卡驱动安装记录 设备及相关信息简介 具体安装步骤 step1 获取显卡硬件信息 step2 在Ubuntu系统中卸载显卡驱动 step3 安装 ...

  4. 腾讯云ubuntu20.04,免密登录,安装anaconda,并安装远程jupyter notebook,TensorFlow

    腾讯云ubuntu20.04,免密登录,安装anaconda,并安装远程jupyter notebook,TensorFlow 免密登录 下载anaconda 安装TensorFlow 安装jupyt ...

  5. ubuntu20.04使用花生壳实现内网穿透

    ubuntu20.04使用花生壳实现内网穿透 花生壳内网穿透个人免费,这点值得点赞啊!!! 先决条件 本地ubuntu电脑必须开启 ssh服务 sudo apt-get install openssh ...

  6. Ubuntu20.04环境下编译MNN

    前言 MNN是一个轻量级的深度神经网络推理引擎,在端侧加载深度神经网络模型进行推理预测.目前,MNN已经在阿里巴巴的手机淘宝.手机天猫.优酷等20多个App中使用,覆盖直播.短视频.搜索推荐.商品图像 ...

  7. ubuntu20.04环境下安装opencv教程及测试

    目录 一.安装opencv (1)下载opencv-3.4.15数据包 (2)解压 (3)使用cmake安装opencv (4)使用make创建编译 (5) 安装 二.配置环境 三.实例 (1)打开图 ...

  8. 在Ubuntu20.04系统上LIO-SAM跑KITTI数据集和自己数据集代码修改

    LIO-SAM跑KITTI数据集和自己数据集代码修改 一.编译并运行LIO-SAM 二.代码修改 1.cloud_info.msg 2.imageProjection.cpp 三.KITTI数据集准备 ...

  9. Ubuntu20.04+MAVROS+PX4+Gazebo保姆级安装教程

    Ubuntu20.04+MAVROS+PX4+Gazebo 安装PX4步骤 安装MAVROS 安装QGC PX4仿真 安装PX4步骤 从github上clone源码 git clone https:/ ...

最新文章

  1. cmd进入Oracle的sql*plus
  2. mysql-mmm故障解决一例
  3. sklearn中的交叉验证(Cross-Validation)
  4. C#中怎样在ToolStripMenuItem下再添加子级菜单
  5. 【C++】 C++标准模板库(三) Map
  6. 5G实时直播至关重要的4个原因
  7. linux工具:ssh---未完
  8. Pytorch出现RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor)
  9. 博客园---博客美化汇总
  10. SQL注入学习part04:(结合sqli-libs学习:31-40关)
  11. iOS开发CGRectGetMidX. CGRectGetMidY.CGRectGetMinY. CGRectGetMaxY. CGRectGetMinX. CGRectGetMaxX的使用...
  12. Android Studio工程中添加移动广告平台广告条代码教程
  13. mysql 针对table的查看命令行
  14. WEB项目优化:雅虎优化网站的34条法则(转)
  15. 终端代码重复率检测实践
  16. python笔记2—day2
  17. Linux下wps文档结构图,wps文字的文档结构图
  18. 计算机式硬盘录像机,全面分析PC式硬盘录像机十大问题
  19. 规则引擎 Drools--决策表(Decision Table)使用简介
  20. ROS示例----导航功能包Husky_exploration

热门文章

  1. Java计算两个日期的相差天数以及除去双休日的相差天数
  2. Java--@Transient关键字
  3. java悲观锁_Java乐观锁、悲观锁
  4. 初步学习mediasoup
  5. ng-alain+ABP Angular8版本出现关于abp不存在的问题解决办法
  6. kodi没有中文设置_kodi播放器如何设置为中文界面-kodi播放器设置中文的方法 - 河东软件园...
  7. 标准FSK调制解调matlab仿真
  8. aardio名字空间库的扩展方法(四)
  9. 数字图像处理——高斯低通、高通滤波算法
  10. Windows使用Openssl生成免费证书