Sunday, August 7, 2011

Configuring BGP - Single Homed Design

BGP is a highly complex routing protocol -- so complex that there are exams dedicated to just this protocol. Therefore, I will not dwell on the details and the inner workings of BGP, however I will give you a brief how-to implement a "Single Homed" BGP design

When it comes to BGP designs they are four basic ones: single homed, dual homed, single multihomed and dual mutihomed. In this blogtorial we are going to see how to implement a "Single homed" BGP design

Here is the topology which I will be using and we will be building upon this topology on future BGP blogtorials so let's get started. 
Relevant configurations are posted below.

R3 is in our enterprise core and has OSPF as its IGP. In a hierarchical model, Enterprise core will usually connect to the distribution layer which will then connect to the access layer. Core layer should have fast transport, fault tolerance, low latency, and high reliability. Below are the relevant configurations for R3. 

R3#conf t
R3(config)#int fast1/0
R3(config-if)#ip add
R3(config-if)#no shut
R3(config)#router ospf 1
R3(config-router)#network area 0

R1 is in our enterprise edge and has OSPF for IGP and BGP for EGP. In a hierarchical model, Enterprise edge should contain E-commerce, DMZ, WAN, and Remote Access VPN. Enterprise edge should also be the default gateway for the enterprise core. Enterprise edge is where you would deploy single/dual homed and single/dual multihomed designs. Below are the relevant configurations for R1.

R1#conf t
R1(config)#int fast1/0
R1(config-if)#ip add
R1(config-if)#no shut
R1(config)#int g2/0
R1(config-if)#ip add
R1(config-if)#no shut
R1(config)#router ospf 1
R1(config-router)#network area 0
R1(config-router)#default-information originate
R1(config)#router bgp 22222
R1(config-router)#neighbor remote-as 11111
R1(config-router)#network mask
R1(config)#ip route null 0

R2 is in the service provider edge. R2 has a couple of static routes to advertise into BGP and is advertising a default route to R1 which will then get propagated throughout the enterprise core. Below are the relevant configurations from R2. 

R2#conf t
R2(config)#int g1/0
R2(config-if)#ip add
R2(config-if)#ip address
R2(config-if)#no shut
R2(config)#ip route null 0
R2(config)#ip route  null 0
R2(config)#router bgp 11111
R2(config-router)#network mask
R2(config-router)#neighbor remote-as 22222
R2(config-router)#neighbor default-originate ** advertise a default route to the peer **

Few show commands from the routers to verify BGP and connectivity. 

R2#sh ip bgp summary

Neighbor        V          AS                   MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd          4         22222                      35      36              4          0     0        00:32:32        1

R1#sh ip route
<-- output shortened --> is subnetted, 1 subnets
B [20/0] via, 00:32:08 ** BGP learned route ** is subnetted, 1 subnets
S is directly connected, Null0 ** static route to inject into BGP ** is subnetted, 2 subnets
C is directly connected, FastEthernet1/0
C is directly connected, GigabitEthernet2/0
B* [20/0] via, 00:32:08 ** default route from BGP because of the default originate command in R2 ** 

R1#sh ip bgp
<-- output shortened --> 
   Network          Next Hop            Metric LocPrf Weight Path
*>                 0             0 11111 i
*>                 0             0 11111 i
*>                  0         32768 i

R3#sh ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface          1   FULL/BDR        00:00:36        FastEthernet1/0

R3#sh ip route
<-- output shortened --> is subnetted, 1 subnets
C is directly connected, FastEthernet1/0
O*E2 [110/1] via, 00:33:59, FastEthernet1/0 ** default route injected by R1 ** 

As you can see R1 is BGP (Single homed) with R2 advertising a /24 ( and R1 is advertising a default to the enterprise core (R3).

Stay tuned for single multihomed (single router in the enterprise edge connected to 2 different ISPs), dual single homed (dual routers in the enterprise edge connected to 1 ISP) and dual multihomed (dual routers in the enterprise edge connected to 2 different ISPs). 

As always, please subscribe if you like my posts by clicking on "Join this site".