Juniper JunOS BGP (eBGP / iBGP / RR)
eBGP and iBGP configuration for Juniper JunOS with route reflectors, peer groups, communities, import/export policies, and prefix-list filters.
What is it?
Juniper BGP is configured under 'protocols bgp' using peer groups — all neighbors sharing the same policy and type (eBGP/iBGP) belong to the same group. Import and export policies are JunOS route policies defined under 'policy-options policy-statement' — far more expressive than Cisco route-maps. JunOS BGP requires explicit export policy to advertise routes — unlike Cisco IOS where 'network' statements work without a route-map. Juniper is widely deployed as internet exchange (IX) route servers, MPLS PE routers, and ISP edge routers, so its BGP implementation is highly mature.
When to use
- ·ISP and internet edge routing with full BGP tables
- ·MPLS L3VPN PE-to-PE signaling with BGP VPNv4/VPNv6 address families
- ·Internet Exchange peering — Juniper is common at IXPs
- ·Route reflector deployments for large iBGP topologies
When NOT to use
- ·Internal routing only — use OSPF or IS-IS for IGP routing inside the network
- ·Small networks where a static default route is sufficient
How it compares
Prerequisites
- →AS number must be set: 'set routing-options autonomous-system <ASN>'
- →Router ID should be set via a loopback address
- →Import/export policies should be created before enabling BGP neighbors to prevent accidental route leaks
- →For iBGP: IGP (OSPF or IS-IS) must be running so PE loopbacks are reachable
Config Generator
Verification commands
show bgp summaryShow all BGP peers and their state
ExpectedPeers show 'Establ' state with non-zero 'Prefixes' received. 'Active' or 'Idle' means session not up.
show route protocol bgpShow BGP routes installed in the routing table
ExpectedLists all active BGP routes with AS path and next-hop
show bgp neighbor <peer-ip> received-routesShow all routes received from a peer (before import policy)
ExpectedAll routes the peer is advertising. If empty, peer is not sending routes.
Debug commands
show bgp neighbor <peer-ip>Show detailed BGP session info, error notifications, and policy counts
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
BGP Design and Implementation
Randy Zhang & Micah Bartell · Cisco Press · The practical BGP bible — iBGP, eBGP, policies, communities, design patterns
Internet Routing Architectures
Sam Halabi · Cisco Press · BGP for ISPs and large enterprise — AS path, route reflectors, confederation