forked from Mirror/frr
Merge pull request #14890 from louis-6wind/exabgp4
topotests: convert to exabgp 4 and python3
This commit is contained in:
commit
0d57a9a954
|
@ -15,7 +15,7 @@ Installing Dependencies
|
||||||
pkg-config libpam0g-dev libjson-c-dev bison flex \
|
pkg-config libpam0g-dev libjson-c-dev bison flex \
|
||||||
libc-ares-dev python3-dev python3-sphinx \
|
libc-ares-dev python3-dev python3-sphinx \
|
||||||
install-info build-essential libsnmp-dev perl \
|
install-info build-essential libsnmp-dev perl \
|
||||||
libcap-dev python2 libelf-dev libunwind-dev
|
libcap-dev libelf-dev libunwind-dev
|
||||||
|
|
||||||
.. include:: building-libunwind-note.rst
|
.. include:: building-libunwind-note.rst
|
||||||
|
|
||||||
|
@ -23,18 +23,6 @@ Note that Ubuntu 20 no longer installs python 2.x, so it must be
|
||||||
installed explicitly. Ensure that your system has a symlink named
|
installed explicitly. Ensure that your system has a symlink named
|
||||||
``/usr/bin/python`` pointing at ``/usr/bin/python3``.
|
``/usr/bin/python`` pointing at ``/usr/bin/python3``.
|
||||||
|
|
||||||
In addition, ``pip`` for python2 must be installed if you wish to run
|
|
||||||
the FRR topotests. That version of ``pip`` is not available from the
|
|
||||||
ubuntu apt repositories; in order to install it:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
.. include:: building-libyang.rst
|
.. include:: building-libyang.rst
|
||||||
|
|
||||||
Protobuf
|
Protobuf
|
||||||
|
|
|
@ -15,7 +15,7 @@ Installing Dependencies
|
||||||
pkg-config libpam0g-dev libjson-c-dev bison flex \
|
pkg-config libpam0g-dev libjson-c-dev bison flex \
|
||||||
libc-ares-dev python3-dev python3-sphinx \
|
libc-ares-dev python3-dev python3-sphinx \
|
||||||
install-info build-essential libsnmp-dev perl \
|
install-info build-essential libsnmp-dev perl \
|
||||||
libcap-dev python2 libelf-dev libunwind-dev \
|
libcap-dev libelf-dev libunwind-dev \
|
||||||
libyang2 libyang2-dev
|
libyang2 libyang2-dev
|
||||||
|
|
||||||
.. include:: building-libunwind-note.rst
|
.. include:: building-libunwind-note.rst
|
||||||
|
@ -29,18 +29,6 @@ installed explicitly. Ensure that your system has a symlink named
|
||||||
sudo ln -s /usr/bin/python3 /usr/bin/python
|
sudo ln -s /usr/bin/python3 /usr/bin/python
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
In addition, ``pip`` for python2 must be installed if you wish to run
|
|
||||||
the FRR topotests. That version of ``pip`` is not available from the
|
|
||||||
ubuntu apt repositories; in order to install it:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
Protobuf
|
Protobuf
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
|
|
|
@ -8,14 +8,12 @@ Topotests is a suite of topology tests for FRR built on top of micronet.
|
||||||
Installation and Setup
|
Installation and Setup
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
Topotests run under python3. Additionally, for ExaBGP (which is used
|
Topotests run under python3.
|
||||||
in some of the BGP tests) an older python2 version (and the python2
|
|
||||||
version of ``pip``) must be installed.
|
|
||||||
|
|
||||||
Tested with Ubuntu 20.04,Ubuntu 18.04, and Debian 11.
|
Tested with Ubuntu 20.04,Ubuntu 18.04, and Debian 11.
|
||||||
|
|
||||||
Instructions are the same for all setups (i.e. ExaBGP is only used for
|
Instructions are the same for all setups. However, ExaBGP is only used for
|
||||||
BGP tests).
|
BGP tests.
|
||||||
|
|
||||||
Tshark is only required if you enable any packet captures on test runs.
|
Tshark is only required if you enable any packet captures on test runs.
|
||||||
|
|
||||||
|
@ -39,8 +37,7 @@ Installing Topotest Requirements
|
||||||
python3 -m pip install 'pytest-xdist>=2.3.0'
|
python3 -m pip install 'pytest-xdist>=2.3.0'
|
||||||
python3 -m pip install 'scapy>=2.4.5'
|
python3 -m pip install 'scapy>=2.4.5'
|
||||||
python3 -m pip install xmltodict
|
python3 -m pip install xmltodict
|
||||||
# Use python2 pip to install older ExaBGP
|
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
|
||||||
python2 -m pip install 'exabgp<4.0.0'
|
|
||||||
useradd -d /var/run/exabgp/ -s /bin/false exabgp
|
useradd -d /var/run/exabgp/ -s /bin/false exabgp
|
||||||
|
|
||||||
# To enable the gRPC topotest install:
|
# To enable the gRPC topotest install:
|
||||||
|
|
|
@ -52,7 +52,7 @@ RUN apt update && apt upgrade -y && \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
lua5.3 \
|
lua5.3 \
|
||||||
net-tools \
|
net-tools \
|
||||||
python2 \
|
python3 \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
snmp \
|
snmp \
|
||||||
snmp-mibs-downloader \
|
snmp-mibs-downloader \
|
||||||
|
@ -67,9 +67,6 @@ RUN apt update && apt upgrade -y && \
|
||||||
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/iana/IANA-IPPM-METRICS-REGISTRY-MIB -O /usr/share/snmp/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB && \
|
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/iana/IANA-IPPM-METRICS-REGISTRY-MIB -O /usr/share/snmp/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB && \
|
||||||
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/SNMPv2-PDU -O /usr/share/snmp/mibs/ietf/SNMPv2-PDU && \
|
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/SNMPv2-PDU -O /usr/share/snmp/mibs/ietf/SNMPv2-PDU && \
|
||||||
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/IPATM-IPMC-MIB -O /usr/share/snmp/mibs/ietf/IPATM-IPMC-MIB && \
|
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/IPATM-IPMC-MIB -O /usr/share/snmp/mibs/ietf/IPATM-IPMC-MIB && \
|
||||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py && \
|
|
||||||
python2 /tmp/get-pip.py && \
|
|
||||||
rm -f /tmp/get-pip.py && \
|
|
||||||
python3 -m pip install wheel && \
|
python3 -m pip install wheel && \
|
||||||
python3 -m pip install pytest && \
|
python3 -m pip install pytest && \
|
||||||
python3 -m pip install pytest-sugar && \
|
python3 -m pip install pytest-sugar && \
|
||||||
|
@ -77,7 +74,7 @@ RUN apt update && apt upgrade -y && \
|
||||||
python3 -m pip install "scapy>=2.4.2" && \
|
python3 -m pip install "scapy>=2.4.2" && \
|
||||||
python3 -m pip install xmltodict && \
|
python3 -m pip install xmltodict && \
|
||||||
python3 -m pip install grpcio grpcio-tools && \
|
python3 -m pip install grpcio grpcio-tools && \
|
||||||
python2 -m pip install 'exabgp<4.0.0'
|
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
|
||||||
|
|
||||||
RUN groupadd -r -g 92 frr && \
|
RUN groupadd -r -g 92 frr && \
|
||||||
groupadd -r -g 85 frrvty && \
|
groupadd -r -g 85 frrvty && \
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
[exabgp.api]
|
[exabgp.api]
|
||||||
|
ack = false
|
||||||
encoder = text
|
encoder = text
|
||||||
highres = false
|
highres = false
|
||||||
respawn = false
|
respawn = false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 1 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 1 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 1;
|
||||||
run "/etc/exabgp/exa-receive.py 1";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.1.1 {
|
||||||
|
router-id 10.0.1.101;
|
||||||
neighbor 10.0.1.1 {
|
local-address 10.0.1.101;
|
||||||
router-id 10.0.1.101;
|
local-as 99;
|
||||||
local-address 10.0.1.101;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 10 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 10 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 10;
|
||||||
run "/etc/exabgp/exa-receive.py 10";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.2.1 {
|
||||||
|
router-id 10.0.2.110;
|
||||||
neighbor 10.0.2.1 {
|
local-address 10.0.2.110;
|
||||||
router-id 10.0.2.110;
|
local-as 99;
|
||||||
local-address 10.0.2.110;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 11 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 11 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 11;
|
||||||
run "/etc/exabgp/exa-receive.py 11";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.3.1 {
|
||||||
|
router-id 10.0.3.111;
|
||||||
neighbor 10.0.3.1 {
|
local-address 10.0.3.111;
|
||||||
router-id 10.0.3.111;
|
local-as 111;
|
||||||
local-address 10.0.3.111;
|
peer-as 100;
|
||||||
local-as 111;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 12 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 12 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 12;
|
||||||
run "/etc/exabgp/exa-receive.py 12";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.3.1 {
|
||||||
|
router-id 10.0.3.112;
|
||||||
neighbor 10.0.3.1 {
|
local-address 10.0.3.112;
|
||||||
router-id 10.0.3.112;
|
local-as 112;
|
||||||
local-address 10.0.3.112;
|
peer-as 100;
|
||||||
local-as 112;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 13 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 13 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 13;
|
||||||
run "/etc/exabgp/exa-receive.py 13";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.3.1 {
|
||||||
|
router-id 10.0.3.113;
|
||||||
neighbor 10.0.3.1 {
|
local-address 10.0.3.113;
|
||||||
router-id 10.0.3.113;
|
local-as 113;
|
||||||
local-address 10.0.3.113;
|
peer-as 100;
|
||||||
local-as 113;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 14 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 14 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 14;
|
||||||
run "/etc/exabgp/exa-receive.py 14";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.3.1 {
|
||||||
|
router-id 10.0.3.114;
|
||||||
neighbor 10.0.3.1 {
|
local-address 10.0.3.114;
|
||||||
router-id 10.0.3.114;
|
local-as 114;
|
||||||
local-address 10.0.3.114;
|
peer-as 100;
|
||||||
local-as 114;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 15 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 15 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 15;
|
||||||
run "/etc/exabgp/exa-receive.py 15";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.3.1 {
|
||||||
|
router-id 10.0.3.115;
|
||||||
neighbor 10.0.3.1 {
|
local-address 10.0.3.115;
|
||||||
router-id 10.0.3.115;
|
local-as 115;
|
||||||
local-address 10.0.3.115;
|
peer-as 100;
|
||||||
local-as 115;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 16 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 16 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 16;
|
||||||
run "/etc/exabgp/exa-receive.py 16";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.4.1 {
|
||||||
|
router-id 10.0.4.116;
|
||||||
neighbor 10.0.4.1 {
|
local-address 10.0.4.116;
|
||||||
router-id 10.0.4.116;
|
local-as 116;
|
||||||
local-address 10.0.4.116;
|
peer-as 100;
|
||||||
local-as 116;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 17 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 17 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 17;
|
||||||
run "/etc/exabgp/exa-receive.py 17";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.4.1 {
|
||||||
|
router-id 10.0.4.117;
|
||||||
neighbor 10.0.4.1 {
|
local-address 10.0.4.117;
|
||||||
router-id 10.0.4.117;
|
local-as 117;
|
||||||
local-address 10.0.4.117;
|
peer-as 100;
|
||||||
local-as 117;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 18 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 18 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 18;
|
||||||
run "/etc/exabgp/exa-receive.py 18";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.4.1 {
|
||||||
|
router-id 10.0.4.118;
|
||||||
neighbor 10.0.4.1 {
|
local-address 10.0.4.118;
|
||||||
router-id 10.0.4.118;
|
local-as 118;
|
||||||
local-address 10.0.4.118;
|
peer-as 100;
|
||||||
local-as 118;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 19 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 19 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 19;
|
||||||
run "/etc/exabgp/exa-receive.py 19";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.4.1 {
|
||||||
|
router-id 10.0.4.119;
|
||||||
neighbor 10.0.4.1 {
|
local-address 10.0.4.119;
|
||||||
router-id 10.0.4.119;
|
local-as 119;
|
||||||
local-address 10.0.4.119;
|
peer-as 100;
|
||||||
local-as 119;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 2 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 2 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 2;
|
||||||
run "/etc/exabgp/exa-receive.py 2";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.1.1 {
|
||||||
|
router-id 10.0.1.102;
|
||||||
neighbor 10.0.1.1 {
|
local-address 10.0.1.102;
|
||||||
router-id 10.0.1.102;
|
local-as 99;
|
||||||
local-address 10.0.1.102;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 20 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 20 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 20;
|
||||||
run "/etc/exabgp/exa-receive.py 20";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.4.1 {
|
||||||
|
router-id 10.0.4.120;
|
||||||
neighbor 10.0.4.1 {
|
local-address 10.0.4.120;
|
||||||
router-id 10.0.4.120;
|
local-as 120;
|
||||||
local-address 10.0.4.120;
|
peer-as 100;
|
||||||
local-as 120;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 3 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 3 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 3;
|
||||||
run "/etc/exabgp/exa-receive.py 3";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.1.1 {
|
||||||
|
router-id 10.0.1.103;
|
||||||
neighbor 10.0.1.1 {
|
local-address 10.0.1.103;
|
||||||
router-id 10.0.1.103;
|
local-as 99;
|
||||||
local-address 10.0.1.103;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 4 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 4 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 4;
|
||||||
run "/etc/exabgp/exa-receive.py 4";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.1.1 {
|
||||||
|
router-id 10.0.1.104;
|
||||||
neighbor 10.0.1.1 {
|
local-address 10.0.1.104;
|
||||||
router-id 10.0.1.104;
|
local-as 99;
|
||||||
local-address 10.0.1.104;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 5 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 5 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 5;
|
||||||
run "/etc/exabgp/exa-receive.py 5";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.1.1 {
|
||||||
|
router-id 10.0.1.105;
|
||||||
neighbor 10.0.1.1 {
|
local-address 10.0.1.105;
|
||||||
router-id 10.0.1.105;
|
local-as 99;
|
||||||
local-address 10.0.1.105;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 6 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 6 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 6;
|
||||||
run "/etc/exabgp/exa-receive.py 6";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.2.1 {
|
||||||
|
router-id 10.0.2.106;
|
||||||
neighbor 10.0.2.1 {
|
local-address 10.0.2.106;
|
||||||
router-id 10.0.2.106;
|
local-as 99;
|
||||||
local-address 10.0.2.106;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 7 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 7 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 7;
|
||||||
run "/etc/exabgp/exa-receive.py 7";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.2.1 {
|
||||||
|
router-id 10.0.2.107;
|
||||||
neighbor 10.0.2.1 {
|
local-address 10.0.2.107;
|
||||||
router-id 10.0.2.107;
|
local-as 99;
|
||||||
local-address 10.0.2.107;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 8 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 8 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 8;
|
||||||
run "/etc/exabgp/exa-receive.py 8";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.2.1 {
|
||||||
|
router-id 10.0.2.108;
|
||||||
neighbor 10.0.2.1 {
|
local-address 10.0.2.108;
|
||||||
router-id 10.0.2.108;
|
local-as 99;
|
||||||
local-address 10.0.2.108;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 9 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 9 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 9;
|
||||||
run "/etc/exabgp/exa-receive.py 9";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.2.1 {
|
||||||
|
router-id 10.0.2.109;
|
||||||
neighbor 10.0.2.1 {
|
local-address 10.0.2.109;
|
||||||
router-id 10.0.2.109;
|
local-as 99;
|
||||||
local-address 10.0.2.109;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
# SPDX-License-Identifier: ISC
|
# SPDX-License-Identifier: ISC
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
[exabgp.api]
|
[exabgp.api]
|
||||||
|
ack = false
|
||||||
encoder = text
|
encoder = text
|
||||||
highres = false
|
highres = false
|
||||||
respawn = false
|
respawn = false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 1 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 1 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 1;
|
||||||
run "/etc/exabgp/exa-receive.py 1";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.1;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.1;
|
||||||
router-id 172.16.1.1;
|
local-as 65001;
|
||||||
local-address 172.16.1.1;
|
peer-as 100;
|
||||||
local-as 65001;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 2 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 2 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 2;
|
||||||
run "/etc/exabgp/exa-receive.py 2";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.2;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.2;
|
||||||
router-id 172.16.1.2;
|
local-as 65002;
|
||||||
local-address 172.16.1.2;
|
peer-as 100;
|
||||||
local-as 65002;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 3 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 3 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 3;
|
||||||
run "/etc/exabgp/exa-receive.py 3";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.3;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.3;
|
||||||
router-id 172.16.1.3;
|
local-as 65003;
|
||||||
local-address 172.16.1.3;
|
peer-as 100;
|
||||||
local-as 65003;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 4 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 4 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 4;
|
||||||
run "/etc/exabgp/exa-receive.py 4";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.4;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.4;
|
||||||
router-id 172.16.1.4;
|
local-as 65004;
|
||||||
local-address 172.16.1.4;
|
peer-as 100;
|
||||||
local-as 65004;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 5 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 5 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 5;
|
||||||
run "/etc/exabgp/exa-receive.py 5";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.5;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.5;
|
||||||
router-id 172.16.1.5;
|
local-as 65005;
|
||||||
local-address 172.16.1.5;
|
peer-as 100;
|
||||||
local-as 65005;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 6 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 6 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 6;
|
||||||
run "/etc/exabgp/exa-receive.py 6";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.6;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.6;
|
||||||
router-id 172.16.1.6;
|
local-as 65006;
|
||||||
local-address 172.16.1.6;
|
peer-as 100;
|
||||||
local-as 65006;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 7 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 7 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 7;
|
||||||
run "/etc/exabgp/exa-receive.py 7";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.7;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.7;
|
||||||
router-id 172.16.1.7;
|
local-as 65007;
|
||||||
local-address 172.16.1.7;
|
peer-as 100;
|
||||||
local-as 65007;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 8 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 8 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 8;
|
||||||
run "/etc/exabgp/exa-receive.py 8";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 172.16.1.254 {
|
||||||
|
router-id 172.16.1.8;
|
||||||
neighbor 172.16.1.254 {
|
local-address 172.16.1.8;
|
||||||
router-id 172.16.1.8;
|
local-as 65008;
|
||||||
local-address 172.16.1.8;
|
peer-as 100;
|
||||||
local-as 65008;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
[exabgp.api]
|
[exabgp.api]
|
||||||
|
ack = false
|
||||||
encoder = text
|
encoder = text
|
||||||
highres = false
|
highres = false
|
||||||
respawn = false
|
respawn = false
|
||||||
|
@ -43,7 +44,7 @@ enable = false
|
||||||
file = ''
|
file = ''
|
||||||
|
|
||||||
[exabgp.reactor]
|
[exabgp.reactor]
|
||||||
speed = 1.0
|
speed = 5.0
|
||||||
|
|
||||||
[exabgp.tcp]
|
[exabgp.tcp]
|
||||||
acl = false
|
acl = false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa_readpipe.py /var/run/exabgp_peer1.in;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa_readpipe.py /var/run/exabgp_peer1.in";
|
}
|
||||||
encoder text;
|
|
||||||
}
|
process receive-routes {
|
||||||
|
run /etc/exabgp/exa-receive.py 1;
|
||||||
process receive-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-receive.py 1";
|
}
|
||||||
receive-routes;
|
|
||||||
encoder text;
|
neighbor 10.0.1.1 {
|
||||||
}
|
router-id 10.0.1.2;
|
||||||
|
local-address 10.0.1.2;
|
||||||
neighbor 10.0.1.1 {
|
local-as 64510;
|
||||||
router-id 10.0.1.2;
|
peer-as 64510;
|
||||||
local-address 10.0.1.2;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
local-as 64510;
|
|
||||||
peer-as 64510;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa_readpipe.py /var/run/exabgp_peer2.in;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa_readpipe.py /var/run/exabgp_peer2.in";
|
}
|
||||||
encoder text;
|
|
||||||
}
|
process receive-routes {
|
||||||
|
run /etc/exabgp/exa-receive.py 2;
|
||||||
process receive-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-receive.py 2";
|
}
|
||||||
receive-routes;
|
|
||||||
encoder text;
|
neighbor 10.0.2.1 {
|
||||||
}
|
router-id 10.0.2.2;
|
||||||
|
local-address 10.0.2.2;
|
||||||
neighbor 10.0.2.1 {
|
local-as 64511;
|
||||||
router-id 10.0.2.2;
|
peer-as 64511;
|
||||||
local-address 10.0.2.2;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
local-as 64511;
|
|
||||||
peer-as 64511;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa_readpipe.py /var/run/exabgp_peer3.in;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa_readpipe.py /var/run/exabgp_peer3.in";
|
}
|
||||||
encoder text;
|
|
||||||
}
|
process receive-routes {
|
||||||
|
run /etc/exabgp/exa-receive.py 3;
|
||||||
process receive-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-receive.py 3";
|
}
|
||||||
receive-routes;
|
|
||||||
encoder text;
|
neighbor 10.0.3.1 {
|
||||||
}
|
router-id 10.0.3.2;
|
||||||
|
local-address 10.0.3.2;
|
||||||
neighbor 10.0.3.1 {
|
local-as 64502;
|
||||||
router-id 10.0.3.2;
|
peer-as 64501;
|
||||||
local-address 10.0.3.2;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
local-as 64502;
|
|
||||||
peer-as 64501;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
"Helper script to read api commands from a pipe and feed them to ExaBGP"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa_readpipe.py /var/run/exabgp_peer4.in;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa_readpipe.py /var/run/exabgp_peer4.in";
|
}
|
||||||
encoder text;
|
|
||||||
}
|
process receive-routes {
|
||||||
|
run /etc/exabgp/exa-receive.py 4;
|
||||||
process receive-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-receive.py 4";
|
}
|
||||||
receive-routes;
|
|
||||||
encoder text;
|
neighbor 10.0.4.1 {
|
||||||
}
|
router-id 10.0.4.2;
|
||||||
|
local-address 10.0.4.2;
|
||||||
neighbor 10.0.4.1 {
|
local-as 64503;
|
||||||
router-id 10.0.4.2;
|
peer-as 64501;
|
||||||
local-address 10.0.4.2;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
local-as 64503;
|
|
||||||
peer-as 64501;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,19 @@ from lib.topolog import logger
|
||||||
pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
|
pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
|
||||||
|
|
||||||
|
|
||||||
|
# Prefixes used in the test
|
||||||
|
prefix1 = "203.0.113.0/30"
|
||||||
|
prefix2 = "203.0.113.4/30"
|
||||||
|
prefix3 = "203.0.113.8/30"
|
||||||
|
# Next hops used for iBGP/confed routes
|
||||||
|
resolved_nh1 = "198.51.100.1"
|
||||||
|
resolved_nh2 = "198.51.100.2"
|
||||||
|
# BGP route used for recursive resolution
|
||||||
|
bgp_resolving_prefix = "198.51.100.0/24"
|
||||||
|
# Next hop that will require non-connected recursive resolution
|
||||||
|
ebgp_resolved_nh = "198.51.100.10"
|
||||||
|
|
||||||
|
|
||||||
def build_topo(tgen):
|
def build_topo(tgen):
|
||||||
"Build function"
|
"Build function"
|
||||||
|
|
||||||
|
@ -125,36 +138,26 @@ def teardown_module(mod):
|
||||||
tgen.stop_topology()
|
tgen.stop_topology()
|
||||||
|
|
||||||
|
|
||||||
def test_bgp_peer_type_multipath_relax():
|
def exabgp_cmd(peer, cmd):
|
||||||
|
pipe = open("/run/exabgp_{}.in".format(peer), "w")
|
||||||
|
with pipe:
|
||||||
|
pipe.write(cmd)
|
||||||
|
pipe.close()
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test1():
|
||||||
tgen = get_topogen()
|
tgen = get_topogen()
|
||||||
|
|
||||||
# Don't run this test if we have any failure.
|
# Don't run this test if we have any failure.
|
||||||
if tgen.routers_have_failure():
|
if tgen.routers_have_failure():
|
||||||
pytest.skip(tgen.errors)
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
def exabgp_cmd(peer, cmd):
|
r1 = tgen.gears["r1"]
|
||||||
pipe = open("/run/exabgp_{}.in".format(peer), "w")
|
|
||||||
with pipe:
|
|
||||||
pipe.write(cmd)
|
|
||||||
pipe.close()
|
|
||||||
|
|
||||||
# Prefixes used in the test
|
|
||||||
prefix1 = "203.0.113.0/30"
|
|
||||||
prefix2 = "203.0.113.4/30"
|
|
||||||
prefix3 = "203.0.113.8/30"
|
|
||||||
# Next hops used for iBGP/confed routes
|
|
||||||
resolved_nh1 = "198.51.100.1"
|
|
||||||
resolved_nh2 = "198.51.100.2"
|
|
||||||
# BGP route used for recursive resolution
|
|
||||||
bgp_resolving_prefix = "198.51.100.0/24"
|
|
||||||
# Next hop that will require non-connected recursive resolution
|
|
||||||
ebgp_resolved_nh = "198.51.100.10"
|
|
||||||
|
|
||||||
# Send a non-connected route to resolve others
|
# Send a non-connected route to resolve others
|
||||||
exabgp_cmd(
|
exabgp_cmd(
|
||||||
"peer3", "announce route {} next-hop self\n".format(bgp_resolving_prefix)
|
"peer3", "announce route {} next-hop self\n".format(bgp_resolving_prefix)
|
||||||
)
|
)
|
||||||
router = tgen.gears["r1"]
|
|
||||||
|
|
||||||
# It seems that if you write to the exabgp socket too quickly in
|
# It seems that if you write to the exabgp socket too quickly in
|
||||||
# succession, requests get lost. So verify prefix1 now instead of
|
# succession, requests get lost. So verify prefix1 now instead of
|
||||||
|
@ -177,7 +180,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip bgp {} json".format(prefix1),
|
"show ip bgp {} json".format(prefix1),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -185,6 +188,16 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
assertMsg = "Mixed-type multipath not found"
|
assertMsg = "Mixed-type multipath not found"
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test2():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
logger.info("Create and verify eBGP and iBGP+confed multipaths")
|
logger.info("Create and verify eBGP and iBGP+confed multipaths")
|
||||||
exabgp_cmd(
|
exabgp_cmd(
|
||||||
"peer1",
|
"peer1",
|
||||||
|
@ -203,38 +216,66 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
reffile = os.path.join(CWD, "r1/multipath.json")
|
reffile = os.path.join(CWD, "r1/multipath.json")
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp, router, "show ip bgp json", expected
|
topotest.router_json_cmp, r1, "show ip bgp json", expected
|
||||||
)
|
)
|
||||||
_, res = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
_, res = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
||||||
assertMsg = "Not all expected multipaths found"
|
assertMsg = "Not all expected multipaths found"
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test3():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
logger.info("Toggle peer-type multipath-relax and verify the changes")
|
logger.info("Toggle peer-type multipath-relax and verify the changes")
|
||||||
router.vtysh_cmd(
|
r1.vtysh_cmd(
|
||||||
"conf\n router bgp 64510\n no bgp bestpath peer-type multipath-relax\n"
|
"conf\n router bgp 64510\n no bgp bestpath peer-type multipath-relax\n"
|
||||||
)
|
)
|
||||||
# This file verifies "multipath" is not set
|
# This file verifies "multipath" is not set
|
||||||
reffile = os.path.join(CWD, "r1/not-multipath.json")
|
reffile = os.path.join(CWD, "r1/not-multipath.json")
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp, router, "show ip bgp json", expected
|
topotest.router_json_cmp, r1, "show ip bgp json", expected
|
||||||
)
|
)
|
||||||
_, res = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
_, res = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
||||||
assertMsg = "Disabling peer-type multipath-relax did not take effect"
|
assertMsg = "Disabling peer-type multipath-relax did not take effect"
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
router.vtysh_cmd(
|
|
||||||
"conf\n router bgp 64510\n bgp bestpath peer-type multipath-relax\n"
|
def test_bgp_peer_type_multipath_relax_test4():
|
||||||
)
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
|
r1.vtysh_cmd("conf\n router bgp 64510\n bgp bestpath peer-type multipath-relax\n")
|
||||||
reffile = os.path.join(CWD, "r1/multipath.json")
|
reffile = os.path.join(CWD, "r1/multipath.json")
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp, router, "show ip bgp json", expected
|
topotest.router_json_cmp, r1, "show ip bgp json", expected
|
||||||
)
|
)
|
||||||
_, res = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
_, res = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
||||||
assertMsg = "Reenabling peer-type multipath-relax did not take effect"
|
assertMsg = "Reenabling peer-type multipath-relax did not take effect"
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test5():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
logger.info("Check recursive resolution of eBGP next hops is not affected")
|
logger.info("Check recursive resolution of eBGP next hops is not affected")
|
||||||
# eBGP next hop resolution rejects recursively resolved next hops by
|
# eBGP next hop resolution rejects recursively resolved next hops by
|
||||||
# default, even with peer-type multipath-relax
|
# default, even with peer-type multipath-relax
|
||||||
|
@ -245,7 +286,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip bgp {} json".format(prefix3),
|
"show ip bgp {} json".format(prefix3),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -253,6 +294,16 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
assertMsg = "Recursive eBGP next hop not as expected for {}".format(prefix3)
|
assertMsg = "Recursive eBGP next hop not as expected for {}".format(prefix3)
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test6():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
exabgp_cmd(
|
exabgp_cmd(
|
||||||
"peer4", "announce route {} next-hop {}\n".format(prefix1, ebgp_resolved_nh)
|
"peer4", "announce route {} next-hop {}\n".format(prefix1, ebgp_resolved_nh)
|
||||||
)
|
)
|
||||||
|
@ -260,7 +311,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip bgp {} json".format(prefix1),
|
"show ip bgp {} json".format(prefix1),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -268,14 +319,24 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
assertMsg = "Recursive eBGP next hop not as expected for {}".format(prefix1)
|
assertMsg = "Recursive eBGP next hop not as expected for {}".format(prefix1)
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test7():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
# When other config allows recursively resolved eBGP next hops,
|
# When other config allows recursively resolved eBGP next hops,
|
||||||
# such next hops in all-eBGP multipaths should be valid
|
# such next hops in all-eBGP multipaths should be valid
|
||||||
router.vtysh_cmd("conf\n router bgp 64510\n neighbor 10.0.4.2 ebgp-multihop\n")
|
r1.vtysh_cmd("conf\n router bgp 64510\n neighbor 10.0.4.2 ebgp-multihop\n")
|
||||||
reffile = os.path.join(CWD, "r1/prefix3-recursive.json")
|
reffile = os.path.join(CWD, "r1/prefix3-recursive.json")
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip bgp {} json".format(prefix3),
|
"show ip bgp {} json".format(prefix3),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -287,7 +348,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip bgp {} json".format(prefix1),
|
"show ip bgp {} json".format(prefix1),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -295,6 +356,16 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
assertMsg = "Recursive eBGP next hop not as expected for {}".format(prefix1)
|
assertMsg = "Recursive eBGP next hop not as expected for {}".format(prefix1)
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test8():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
logger.info("Check mixed-type multipath next hop recursive resolution in FIB")
|
logger.info("Check mixed-type multipath next hop recursive resolution in FIB")
|
||||||
# There are now two eBGP-learned routes with a recursively resolved next;
|
# There are now two eBGP-learned routes with a recursively resolved next;
|
||||||
# hop; one is all-eBGP multipath, and the other is iBGP/eBGP/
|
# hop; one is all-eBGP multipath, and the other is iBGP/eBGP/
|
||||||
|
@ -305,7 +376,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip route {} json".format(prefix3),
|
"show ip route {} json".format(prefix3),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -313,6 +384,16 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
assertMsg = "FIB next hops mismatch for all-eBGP multipath"
|
assertMsg = "FIB next hops mismatch for all-eBGP multipath"
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test9():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
# check confed-external enables recursively resolved next hops by itself
|
# check confed-external enables recursively resolved next hops by itself
|
||||||
exabgp_cmd(
|
exabgp_cmd(
|
||||||
"peer1",
|
"peer1",
|
||||||
|
@ -324,7 +405,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip route {} json".format(prefix1),
|
"show ip route {} json".format(prefix1),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
@ -332,6 +413,16 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
assertMsg = "FIB next hops mismatch for eBGP+confed-external multipath"
|
assertMsg = "FIB next hops mismatch for eBGP+confed-external multipath"
|
||||||
assert res is None, assertMsg
|
assert res is None, assertMsg
|
||||||
|
|
||||||
|
|
||||||
|
def test_bgp_peer_type_multipath_relax_test10():
|
||||||
|
tgen = get_topogen()
|
||||||
|
|
||||||
|
# Don't run this test if we have any failure.
|
||||||
|
if tgen.routers_have_failure():
|
||||||
|
pytest.skip(tgen.errors)
|
||||||
|
|
||||||
|
r1 = tgen.gears["r1"]
|
||||||
|
|
||||||
# check iBGP by itself
|
# check iBGP by itself
|
||||||
exabgp_cmd(
|
exabgp_cmd(
|
||||||
"peer1",
|
"peer1",
|
||||||
|
@ -349,7 +440,7 @@ def test_bgp_peer_type_multipath_relax():
|
||||||
expected = json.loads(open(reffile).read())
|
expected = json.loads(open(reffile).read())
|
||||||
test_func = functools.partial(
|
test_func = functools.partial(
|
||||||
topotest.router_json_cmp,
|
topotest.router_json_cmp,
|
||||||
router,
|
r1,
|
||||||
"show ip route {} json".format(prefix1),
|
"show ip route {} json".format(prefix1),
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
[exabgp.api]
|
[exabgp.api]
|
||||||
|
ack = false
|
||||||
encoder = text
|
encoder = text
|
||||||
highres = false
|
highres = false
|
||||||
respawn = false
|
respawn = false
|
||||||
|
|
|
@ -1,103 +1,101 @@
|
||||||
group controller {
|
neighbor 10.0.0.1 {
|
||||||
neighbor 10.0.0.1 {
|
router-id 10.0.0.101;
|
||||||
router-id 10.0.0.101;
|
local-address 10.0.0.101;
|
||||||
local-address 10.0.0.101;
|
local-as 2;
|
||||||
local-as 2;
|
peer-as 1;
|
||||||
peer-as 1;
|
|
||||||
|
|
||||||
family {
|
family {
|
||||||
ipv4 nlri-mpls;
|
ipv4 nlri-mpls;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
# ref: draft-ietf-idr-bgp-prefix-sid-27
|
# ref: draft-ietf-idr-bgp-prefix-sid-27
|
||||||
#
|
#
|
||||||
# IANA temporarily assigned the following:
|
# IANA temporarily assigned the following:
|
||||||
# attribute code type (suggested value: 40) to
|
# attribute code type (suggested value: 40) to
|
||||||
# the BGP Prefix-SID attribute
|
# the BGP Prefix-SID attribute
|
||||||
#
|
#
|
||||||
# 0 1 2 3
|
# 0 1 2 3
|
||||||
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | Type | Length | RESERVED |
|
# | Type | Length | RESERVED |
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | Flags | Label Index |
|
# | Flags | Label Index |
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | Label Index |
|
# | Label Index |
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# Figure. Label-Index TLV (Prefix-SID type-1)
|
# Figure. Label-Index TLV (Prefix-SID type-1)
|
||||||
#
|
#
|
||||||
# 0 1 2 3
|
# 0 1 2 3
|
||||||
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | Type | Length | Flags |
|
# | Type | Length | Flags |
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | Flags |
|
# | Flags |
|
||||||
# +-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+
|
||||||
#
|
#
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | SRGB 1 (6 octets) |
|
# | SRGB 1 (6 octets) |
|
||||||
# | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | |
|
# | |
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
#
|
#
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | SRGB n (6 octets) |
|
# | SRGB n (6 octets) |
|
||||||
# | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
# | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
# | |
|
# | |
|
||||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<Paste>
|
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<Paste>
|
||||||
# Figure. Originator SRGB TLV (Prefix-SID type-3)
|
# Figure. Originator SRGB TLV (Prefix-SID type-3)
|
||||||
|
|
||||||
# ExaBGP generic-attribute binary pattern:
|
# ExaBGP generic-attribute binary pattern:
|
||||||
# Attribute-type: 0x28 (40:BGP_PREFIX_SID)
|
# Attribute-type: 0x28 (40:BGP_PREFIX_SID)
|
||||||
# Attribute-flag: 0xc0 (Option, Transitive)
|
# Attribute-flag: 0xc0 (Option, Transitive)
|
||||||
# Attribute-body: Label-Index TLV and Originator SRGB TLV
|
# Attribute-body: Label-Index TLV and Originator SRGB TLV
|
||||||
# Label-Index TLV: 0x01000700000000000001
|
# Label-Index TLV: 0x01000700000000000001
|
||||||
# Type (08bit): 0x01
|
# Type (08bit): 0x01
|
||||||
# Length (16bit): 0x0007
|
# Length (16bit): 0x0007
|
||||||
# RESERVED (08bit): 0x00
|
# RESERVED (08bit): 0x00
|
||||||
# Flags (16bit): 0x0000
|
# Flags (16bit): 0x0000
|
||||||
# Label Index (32bit): 0x00000001
|
# Label Index (32bit): 0x00000001
|
||||||
# Originator SRGB TLV: 0x03000800000c350000000a
|
# Originator SRGB TLV: 0x03000800000c350000000a
|
||||||
# Type (08bit): 0x03
|
# Type (08bit): 0x03
|
||||||
# Length (16bit): 0x0008 (nb-SRGB is 1)
|
# Length (16bit): 0x0008 (nb-SRGB is 1)
|
||||||
# Flags (16bit): 0x0000
|
# Flags (16bit): 0x0000
|
||||||
# SRGB1 (48bit): 0x0c3500:0x00000a (800000-800010 is SRGB1)
|
# SRGB1 (48bit): 0x0c3500:0x00000a (800000-800010 is SRGB1)
|
||||||
route 3.0.0.1/32 next-hop 10.0.0.101 label [800001] attribute [0x28 0xc0 0x0100070000000000000103000800000c350000000a];
|
route 3.0.0.1/32 next-hop 10.0.0.101 label [800001] attribute [0x28 0xc0 0x0100070000000000000103000800000c350000000a];
|
||||||
|
|
||||||
# ExaBGP generic-attribute binary pattern:
|
# ExaBGP generic-attribute binary pattern:
|
||||||
# Attribute-type: 0x28 (40:BGP_PREFIX_SID)
|
# Attribute-type: 0x28 (40:BGP_PREFIX_SID)
|
||||||
# Attribute-flag: 0xc0 (Option, Transitive)
|
# Attribute-flag: 0xc0 (Option, Transitive)
|
||||||
# Attribute-body: Label-Index TLV and Originator SRGB TLV
|
# Attribute-body: Label-Index TLV and Originator SRGB TLV
|
||||||
# Label-Index TLV: 0x01000700000000000001
|
# Label-Index TLV: 0x01000700000000000001
|
||||||
# Type (08bit): 0x01
|
# Type (08bit): 0x01
|
||||||
# Length (16bit): 0x0007
|
# Length (16bit): 0x0007
|
||||||
# RESERVED (08bit): 0x00
|
# RESERVED (08bit): 0x00
|
||||||
# Flags (16bit): 0x0000
|
# Flags (16bit): 0x0000
|
||||||
# Label Index (32bit): 0x00000002
|
# Label Index (32bit): 0x00000002
|
||||||
# Originator SRGB TLV: 0x03000800000c350000000a
|
# Originator SRGB TLV: 0x03000800000c350000000a
|
||||||
# Type (08bit): 0x03
|
# Type (08bit): 0x03
|
||||||
# Length (16bit): 0x0008 (nb-SRGB is 1)
|
# Length (16bit): 0x0008 (nb-SRGB is 1)
|
||||||
# Flags (16bit): 0x0000
|
# Flags (16bit): 0x0000
|
||||||
# SRGB1 (48bit): 0x0c3500:0x00000a (800000-800010 is SRGB1)
|
# SRGB1 (48bit): 0x0c3500:0x00000a (800000-800010 is SRGB1)
|
||||||
route 3.0.0.2/32 next-hop 10.0.0.101 label [800002] attribute [0x28 0xc0 0x0100070000000000000203000800000c350000000a];
|
route 3.0.0.2/32 next-hop 10.0.0.101 label [800002] attribute [0x28 0xc0 0x0100070000000000000203000800000c350000000a];
|
||||||
|
|
||||||
# ExaBGP generic-attribute binary pattern:
|
# ExaBGP generic-attribute binary pattern:
|
||||||
# Attribute-type: 0x28 (40:BGP_PREFIX_SID)
|
# Attribute-type: 0x28 (40:BGP_PREFIX_SID)
|
||||||
# Attribute-flag: 0xc0 (Option, Transitive)
|
# Attribute-flag: 0xc0 (Option, Transitive)
|
||||||
# Attribute-body: Label-Index TLV and Originator SRGB TLV
|
# Attribute-body: Label-Index TLV and Originator SRGB TLV
|
||||||
# Label-Index TLV: 0x01000700000000000001
|
# Label-Index TLV: 0x01000700000000000001
|
||||||
# Type (08bit): 0x01
|
# Type (08bit): 0x01
|
||||||
# Length (16bit): 0x0007
|
# Length (16bit): 0x0007
|
||||||
# RESERVED (08bit): 0x00
|
# RESERVED (08bit): 0x00
|
||||||
# Flags (16bit): 0x0000
|
# Flags (16bit): 0x0000
|
||||||
# Label Index (32bit): 0x00000003
|
# Label Index (32bit): 0x00000003
|
||||||
# Originator SRGB TLV: 0x03000800000c350000000a
|
# Originator SRGB TLV: 0x03000800000c350000000a
|
||||||
# Type (08bit): 0x03
|
# Type (08bit): 0x03
|
||||||
# Length (16bit): 0x0008 (nb-SRGB is 1)
|
# Length (16bit): 0x0008 (nb-SRGB is 1)
|
||||||
# Flags (16bit): 0x0000
|
# Flags (16bit): 0x0000
|
||||||
# SRGB1 (48bit): 0x0c3500:0x00000a (800000-800010 is SRGB1)
|
# SRGB1 (48bit): 0x0c3500:0x00000a (800000-800010 is SRGB1)
|
||||||
route 3.0.0.3/32 next-hop 10.0.0.101 label [800003] attribute [0x28 0xc0 0x0100070000000000000303000800000c350000000a];
|
route 3.0.0.3/32 next-hop 10.0.0.101 label [800003] attribute [0x28 0xc0 0x0100070000000000000303000800000c350000000a];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,22 @@
|
||||||
group controller {
|
process receive-routes {
|
||||||
|
run /etc/exabgp/exa-receive.py --no-timestamp 2;
|
||||||
|
encoder json;
|
||||||
|
}
|
||||||
|
|
||||||
process receive-routes {
|
neighbor 10.0.0.1 {
|
||||||
run "/etc/exabgp/exa-receive.py --no-timestamp 2";
|
router-id 10.0.0.102;
|
||||||
receive-routes;
|
local-address 10.0.0.102;
|
||||||
encoder json;
|
local-as 3;
|
||||||
|
peer-as 1;
|
||||||
|
|
||||||
|
family {
|
||||||
|
ipv4 nlri-mpls;
|
||||||
}
|
}
|
||||||
|
api {
|
||||||
neighbor 10.0.0.1 {
|
processes [ receive-routes ];
|
||||||
router-id 10.0.0.102;
|
receive {
|
||||||
local-address 10.0.0.102;
|
parsed;
|
||||||
local-as 3;
|
update;
|
||||||
peer-as 1;
|
|
||||||
|
|
||||||
family {
|
|
||||||
ipv4 nlri-mpls;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,13 +120,9 @@ def exabgp_get_update_prefix(filename, afi, nexthop, prefix):
|
||||||
ret = ret.get(afi)
|
ret = ret.get(afi)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
continue
|
continue
|
||||||
ret = ret.get(nexthop)
|
for nh in ret.get(nexthop, []):
|
||||||
if ret is None:
|
if nh.get("nlri") == prefix:
|
||||||
continue
|
return output
|
||||||
ret = ret.get(prefix)
|
|
||||||
if ret is None:
|
|
||||||
continue
|
|
||||||
return output
|
|
||||||
return "Not found"
|
return "Not found"
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,33 +131,39 @@ def test_peer2_receive_prefix_sid_type1():
|
||||||
peer2 = tgen.gears["peer2"]
|
peer2 = tgen.gears["peer2"]
|
||||||
logfile = "{}/{}-received.log".format(peer2.gearlogdir, peer2.name)
|
logfile = "{}/{}-received.log".format(peer2.gearlogdir, peer2.name)
|
||||||
|
|
||||||
def _check_type1_peer2(prefix, labelindex):
|
def _check_type1_peer2(prefix, label):
|
||||||
output = exabgp_get_update_prefix(
|
output = exabgp_get_update_prefix(
|
||||||
logfile, "ipv4 nlri-mpls", "10.0.0.101", prefix
|
logfile, "ipv4 nlri-mpls", "10.0.0.101", prefix
|
||||||
)
|
)
|
||||||
expected = {
|
expected = {
|
||||||
"type": "update",
|
"type": "update",
|
||||||
"neighbor": {
|
"neighbor": {
|
||||||
"ip": "10.0.0.1",
|
"address": {
|
||||||
|
"peer": "10.0.0.1",
|
||||||
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"update": {
|
"update": {
|
||||||
"attribute": {
|
"announce": {
|
||||||
"attribute-0x28-0xE0": "0x010007000000{:08x}".format(
|
"ipv4 nlri-mpls": {
|
||||||
labelindex
|
"10.0.0.101": [
|
||||||
)
|
{
|
||||||
|
"nlri": prefix,
|
||||||
|
"label": [[label]],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"announce": {"ipv4 nlri-mpls": {"10.0.0.101": {}}},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return topotest.json_cmp(output, expected)
|
return topotest.json_cmp(output, expected)
|
||||||
|
|
||||||
test_func = functools.partial(_check_type1_peer2, "3.0.0.1/32", labelindex=1)
|
test_func = functools.partial(_check_type1_peer2, "3.0.0.1/32", label=8001)
|
||||||
success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
|
success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
|
||||||
assert result is None, 'Failed _check_type1_peer2 in "{}"'.format("peer2")
|
assert result is None, 'Failed _check_type1_peer2 in "{}"'.format("peer2")
|
||||||
|
|
||||||
test_func = functools.partial(_check_type1_peer2, "3.0.0.2/32", labelindex=2)
|
test_func = functools.partial(_check_type1_peer2, "3.0.0.2/32", label=8002)
|
||||||
success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
|
success, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
|
||||||
assert result is None, 'Failed _check_type1_peer2 in "{}"'.format("peer2")
|
assert result is None, 'Failed _check_type1_peer2 in "{}"'.format("peer2")
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
group controller {
|
neighbor 10.0.0.1 {
|
||||||
neighbor 10.0.0.1 {
|
router-id 10.0.0.101;
|
||||||
router-id 10.0.0.101;
|
local-address 10.0.0.101;
|
||||||
local-address 10.0.0.101;
|
local-as 2;
|
||||||
local-as 2;
|
peer-as 1;
|
||||||
peer-as 1;
|
|
||||||
|
|
||||||
family {
|
family {
|
||||||
ipv6 mpls-vpn;
|
ipv6 mpls-vpn;
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
route 2001:1::/64 {
|
||||||
|
rd 2:10;
|
||||||
|
next-hop 2001::2;
|
||||||
|
extended-community [ target:2:10 ];
|
||||||
|
label 3;
|
||||||
|
attribute [0x28 0xc0 0x050019000100150020010db800010001000000000000000100ffff00 ];
|
||||||
}
|
}
|
||||||
|
route 2001:2::/64 {
|
||||||
static {
|
rd 2:10;
|
||||||
route 2001:1::/64 {
|
next-hop 2001::2;
|
||||||
rd 2:10;
|
extended-community [ target:2:10 ];
|
||||||
next-hop 2001::2;
|
label 3;
|
||||||
extended-community [ target:2:10 ];
|
attribute [0x28 0xc0 0x050019000100150020010db800010001000000000000000100ffff00 ];
|
||||||
label 3;
|
|
||||||
attribute [0x28 0xc0 0x050019000100150020010db800010001000000000000000100ffff00 ];
|
|
||||||
}
|
|
||||||
route 2001:2::/64 {
|
|
||||||
rd 2:10;
|
|
||||||
next-hop 2001::2;
|
|
||||||
extended-community [ target:2:10 ];
|
|
||||||
label 3;
|
|
||||||
attribute [0x28 0xc0 0x050019000100150020010db800010001000000000000000100ffff00 ];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,5 +21,7 @@ router bgp 1
|
||||||
!
|
!
|
||||||
address-family ipv6 vpn
|
address-family ipv6 vpn
|
||||||
neighbor 10.0.0.101 activate
|
neighbor 10.0.0.101 activate
|
||||||
|
neighbor 10.0.0.101 route-map DENY_ALL out
|
||||||
exit-address-family
|
exit-address-family
|
||||||
!
|
!
|
||||||
|
route-map DENY_ALL deny 10
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
{
|
{
|
||||||
"2:10":{
|
"2:10":{
|
||||||
"prefix":"2001:1::\/64",
|
"prefix":"2001:1::\/64",
|
||||||
"advertisedTo":{
|
|
||||||
"10.0.0.101":{
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"paths":[
|
"paths":[
|
||||||
{
|
{
|
||||||
"aspath":{
|
"aspath":{
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
{
|
{
|
||||||
"2:10":{
|
"2:10":{
|
||||||
"prefix":"2001:2::\/64",
|
"prefix":"2001:2::\/64",
|
||||||
"advertisedTo":{
|
|
||||||
"10.0.0.101":{
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"paths":[
|
"paths":[
|
||||||
{
|
{
|
||||||
"aspath":{
|
"aspath":{
|
||||||
|
|
|
@ -3,7 +3,7 @@ neighbor 10.0.0.1 {
|
||||||
local-address 10.0.0.2;
|
local-address 10.0.0.2;
|
||||||
local-as 65001;
|
local-as 65001;
|
||||||
peer-as 65534;
|
peer-as 65534;
|
||||||
md5 test123;
|
md5-password test123;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
route 192.168.100.1/32 {
|
route 192.168.100.1/32 {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
[exabgp.api]
|
[exabgp.api]
|
||||||
|
ack = false
|
||||||
encoder = text
|
encoder = text
|
||||||
highres = false
|
highres = false
|
||||||
respawn = false
|
respawn = false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
exa-send.py: Send a few testroutes with ExaBGP
|
exa-send.py: Send a few testroutes with ExaBGP
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
group controller {
|
process announce-routes {
|
||||||
|
run /etc/exabgp/exa-send.py 1 10;
|
||||||
process announce-routes {
|
encoder text;
|
||||||
run "/etc/exabgp/exa-send.py 1 10";
|
}
|
||||||
}
|
|
||||||
|
process receive-routes {
|
||||||
process receive-routes {
|
run /etc/exabgp/exa-receive.py 1;
|
||||||
run "/etc/exabgp/exa-receive.py 1";
|
encoder text;
|
||||||
receive-routes;
|
}
|
||||||
encoder text;
|
|
||||||
}
|
neighbor 10.0.1.1 {
|
||||||
|
router-id 10.0.1.101;
|
||||||
neighbor 10.0.1.1 {
|
local-address 10.0.1.101;
|
||||||
router-id 10.0.1.101;
|
local-as 99;
|
||||||
local-address 10.0.1.101;
|
peer-as 100;
|
||||||
local-as 99;
|
capability {graceful-restart;}
|
||||||
peer-as 100;
|
api {processes [ announce-routes, receive-routes ];}
|
||||||
graceful-restart;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
import configparser
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
@ -21,12 +22,6 @@ from functools import wraps
|
||||||
from re import search as re_search
|
from re import search as re_search
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
try:
|
|
||||||
# Imports from python2
|
|
||||||
import ConfigParser as configparser
|
|
||||||
except ImportError:
|
|
||||||
# Imports from python3
|
|
||||||
import configparser
|
|
||||||
|
|
||||||
from lib.micronet import comm_error
|
from lib.micronet import comm_error
|
||||||
from lib.topogen import TopoRouter, get_topogen
|
from lib.topogen import TopoRouter, get_topogen
|
||||||
|
|
|
@ -81,20 +81,20 @@ def is_string(value):
|
||||||
|
|
||||||
|
|
||||||
def get_exabgp_cmd(commander=None):
|
def get_exabgp_cmd(commander=None):
|
||||||
"""Return the command to use for ExaBGP version < 4."""
|
"""Return the command to use for ExaBGP version >= 4.2.11"""
|
||||||
|
|
||||||
if commander is None:
|
if commander is None:
|
||||||
commander = Commander("exabgp", logger=logging.getLogger("exabgp"))
|
commander = Commander("exabgp", logger=logging.getLogger("exabgp"))
|
||||||
|
|
||||||
def exacmd_version_ok(exacmd):
|
def exacmd_version_ok(exacmd):
|
||||||
logger.debug("checking %s for exabgp < version 4", exacmd)
|
logger.debug("checking %s for exabgp version >= 4.2.11", exacmd)
|
||||||
_, stdout, _ = commander.cmd_status(exacmd + " -v", warn=False)
|
_, stdout, _ = commander.cmd_status(exacmd + " -v", warn=False)
|
||||||
m = re.search(r"ExaBGP\s*:\s*((\d+)\.(\d+)(?:\.(\d+))?)", stdout)
|
m = re.search(r"ExaBGP\s*:\s*((\d+)\.(\d+)(?:\.(\d+))?)", stdout)
|
||||||
if not m:
|
if not m:
|
||||||
return False
|
return False
|
||||||
version = m.group(1)
|
version = m.group(1)
|
||||||
if topotest.version_cmp(version, "4") >= 0:
|
if topotest.version_cmp(version, "4.2.11") < 0:
|
||||||
logging.debug("found exabgp version >= 4 in %s will keep looking", exacmd)
|
logging.debug("found exabgp version < 4.2.11 in %s will keep looking", exacmd)
|
||||||
return False
|
return False
|
||||||
logger.info("Using ExaBGP version %s in %s", version, exacmd)
|
logger.info("Using ExaBGP version %s in %s", version, exacmd)
|
||||||
return True
|
return True
|
||||||
|
@ -102,14 +102,14 @@ def get_exabgp_cmd(commander=None):
|
||||||
exacmd = commander.get_exec_path("exabgp")
|
exacmd = commander.get_exec_path("exabgp")
|
||||||
if exacmd and exacmd_version_ok(exacmd):
|
if exacmd and exacmd_version_ok(exacmd):
|
||||||
return exacmd
|
return exacmd
|
||||||
py2_path = commander.get_exec_path("python2")
|
py3_path = commander.get_exec_path("python3")
|
||||||
if py2_path:
|
if py3_path:
|
||||||
exacmd = py2_path + " -m exabgp"
|
exacmd = py3_path + " -m exabgp"
|
||||||
if exacmd_version_ok(exacmd):
|
if exacmd_version_ok(exacmd):
|
||||||
return exacmd
|
return exacmd
|
||||||
py2_path = commander.get_exec_path("python")
|
py3_path = commander.get_exec_path("python")
|
||||||
if py2_path:
|
if py3_path:
|
||||||
exacmd = py2_path + " -m exabgp"
|
exacmd = py3_path + " -m exabgp"
|
||||||
if exacmd_version_ok(exacmd):
|
if exacmd_version_ok(exacmd):
|
||||||
return exacmd
|
return exacmd
|
||||||
return None
|
return None
|
||||||
|
@ -1198,7 +1198,7 @@ class TopoExaBGP(TopoHost):
|
||||||
* Run ExaBGP with env file `env_file` and configuration peer*/exabgp.cfg
|
* Run ExaBGP with env file `env_file` and configuration peer*/exabgp.cfg
|
||||||
"""
|
"""
|
||||||
exacmd = self.tgen.get_exabgp_cmd()
|
exacmd = self.tgen.get_exabgp_cmd()
|
||||||
assert exacmd, "Can't find a usabel ExaBGP (must be < version 4)"
|
assert exacmd, "Can't find a usable ExaBGP (must be version >= 4.2.11)"
|
||||||
|
|
||||||
self.run("mkdir -p /etc/exabgp")
|
self.run("mkdir -p /etc/exabgp")
|
||||||
self.run("chmod 755 /etc/exabgp")
|
self.run("chmod 755 /etc/exabgp")
|
||||||
|
@ -1209,8 +1209,22 @@ class TopoExaBGP(TopoHost):
|
||||||
self.run("chmod 644 /etc/exabgp/*")
|
self.run("chmod 644 /etc/exabgp/*")
|
||||||
self.run("chmod a+x /etc/exabgp/*.py")
|
self.run("chmod a+x /etc/exabgp/*.py")
|
||||||
self.run("chown -R exabgp:exabgp /etc/exabgp")
|
self.run("chown -R exabgp:exabgp /etc/exabgp")
|
||||||
|
self.run("[ -p /var/run/exabgp.in ] || mkfifo /var/run/exabgp.in")
|
||||||
|
self.run("[ -p /var/run/exabgp.out ] || mkfifo /var/run/exabgp.out")
|
||||||
|
self.run("chown exabgp:exabgp /var/run/exabgp.{in,out}")
|
||||||
|
self.run("chmod 600 /var/run/exabgp.{in,out}")
|
||||||
|
|
||||||
output = self.run(exacmd + " -e /etc/exabgp/exabgp.env /etc/exabgp/exabgp.cfg")
|
log_dir = os.path.join(self.logdir, self.name)
|
||||||
|
self.run("chmod 777 {}".format(log_dir))
|
||||||
|
|
||||||
|
log_file = os.path.join(log_dir, "exabgp.log")
|
||||||
|
|
||||||
|
env_cmd = "env exabgp.log.level=INFO "
|
||||||
|
env_cmd += "exabgp.log.destination={} ".format(log_file)
|
||||||
|
|
||||||
|
output = self.run(
|
||||||
|
env_cmd + exacmd + " -e /etc/exabgp/exabgp.env /etc/exabgp/exabgp.cfg "
|
||||||
|
)
|
||||||
if output is None or len(output) == 0:
|
if output is None or len(output) == 0:
|
||||||
output = "<none>"
|
output = "<none>"
|
||||||
|
|
||||||
|
@ -1371,7 +1385,7 @@ def diagnose_env_linux(rundir):
|
||||||
logger.info("LDPd tests will not run (missing mpls-iptunnel kernel module)")
|
logger.info("LDPd tests will not run (missing mpls-iptunnel kernel module)")
|
||||||
|
|
||||||
if not get_exabgp_cmd():
|
if not get_exabgp_cmd():
|
||||||
logger.warning("Failed to find exabgp < 4")
|
logger.warning("Failed to find exabgp >= 4.2.11")
|
||||||
|
|
||||||
logger.removeHandler(fhandler)
|
logger.removeHandler(fhandler)
|
||||||
fhandler.close()
|
fhandler.close()
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# Skip pytests example directory
|
# Skip pytests example directory
|
||||||
[pytest]
|
[pytest]
|
||||||
|
|
||||||
|
# NEEDS_EXABGP_4_2_11_FRR
|
||||||
|
|
||||||
# asyncio_mode = auto
|
# asyncio_mode = auto
|
||||||
|
|
||||||
# We always turn this on inside conftest.py, default shown
|
# We always turn this on inside conftest.py, default shown
|
||||||
|
|
Loading…
Reference in a new issue