BGP Configuration for Enterprise Internet Redundancy
Dual-homed BGP gives an enterprise two independent internet paths with automatic failover and optional load balancing.
Lab Topology
TEXT
ISP1 (AS 65001) ─── [RTR1 - AS 65100] ─── Enterprise LAN
ISP2 (AS 65002) ─── [RTR1] 10.0.0.0/8Basic eBGP Configuration (Cisco IOS-XE)
TEXT
router bgp 65100
bgp router-id 203.0.113.1
bgp log-neighbor-changes
! ISP1 neighbor
neighbor 198.51.100.1 remote-as 65001
neighbor 198.51.100.1 description ISP1-Primary
neighbor 198.51.100.1 password ISPsecret1
neighbor 198.51.100.1 update-source GigabitEthernet0/0
! ISP2 neighbor
neighbor 198.51.100.5 remote-as 65002
neighbor 198.51.100.5 description ISP2-Secondary
neighbor 198.51.100.5 password ISPsecret2
! Advertise enterprise prefix
network 203.0.113.0 mask 255.255.255.0Path Selection: Prefer ISP1
Use local preference to prefer ISP1:
TEXT
route-map ISP1-IN permit 10
set local-preference 200
route-map ISP2-IN permit 10
set local-preference 100
router bgp 65100
neighbor 198.51.100.1 route-map ISP1-IN in
neighbor 198.51.100.5 route-map ISP2-IN inOutbound Load Balancing
To split outbound traffic between ISPs, use AS-PATH prepending on ISP1:
TEXT
route-map OUT-ISP2 permit 10
set as-path prepend 65100 65100 ! Makes ISP2 path look shorter to ISP2Prefix Filtering (Security)
Never accept a full routing table if you don't need it. Use prefix-lists:
TEXT
ip prefix-list DEFAULT-ONLY seq 5 permit 0.0.0.0/0
ip prefix-list DEFAULT-ONLY seq 10 deny 0.0.0.0/0 le 32
router bgp 65100
neighbor 198.51.100.1 prefix-list DEFAULT-ONLY inVerification
TEXT
show bgp summary
show bgp ipv4 unicast 0.0.0.0
show ip route bgp
debug ip bgp 198.51.100.1 events