TTR Networks

What is BGP?

Border Gateway Protocol

BGP (Border Gateway Protocol) is the routing protocol networks on the internet use to tell each other which IP addresses they can reach, and by which path.

BGP version 4 is defined in RFC 4271. Two routers form a session over TCP port 179, exchange OPEN messages to agree on capabilities, then send UPDATE messages that announce or withdraw prefixes, with KEEPALIVE messages in between and a NOTIFICATION if something goes wrong. Each announced route carries path attributes: the AS_PATH lists every autonomous system the route has passed through, NEXT_HOP says where to send the traffic, and attributes such as LOCAL_PREF and MED let operators express preferences. BGP is a path-vector protocol: rather than calculating a shortest path from a full map like OSPF, each router picks a best path per prefix using a fixed sequence of tie-breakers, and a router that sees its own ASN in the AS_PATH rejects the route, which prevents loops.

BGP is about policy rather than speed. It decides who you accept routes from, which routes you pass on, and which exit your traffic takes, so the configuration that matters most is often the filtering around it. Sessions between different ASes are eBGP; sessions inside one AS are iBGP, which has different rules for passing routes on. Beyond the internet edge, BGP also carries VPN and EVPN routes inside providers and data centres. Common beginner trouble includes sessions stuck in Active or Connect (TCP can't connect), routes received but not installed (an unreachable next hop) and announcing more than you meant to (missing outbound filters). The BGP Fundamentals lesson builds a working session step by step, and Setting up VyOS with basic BGP adds real import and export policy.

Lessons that use BGP

  • BGP FundamentalsTeaches this term · Intermediate · 75 min

    How the Border Gateway Protocol glues the internet together: autonomous systems, sessions, path attributes, best-path selection, iBGP scaling and a hands-on eBGP lab with real FRR configuration.

  • Edge and core: building out a VyOS networkIntermediate · 60 min

    Split one BGP router into edge routers that face the outside world and a core that carries traffic inside: loopbacks, OSPF for infrastructure, iBGP between loopbacks, next-hop-self, and what happens when a link fails. Built and broken on three real VyOS routers.

  • OSPF FundamentalsBeginner · 70 min

    The link-state IGP that runs inside most networks: neighbour adjacencies, LSA flooding, SPF, costs, DR/BDR, areas and LSA types, a hands-on FRR lab, and how OSPF underpins BGP.

  • Debugging BGP: every session state, reproducedIntermediate · 60 min

    Break a working BGP lab a dozen ways and learn to read each failure: Idle, Connect, Active and OpenSent, max-prefix, firewalls, wrong AS, TTL, hold timers, missing policy and unreachable next hops, all with real FRR output and packet captures.

  • BGP on loopbacks vs interface addressesIntermediate · 45 min

    Why BGP sessions between loopbacks survive link failures and use parallel links, and what they need to work: an IGP or static routes, update-source, the eBGP connected check, and BFD. Every failure is reproduced on two real VyOS routers.

  • Setting up VyOS with basic BGPIntermediate · 50 min

    Build a VyOS edge router from scratch: one upstream transit provider, one Internet Exchange route server, and the import and export policy that keeps both safe. Every command and output comes from a real VyOS lab.

  • IPv4 over an IPv6-only core (RFC 8950)Intermediate · 40 min

    Carry IPv4 routes over IPv6 BGP sessions with IPv6 next hops, so core routers need no IPv4 addresses at all. Built on VyOS: the missing router ID, what breaks without the extended next hop capability, native IPv4 on the wire, and why traceroute shows 192.0.0.8.

  • Building a network lab on an Apple Silicon MacBeginner · 45 min

    Run real network labs on an M-series Mac: native FRR and Linux containers, x86-only images through Rosetta, and full x86 VyOS VMs under QEMU in Docker, with the pitfalls that stop most people and a starter lab that mixes all three.

Related terms