BGP : configuration en entreprise
BGP (Border Gateway Protocol) est le protocole de routing inter-AS d'Internet et 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-practices 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 ou route-reflector)
- NLRI : Network Layer Reachability Information
- Prefix : réseau 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 et 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 pour influencer traffic)
- route-map RM-IN deny 10 ; match as-path 1 (match transit ASN à 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) : pour ASN 4-bytes
BFD pour 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 des routes iBGP-learned vers iBGP-peers interdite → full-mesh obligatoire. Scale : N(N-1)/2 sessions. 50 routeurs = 1225 sessions !
Route Reflectors (RR)
- Clients RR ont 1 session vers RR
- RR redistribue routes iBGP à ses clients
- Placement : 2 RR minimum pour redondance (clustering RR)
- Recommandé >20 routeurs iBGP
Best practices entreprise
- Toujours authentifier MD5 ou TCP-AO
- Max-prefix limits : neighbor X maximum-prefix 10000 80 (alerte à 80%)
- Filter inbound/outbound systématiquement (pas de 'permit any')
- Utiliser soft-reconfiguration ou route refresh (RFC 2918)
- BFD pour convergence <1s
- Documentation des 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
Routeurs BGP entreprise (Cisco ISR/ASR, Juniper MX, FortiGate, Palo Alto). Configuration eBGP multi-homing + iBGP RR clé-en-main. Formation BGP pour équipes OPTINOC clients.
