Skip to content

Commit

Permalink
Merge branch 'playground'
Browse files Browse the repository at this point in the history
  • Loading branch information
pierky committed Jan 1, 2021
2 parents 267e645 + 86f11b1 commit 4472bd3
Show file tree
Hide file tree
Showing 276 changed files with 1,304 additions and 264 deletions.
90 changes: 90 additions & 0 deletions .github/test_playground.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash

set -e

error=0

function pr_bold() {
echo -e "\033[1m$@\033[0m"
}

function run_on() {
set +e
docker-compose exec -T $1 bash -c "$2"

if [ $? -eq 0 ]; then
res="OK"
else
res="Failed"
error=1
fi

set -e

pr_bold "$1: $2 $res"
}

docker-compose version

cd tools/playground

if [ "$CI" == "true" ]; then
export INSTALL_FROM_SRC=1
fi

docker-compose build

docker-compose up -d

# Let run.sh configure ARouteServer...
echo -n "Waiting a bit till run.sh configures everything... "
sleep 60
echo "OK, let's move now!"

run_on rs 'birdc show protocols | grep BGP | grep Established | wc -l | grep 2'

run_on alice_lg 'curl -L http://10.0.0.2:29184/protocols/bgp'

run_on client_2 'birdc show route count | grep "2 of 2 routes for 2 networks"'
run_on client_2 'birdc show route | grep 193.0.0.0/21 | grep "via 10.0.0.11"'

# Valid routes on the RS.
run_on rs 'birdc show route count | grep "3 of 3 routes for 3 networks"'

for prefix in \
192.136.136.0/24 \
193.0.0.0/21 \
193.0.22.0/23
do
run_on rs "birdc show route $prefix | grep $prefix"
done

# Filtered routes on the RS.
run_on rs 'birdc show route filtered count | grep "4 of 4 routes for 4 networks"'

for prefix in \
10.0.0.0/24 \
192.168.0.0/24 \
193.0.0.1/32 \
202.12.29.0/24
do
run_on rs "birdc show route filtered $prefix | grep $prefix"
done

run_on rs "birdc show route filtered 10.0.0.0/24 all | grep '(64500, 65520, 3)'"
run_on rs "birdc show route filtered 202.12.29.0/24 all | grep '(64500, 65520, 9)'"

pr_bold "Testing localhost, Alice at port 8080..."
curl -L http://127.0.0.1:8080 | grep 'Alice - The friendly BGP looking glass'
pr_bold "Testing localhost, Alice at port 8080... OK"

echo ""
echo ""

if [ $error -eq 0 ]; then
pr_bold "Tests completed successfully!"
exit 0
else:
pr_bold "Tests failed :-("
exit 1
fi
18 changes: 18 additions & 0 deletions .github/workflows/test_playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Playground tests

on: push

jobs:
test-playground:
name: Playground tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run Playground tests
run: .github/test_playground.sh
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ How it works

**Validation** and testing of the configurations generated with this tool are performed using the built-in **live tests** framework: `Docker`_ instances are used to simulate several scenarios and to validate the behaviour of the route server after configuring it with ARouteServer. More details on the `Live tests <https://arouteserver.readthedocs.io/en/latest/LIVETESTS.html>`_ section.

A Docker-based `playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__ is available to experiment with the tool in a virtual IXP environment.

.. _bgpq3: https://github.com/snar/bgpq3
.. _bgpq4: https://github.com/bgp/bgpq4
.. _PeeringDB: https://www.peeringdb.com/
Expand Down Expand Up @@ -116,6 +118,8 @@ Features

- Related tools:

- The `Playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__, to experiment with the tool in a virtual IXP environment.

- `Invalid routes reporter <https://arouteserver.readthedocs.io/en/latest/TOOLS.html#invalid-routes-reporter>`__, to log or report invalid routes and their reject reason.

A comprehensive list of features can be found within the comments of the distributed configuration file on `GitHub <https://github.com/pierky/arouteserver/blob/master/config.d/general.yml>`__ or on the `documentation web page <https://arouteserver.readthedocs.io/en/latest/GENERAL.html>`__.
Expand Down Expand Up @@ -159,6 +163,8 @@ Who is using ARouteServer?

- `GAVLIX <https://gavlix.se/>`__.

- `IX Australia <https://www.ix.asn.au/>`__, BIRD v2.

- `IX-Denver <http://ix-denver.org/>`__, BIRD.

- `MBIX <http://www.mbix.ca/>`__, BIRD.
Expand All @@ -169,6 +175,8 @@ Who is using ARouteServer?

- `NIXI Mumbai (GPX) <https://nixi.in/>`__, BIRD.

- `NZIX <https://ix.nz/>`__, BIRD v2.

- `PIT-IX <https://pit-ix.net/>`__, BIRD.

- `QCIX <http://www.qcix.net/>`__, BIRD.
Expand Down
2 changes: 2 additions & 0 deletions docs/CONFIG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Route server's general configuration and policies are outlined in the ``general.

Configuration details and options can be found within the distributed `general <https://github.com/pierky/arouteserver/blob/master/config.d/general.yml>`__ and `clients <https://github.com/pierky/arouteserver/blob/master/config.d/clients.yml>`__ configuration files on GitHub or in the :doc:`GENERAL` page.

A Docker-based `playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__ is available to experiment with the settings in a virtual IXP environment.

Details about some particular topics are reported below.

.. contents::
Expand Down
4 changes: 4 additions & 0 deletions docs/FEATURES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ How it works

**Validation** and testing of the configurations generated with this tool are performed using the built-in **live tests** framework: `Docker`_ instances are used to simulate several scenarios and to validate the behaviour of the route server after configuring it with ARouteServer. More details on the `Live tests <https://arouteserver.readthedocs.io/en/latest/LIVETESTS.html>`_ section.

A Docker-based `playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__ is available to experiment with the tool in a virtual IXP environment.

.. _bgpq3: https://github.com/snar/bgpq3
.. _bgpq4: https://github.com/bgp/bgpq4
.. _PeeringDB: https://www.peeringdb.com/
Expand Down Expand Up @@ -106,6 +108,8 @@ Features

- Related tools:

- The `Playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__, to experiment with the tool in a virtual IXP environment.

- `Invalid routes reporter <https://arouteserver.readthedocs.io/en/latest/TOOLS.html#invalid-routes-reporter>`__, to log or report invalid routes and their reject reason.

A comprehensive list of features can be found within the comments of the distributed configuration file on `GitHub <https://github.com/pierky/arouteserver/blob/master/config.d/general.yml>`__ or on the `documentation web page <https://arouteserver.readthedocs.io/en/latest/GENERAL.html>`__.
Expand Down
3 changes: 3 additions & 0 deletions docs/INSTALLATION.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Installation
============

.. Hint::
A Docker-based `playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__ is available to experiment with the installation and configuration steps reported in this section.

Dependencies
------------

Expand Down
4 changes: 4 additions & 0 deletions docs/STATUS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Who is using ARouteServer?

- `GAVLIX <https://gavlix.se/>`__.

- `IX Australia <https://www.ix.asn.au/>`__, BIRD v2.

- `IX-Denver <http://ix-denver.org/>`__, BIRD.

- `MBIX <http://www.mbix.ca/>`__, BIRD.
Expand All @@ -35,6 +37,8 @@ Who is using ARouteServer?

- `NIXI Mumbai (GPX) <https://nixi.in/>`__, BIRD.

- `NZIX <https://ix.nz/>`__, BIRD v2.

- `PIT-IX <https://pit-ix.net/>`__, BIRD.

- `QCIX <http://www.qcix.net/>`__, BIRD.
Expand Down
21 changes: 18 additions & 3 deletions docs/TOOLS.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
.. DO NOT EDIT: this file is automatically created by /utils/build_doc
Tools
=====
.. include:: TOOLS_invalid_routes_reporter.rst

Playground
----------

This is a Docker-based playground that can be use to experiment with ARouteServer.

It offers and environment with several actors, configured to represent specific scenarios that can often be found on a real IX platform: a route server, some clients that announce some good and some bad routes, a looking glass.

The idea is to let the users play with the whole environment and see how easy it is to deploy a secure, feature-rich route server.

For more information: https://github.com/pierky/arouteserver/tree/master/tools/playground

Invalid routes reporter
-----------------------

This script is intended to be used as an `ExaBGP <https://github.com/Exa-Networks/exabgp>`_ process to elaborate and report/log invalid routes received by route servers that have been previously configured using the `"tag" reject policy option <https://arouteserver.readthedocs.io/en/latest/CONFIG.html#reject-policy>`_ of ARouteServer.

For more information: https://invalidroutesreporter.readthedocs.io
6 changes: 0 additions & 6 deletions docs/TOOLS_invalid_routes_reporter.rst

This file was deleted.

3 changes: 3 additions & 0 deletions docs/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ It can be scheduled at regular intervals to re-build the configuration (for exam
cp /etc/bird/bird4.new /etc/bird/bird4.conf && \
birdcl configure
.. Hint::
A Docker-based `playground <https://github.com/pierky/arouteserver/tree/master/tools/playground>`__ is available to experiment with the tool.

.. _perform-graceful-shutdown:

Route server graceful shutdown
Expand Down
2 changes: 1 addition & 1 deletion pierky/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/arin_db_dump.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/ask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/cached_objects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/check_new_release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/clients_from_euroix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/clients_from_peeringdb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/configure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/init_scenario.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/setup_templates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/show_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/tpl_rendering.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/commands/verify_templates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/config/asns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/config/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/config/bogons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/config/clients.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion pierky/arouteserver/config/general.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2020 Pier Carlo Chiodi
# Copyright (C) 2017-2021 Pier Carlo Chiodi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 4472bd3

Please sign in to comment.