BGP lab: connect two autonomous systems in your browser
The third networking lab: five machines inside the student’s one Ubuntu VM. r1 is the whole of AS 65001 and r2 the whole of AS 65002, each running FRRouting with its BGP daemon started and nothing configured, with a host behind each. The first ping from h1 to h2 fails because r1 has never heard of that network.
What students learn
Making two routers in different autonomous systems neighbours across the link between them and watching the session come up with show bgp summary. Making each AS announce the network its host lives on and seeing what each router has learned with show bgp ipv4 unicast and show ip route bgp. If the session is up and nothing is exchanged, they look up ebgp-requires-policy in FRRouting’s documentation, which is the lesson.
The private network behind r2 belongs to AS 65002 alone, so they announce nothing that would let h1 reach it: the beginning of routing policy.
The topology
h1 connects to r1, r1 to r2 across an inter-AS link and r2 to h2, with a private network, 192.168.99.0/24, behind r2. The addresses are in the README the lab leaves in the home folder.
Run it in your browser
VM labs are set as a lab task in a module, and the sample is on the lab’s page.
- Add the lab. In a module you teach, add a task and choose the Ubuntu VM lab card. The page shows a short description of the machine instead of a compose file.
- Start from the sample. The page offers three networking labs to start from. Choose Networking lab 3: BGP between two autonomous systems. Using a sample replaces the text, and Undo brings yours back.
- Publish and start your own copy. Publish, then Start. The lab’s own setup script installs FRRouting and builds the topology from Ubuntu’s archive the first time the VM starts, in about ten seconds.
- Open the terminal. Open its terminal and read README.md in the home folder: it says what to do and gives none of the answers. netlab status lists the machines and netlab shell r1 opens a router’s console.
A basic lesson on this lab
BGP Basics is a small lesson worked in this lab, which is an Ubuntu VM: each step is explained and has a Run button that types its command into the machine’s terminal and shows what the router answered. A student meets the machines, tries to cross the network and fails, and asks the router whether BGP is set up and what it knows.
They look around and leave the lab’s own task, making the network work, to the student, so the lesson hands out no answers. A free personal account is given it on the Basics module, which is on Home, every college can copy it from the Library’s Basics folder, and a new college opens with it in a module called Networking Basics (Sample). They are deliberately small: they show a teacher what a lesson worked in a lab is, and the lab does the rest. Copy one into a module of your own to change it.
How it is marked
The check runs on a copy of the saved machine after a fresh start. It passes only if each router has an Established session with the other’s AS, each has a route to the other’s network that BGP learned, h1 reaches h2 along that path, and AS 65002 has not announced its private network.
- Hand it out. Assign the lab like any task, with a due date if you want one. Each student gets a VM of their own, kept between sessions.
- Run the check. On a student’s row in the class list, press Run the check. It starts a copy of their saved machine that is not saved back, runs the lab’s check script as root and shows whether it passed, what it printed and when. The student is not told the result.
- Mark it. Read what the check printed. When a student stops their VM the class list also shows what they changed, the packages they installed and the files they wrote, so you can mark without starting it. Send the work back with a reason if it needs more.
The definition on GitHub
The file is the whole lab definition, the same text the platform runs. Copy it to make your own topology: daemons bgpd starts the protocol on every router.
Questions people ask
- Is it internal or external BGP?
- External: the two routers are in different autonomous systems, 65001 and 65002, which is why the ebgp-requires-policy default matters.
- Does anything touch the real internet?
- No. The whole network is inside the student’s VM, and the autonomous system numbers are in the range reserved for private use.
- How is the BGP lab different from the OSPF lab?
- The OSPF lab has three routers in one area, all in the same network. In the BGP lab r1 is the whole of AS 65001 and r2 the whole of AS 65002, so the student makes a session between two autonomous systems, announces a network from each and keeps the private network behind r2 unannounced.