I want to present a simple BGP configuration for Internet access. In our illustration, we have two carriers (Sprint & Level3), and we pretend to be an enterprise company, which needs reliable Internet access.
As a precondition, we need an Autonomous System Number (ASN) and an IP address block assigned to us. We have to apply ARIN / RIPE / APNIC / LACNIC / AFRINIC for this purpose. We assume that we have 6767 as our AS number and 188.8.131.52/24 as our official IP block.
To be able to show some different situations, I prefer to assume connected Level3 router is also the BGP router, but the Sprint BGP router is three hops away.
! We are starting with the router command with our ASN like EIGRP/OSPF configuration
router bgp 6767
! We have one router in our case and we don’t need IGP / BGP synchronization it is the default in newest IOSes
! To have some idea about our peering history we are recording events
! We are announcing our network
! Our first neighbor is Sprint, we have to define neighbor ASN
neighbor 184.108.40.206 remote-as 1239
! Descriptions are always helpful
neighbor 220.127.116.11 description Sprint
! Our bgp neighbor in Sprint 3 hops away
neighbor 18.104.22.168 ebgp-multihop 3
! We will use our Loopback IP (22.214.171.124) to reach Sprint
neighbor 126.96.36.199 update-source Loopback 0
! If we have enough memory, we can prevent BGP session resets on inbound updates
neighbor 188.8.131.52 soft-reconfiguration inbound
! We won’t announce any network other than ourselves
neighbor 184.108.40.206 filter-list 1 out
! Now the Level 3
neighbor 220.127.116.11 remote-as 3356
neighbor 18.104.22.168 description LevelThree
neighbor 22.214.171.124 soft-reconfiguration inbound
neighbor 126.96.36.199 filter-list 1 out
! Sprint BGP bridgehead is not directly connected to our router
! We must add necessary routing
ip route 188.8.131.52 255.255.255.255 184.108.40.206
! This filter means we are not announcing Sprint networks to Level3 or vice versa.
ip as-path access-list 1 permit ^$
In the end, if you are not at the core of the Internet, BGP configuration is not a big issue.