导航

frr安装及ospf组网[后续还需补充](Redirect)

[frr]
-[frr代码,stable有的指令没有,6.0 vs 7.0]
 git clone https://github.com/frrouting/frr.git
 git clone -b stable/7.1 https://github.com/frrouting/frr.git
-[官方安装说明]
  http://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-ubuntu1804.html
  我跑ospf老挂死,原因在于configure时,需要的模块要加入编译
  安装frr的deb包就不会有这个问题,因为别人默认全编
 
-[预装2个库,libyang,librtr]
  libyang要求libpcre3-dev
 
 
-[预装软件]
--[官网给出]  
sudo apt-get install \
   git autoconf automake libtool make libreadline-dev texinfo \
   pkg-config libpam0g-dev libjson-c-dev bison flex python3-pytest \
   libc-ares-dev python3-dev libsystemd-dev python-ipaddress python3-sphinx \
   install-info build-essential libsystemd-dev libsnmp-dev perl libcap-dev
sudo apt-get install protobuf-c-compiler libprotobuf-c-dev
sudo apt-get install libzmq5 libzmq3-dev
--[编译发现]
apt install 
build-essential
libcap-dev
libsnmp-dev
libjson-c-dev
 
sudo apt-get install \
libsqlite3-dev libunwind-dev libbsd-dev libpcre3-dev
apt install python-pip
pip install cpython
apt install libssh-dev 
apt install gawk cmake
 
[我的configure命令]
./configure \
--prefix=/usr \
CFLAGS=-g \
--includedir=\${prefix}/include \
--enable-exampledir=\${prefix}/share/doc/frr/examples \
--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 \
--enable-ospfd=yes \
--enable-ospfapi=yes \
--enable-ospfclient=yes \
--enable-watchfrr=yes \
--enable-systemd=yes \
--enable-staticd=yes \
--enable-backtrace=yes \
--enable-dev-build=yes \
--enable-vtysh=yes \
--enable-shell-access=yes \
--enable-config-rollbacks=yes
 
[frr /etc/frr/daemons 修改]
watchfrr_enable=yes
zebra=yes
ospfd=yes
 
[frr ospf配置-粗略]
 
vtysh
conf t
router ospf
    ospf router-id 192.168.2.201
    network 30.1.1.0/24 area 0.0.0.0
    network 40.1.1.0/24 area 0.0.0.0
    
q
interface enp0s3
    ip ospf network point-to-point
q
interface enp0s8
    ip ospf network point-to-point
q
q
q
 
 
[ospf组网]
[三台virtualbox,均intra network,1号frr30,2号frr40,3号两个网卡,frr30和frr40各一个,要求起完ospf,1号2号能通]
 
[本机做DHCP代理,两个网段]
VBoxManage dhcpserver add --network frr30 --server-ip 30.1.1.1 --netmask 255.255.255.0 --lowerip 30.1.1.2 --upperip 30.1.1.20 --enable
VBoxManage dhcpserver add --network frr40 --server-ip 40.1.1.1 --netmask 255.255.255.0 --lowerip 40.1.1.2 --upperip 40.1.1.20 --enable
https://www.virtualbox.org/manual/ch08.html#vboxmanage-dhcpserver
 
[ps]
virtualbox的几种网络适配器简单说明,完全不负责任版
1.bridge
  可以访问外网,局域网内其他主机可以ssh上
2.nat
  可以访问外网,局域网内其他主机ping不通,多台VM相互之间ping不通
3.intra network
  多台VM同网段相互可以ping通,但必须有分配ip的机制

posted on 2022-04-20 16:48  toughcactus  阅读(739)  评论(0编辑  收藏  举报