I want to show a basic BGP configuration for Internet access. In our case, we have two carriers (Sprint & Level3) and we act as 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 22.214.171.124/24 as our official IP block.
To show some different conditions, our connected Level3 router is also the BGP router, but the Sprint BGP router has been located 3 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 126.96.36.199 remote-as 1239
! Descriptions are always helpful
neighbor 188.8.131.52 description Sprint
! Our bgp neighbor in Sprint 3 hops away
neighbor 184.108.40.206 ebgp-multihop 3
! Sprint will use our Loopback IP (220.127.116.11) for us as the neighbor
neighbor 18.104.22.168 update-source Loopback 0
! If we have enough memory, we can prevent BGP session resets on inbound updates
neighbor 22.214.171.124 soft-reconfiguration inbound
! We won’t announce any network other than ourselves
neighbor 126.96.36.199 filter-list 1 out
! Now the Level 3
neighbor 188.8.131.52 remote-as 3356
neighbor 184.108.40.206 description LevelThree
neighbor 220.127.116.11 soft-reconfiguration inbound
neighbor 18.104.22.168 filter-list 1 out
! Sprint BGP bridgehead is not directly connected to our router
! We must add necessary routing
ip route 22.214.171.124 255.255.255.255 126.96.36.199
! 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 in the middle of the Internet, BGP configuration is not a big issue.