BGP : configuration en entreprise
BGP (Border Gateway Protocol) est le protocole de routing inter-AS d'Internet and l'épine dorsale de l'entreprise moderne (MPLS, SD-WAN, multi-cloud). Ce guide couvre la configuration BGP entreprise : eBGP/iBGP, path attributes, communities, BFD, best-practithese 2026.
Terminologie essentielle
- AS (Autonomous System) : domaine de routing, identifié par ASN (1-4.2 milliards)
- ASN privés : 64512-65534 (16-bit), 4200000000-4294967294 (32-bit)
- eBGP : peering entre AS différents (TTL 1 par défaut, 255 si multihop)
- iBGP : peering dans même AS (full-mesh obligatoire or route-reflector)
- NLRI : Network Layer Reachability Information
- Prefix : network annoncé (ex : 10.0.0.0/24)
Path attributes BGP (ordre de préférence)
- Weight (Cisco, local) : plus haut préféré
- Local Preference (dans AS) : plus haut préféré
- AS_PATH : le plus court préféré
- Origin : IGP > EGP > Incomplete
- MED (Multi-Exit Discriminator) : plus bas préféré (inter-AS)
- eBGP > iBGP
- IGP cost vers next-hop : plus bas préféré
- Router-ID : plus bas préféré (tiebreaker)
Configuration basique Cisco IOS
- router bgp 65001
- bgp router-id 10.0.0.1
- bgp log-neighbor-changes
- no bgp default ipv4-unicast : désactiver par défaut
- neighbor 203.0.113.2 remote-as 65002
- neighbor 203.0.113.2 description Peer-FAI-OVH
- neighbor 203.0.113.2 password CiscoBGPPass
- address-family ipv4 ; neighbor 203.0.113.2 activate ; neighbor 203.0.113.2 soft-reconfiguration inbound ; network 10.0.0.0 mask 255.255.0.0
- neighbor 203.0.113.2 route-map RM-IN in ; neighbor 203.0.113.2 route-map RM-OUT out
Configuration Juniper
- set routing-options autonomous-system 65001
- set protocols bgp group EXT type external
- set protocols bgp group EXT peer-as 65002
- set protocols bgp group EXT neighbor 203.0.113.2
- set protocols bgp group EXT export ADVERTISE-LOCAL
- set policy-options policy-statement ADVERTISE-LOCAL term 1 from route-filter 10.0.0.0/16 exact
- set policy-options policy-statement ADVERTISE-LOCAL term 1 then accept
Route-maps and prefix-lists (Cisco)
- ip prefix-list PL-OUR-PREFIXES seq 10 permit 10.0.0.0/16
- route-map RM-OUT permit 10 ; match ip address prefix-list PL-OUR-PREFIXES ; set as-path prepend 65001 65001 (ex : prepending for influencer traffic)
- route-map RM-IN deny 10 ; match as-path 1 (match transit ASN to refuser)
Communities
- ip community-list 1 permit 65001:100 : tag local-pref haute
- route-map RM-IN permit 20 ; match community 1 ; set local-preference 200
- BGP communities well-known : no-export, no-advertise, local-as
- Large communities (RFC 8092) : for ASN 4-bytes
BFD for convergence rapide
- bfd-template single-hop BGP-BFD ; interval min-tx 300 min-rx 300 multiplier 3
- neighbor 203.0.113.2 bfd
- Convergence : <1s vs 90s (par défaut BGP keepalive)
iBGP full-mesh vs Route Reflectors
iBGP règle : re-advertisement of routes iBGP-learned vers iBGP-peers interdite → full-mesh obligatoire. Scale : N(N-1)/2 sessions. 50 routers = 1225 sessions !
Route Reflectors (RR)
- Clients RR ont 1 session vers RR
- RR redistribue routes iBGP to its clients
- Placement : 2 RR minimum for redundancy (clustering RR)
- Recommandé >20 routers iBGP
Best practithese entreprise
- Toujours authentifier MD5 or TCP-AO
- Max-prefix limits : neighbor X maximum-prefix 10000 80 (alerte to 80%)
- Filter inbound/outbound systématiquement (pas de 'permit any')
- Usesr soft-reconfiguration or route refresh (RFC 2918)
- BFD for convergence <1s
- Documentation of communities (65001:100 = LP haute, 65001:200 = backup, etc.)
Multi-homing BGP
Active/Standby
Inbound : prepending AS_PATH sur backup. Outbound : local-pref basse sur backup.
Active/Active
Load-balancing via ECMP BGP (maximum-paths 2). Risque asymétrie trafic — attention aux firewalls.
Troubleshooting
- show ip bgp summary : état sessions
- show ip bgp 10.0.0.0 : détails d'une route
- show ip bgp neighbors X received-routes : routes reçues avant filtres
- show ip bgp neighbors X routes : routes après filtres in
- debug ip bgp updates (attention production !)
Commander chez OPTINOC
Routers BGP entreprise (Cisco ISR/ASR, Juniper MX, FortiGate, Palo Alto). Configuration eBGP multi-homing + iBGP RR clé-en-main. Form factorion BGP for équipes OPTINOC clients.
