{"id":17330984,"url":"https://github.com/dougbtv/zebra-pen","last_synced_at":"2026-04-28T11:35:40.804Z","repository":{"id":73314101,"uuid":"80634188","full_name":"dougbtv/zebra-pen","owner":"dougbtv","description":"A suite of playbooks and roles to create a demo router VNF, in containers","archived":false,"fork":false,"pushed_at":"2017-10-09T19:34:53.000Z","size":3971,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T11:15:36.811Z","etag":null,"topics":["containers","docker","nfv","playbook","router","vms"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dougbtv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-01T15:37:08.000Z","updated_at":"2020-06-22T04:14:21.000Z","dependencies_parsed_at":"2023-06-08T10:03:07.026Z","dependency_job_id":null,"html_url":"https://github.com/dougbtv/zebra-pen","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbtv%2Fzebra-pen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbtv%2Fzebra-pen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbtv%2Fzebra-pen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbtv%2Fzebra-pen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dougbtv","download_url":"https://codeload.github.com/dougbtv/zebra-pen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791971,"owners_count":20672671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","docker","nfv","playbook","router","vms"],"created_at":"2024-10-15T14:53:00.268Z","updated_at":"2026-04-28T11:35:35.754Z","avatar_url":"https://github.com/dougbtv.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zebra-pen\n\n![nfvpe-bdage](https://img.shields.io/badge/nfvpe-approved-green.svg) ![apache-badge](https://img.shields.io/badge/license-Apache%20v2-blue.svg)\n\nA suite of playbooks and roles to create a demo router VNF, in containers.\n\n## Goal\n\nHave box `CentOS A` ping box `CentOS B` via containerized routers running on Router A \u0026 Router B.\n\n```\nCentOS A -\u003e Router A -\u003e Router B -\u003e CentOS B\n```\n\n## About the architecture\n\n![layout diagram](http://i.imgur.com/oXQQWjy.png)\n\nIn the current iteration we're going to use a specialized script, [koko](https://github.com/redhat-nfvpe/koko), created by [Tomo](https://github.com/s1061123) which allows us to specifically craft network interfaces for each container. These allow us to create 2 interfaces (one in each container) that are connected. This playbook spins up the diagrammed containers, and creates the interfaces as diagrammed above.\n\nThis configuration uses OSPFd in Quagga for routing from Centos A through the two routers (Quagga A \u0026 Quagga B) to Centos B, and then back through in the reverse direction.\n\n## Running the playbooks\n\nThere's basically two styles here -- one of which uses a single host, with all veth connections between docker containers on that single host. The second style uses two VMs and has vxlan between the routers on the two hosts (and veth connections for containers on the same local host).\n\n### Single Host\n\nTo kick off this playbook, use the inventory file located at `./inventory/single_vm.inventory` as a basis and then run:\n\n```\n$ ansible-playbook -i inventory/single_vm.inventory koko-single-vm.yml\n```\n\n### Two-hosts (with VXLAN)\n\nTo kick off this playbook, use the inventory file located at `./inventory/vxlan.lab.inventory` as a basis and then run:\n\n```\n$ ansible-playbook -i ./inventory/vxlan.lab.inventory vxlan.yml\n```\n\n## OpenShift style.\n\nSo you wanna use it with openshift?\n\n### Install OpenShift\n\n\nFirst, [spin up openshift manually](https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md) -- use `oc cluster up` to make a all-in-one openshift instance for ease-of-use.\n\nHere's how I setup my openshift\n\n```\n# Set ip_forward to 1\n/sbin/sysctl -w net.ipv4.ip_forward=1\n\n# Install docker (plus a handy wget)\nyum install -y docker wget\n\n# Setup docker to allow an \"insecure\" registry.\nsed -i -e \"s|\\# INSECURE_REGISTRY='--insecure-registry'|INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'|\" /etc/sysconfig/docker\n\n# Start and enable docker.\nsystemctl daemon-reload\nsystemctl start docker\nsystemctl enable docker\n\n# Download the oc command line tool.\nwget https://github.com/openshift/origin/releases/download/v3.6.0-rc.0/openshift-origin-client-tools-v3.6.0-rc.0-98b3d56-linux-64bit.tar.gz\ntar -xzvf openshift-origin-client-tools-v3.6.0-rc.0-98b3d56-linux-64bit.tar.gz \ncp openshift-origin-client-tools-v3.6.0-rc.0-98b3d56-linux-64bit/oc /usr/bin/\nchmod +x /usr/bin/oc\n\n# Check that it's in your path.\noc version\n\n# Bring up the cluster.\noc cluster up\n\n# See that you can get pods (likely nothing there yet)\noc get pods\n\n# Login as admin.\noc login -u system:admin\n\n# Check the cluster (err, AIO) status.\noc status\n```\n\n### Running the OpenShift playbooks\n\nSetup the an inventory file with two hosts, used below is my reference inventory:\n\n```\nansible-playbook -i inventory/vxlan.dougaws.inventory openshift-vxlan.yml \n```\n\n## Verifying the results.\n\nOnce that has run, you can verify that it is working by checking the running containers on a host, and then entering the `centos_a` container, and pinging the IP address for `centos_b`.\n\nFor example, to ping the IP address for `centos_b` from `centos_a` execute a command like so:\n\n```bash\n$ docker exec -it centos_a ping -c2 4.4.4.4\nPING 4.4.4.4 (4.4.4.4) 56(84) bytes of data.\n64 bytes from 4.4.4.4: icmp_seq=1 ttl=62 time=0.073 ms\n64 bytes from 4.4.4.4: icmp_seq=2 ttl=62 time=0.080 ms\n```\n\nAnd vice-versa for a ping to `centos_a` from `centos_b`\n\n```\n[root@zebra centos]# docker exec -it centos_b ping -c2 1.1.1.1\nPING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.\n64 bytes from 1.1.1.1: icmp_seq=1 ttl=62 time=0.098 ms\n64 bytes from 1.1.1.1: icmp_seq=2 ttl=62 time=0.065 ms\n```\n\n## Further configuration\n\nIf you'd like to further configure the routers, without saving the changes to the playbook (and note that these changes may be ephemeral in nature) you can enter the `vtysh` in either the `quagga_a` or `quagga_b` containers, like so:\n\n```\n[user@host ~]$ docker exec -it quagga_a vtysh\n\nHello, this is Quagga (version 0.99.23.1+cl3u2).\nCopyright 1996-2005 Kunihiro Ishiguro, et al.\n\nquagga_a# configure terminal \nquagga_a(config)# \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougbtv%2Fzebra-pen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougbtv%2Fzebra-pen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougbtv%2Fzebra-pen/lists"}