Cisco All Config Format
Cisco All Config Format
Today I am going to talk about the configurations of BGP on Cisco Routers. I will explain
some of the terms which we are going to use in the configurations. Please let me know if
you guys required any specific configuration in BGP or you can share the design with us so
that we can create the configurations accordingly.
Sometimes if it difficult to set up a BGP configurations in the lab or in the live environment,
so here in this article I am just posting the sample configurations which will help you guys
to configure BGP in your labs or in the live environment. There is no relevance of this
configuration with any of the live networks. All IPs taken in the configuration is just a
sample IP addresses taken.
BGP is a wide routing protocol which is used on to connect the WAN links between two
different AS. AS stands for autonomous systems. Below is a sample BGP topology and is not
relevant what sample configurations shared with you in the below article.
Fig 1.1- Sample BGP Topology
We have two kinds of BGP sessions; one is iBGP which is internal BGP and other is eBGP
which is external BGP. Both have different AD values on Cisco routers
• iBGP : 200
• eBGP : 20
Lets start from the beginning, as you all know BGP is a Exterior gateway protocol to
connect different routers in the different AS. We are going to showcase the basic
configurations in the routers as below.
Basic Configurations
!
interface loopback 0
ip address 115.10.7.1 255.255.255.255
!
router bgp 100
network 120.220.1.0
neighbor 115.10.7.2 remote-as 100
neighbor 115.10.7.2 update-source loopback0
neighbor 115.10.7.3 remote-as 100
neighbor 115.10.7.3 update-source loopback0
!
Configuring MED
!
router bgp 400
neighbor 220.5.1.1 remote-as 200
neighbor 220.5.1.1 route-map set-med out
!
route-map set-med permit 10
match ip address prefix-list MATCH
set metric 1000
!
ip prefix-list MATCH permit 192.68.1.0/24
!
Configuring Prefix Lists
!
router bgp 200
neighbor 220.200.1.1 remote-as 210
neighbor 220.200.1.1 prefix-list PEER-IN in
neighbor 220.200.1.1 prefix-list PEER-OUT out
!
ip prefix-list PEER-IN deny 218.10.0.0/16
ip prefix-list PEER-IN permit 0.0.0.0/0 le 32
ip prefix-list PEER-OUT permit 215.7.0.0/16
!
Configuring Communities
!
router bgp 100
neighbor 220.200.1.1 remote-as 200
neighbor 220.200.1.1 send-community
neighbor 220.200.1.1 route-map set-community out
!
route-map set-community permit 10
match ip address prefix-list NO-ANNOUNCE
set community no-export !
route-map set-community permit 20
!
ip prefix-list NO-ANNOUNCE permit 172.168.0.0/16 ge 17
!
===========================Endings===============================