Basic BGP Lab
Basic BGP Lab
Basic BGP Lab
1/19
Pre-requisites
This exercise builds upon the congurations implemented in the IS-IS + Static routing lab. You must
be able to:
Ping your neighbour router in the same AS using its loopback address (both IPv4 and IPv6!).
Ping your neighbour routers in other ASs using their point-to-point link addresses.
Note: Actually, if everyone congured their IS-IS and static routes properly in the previous exercise,
you should be able to ping all other routers in the lab using their loopback address.
Workshops - http://workshops.nsrc.org/dokuwiki/
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
iBGP Conguration
Enable the BGP process
Before we set up iBGP, we need to do some basic preparation on the router. The Cisco IOS defaults
are not optimised, so before we bring up BGP sessions, we should set the parameters that we require.
On Cisco routers, the default distance for eBGP is 20, the default distance for iBGP is 200, and the
default distance for IS-IS is 115. This means that there is a potential for a prex learned by eBGP to
override the identical prex carried by IS-IS. To protect against accidents, the eBGP distance is set to
200 also.
The command to do this is the distance bgp subcommand:
distance bgp <external-routes> <internal-routes> <local-routes>
We also want to:
Enable logging of BGP neighbour state changes
Congure deterministic calculations of MEDs
Disable the automatic exchange of IPv4 unicast routes on every peering session.
This must be done in all future BGP congurations of this workshop.
On BX1, BX2 and CX1:
router bgp X0
bgp log-neighbor-changes
bgp deterministic-med
no bgp default ipv4-unicast
!
address-family ipv4
distance bgp 200 200 200
!
address-family ipv6
distance bgp 200 200 200
!
2016/01/17 04:05
3/19
router bgp X0
address-family ipv4
neighbor 100.68.X0.2 remote-as X0
neighbor 100.68.X0.2 update-source loopback 0
neighbor 100.68.X0.2 description iBGP with BX2
neighbor 100.68.X0.2 password NSRC-BGP
neighbor 100.68.X0.2 next-hop-self
neighbor 100.68.X0.2 send-community
neighbor 100.68.X0.2 activate
!
address-family ipv6
neighbor 2001:db8:X0::2 remote-as X0
neighbor 2001:db8:X0::2 update-source loopback 0
neighbor 2001:db8:X0::2 description iBGP with BX2
neighbor 2001:db8:X0::2 password NSRC-BGP
neighbor 2001:db8:X0::2 next-hop-self
neighbor 2001:db8:X0::2 send-community
neighbor 2001:db8:X0::2 activate
You need a similar conguration for BX1 peering with CX1. What needs to change from the above
conguration example?
On BX2:
router bgp X0
address-family ipv4
neighbor 100.68.X0.1 remote-as X0
neighbor 100.68.X0.1 update-source loopback 0
neighbor 100.68.X0.1 description iBGP with BX1
neighbor 100.68.X0.1 password NSRC-BGP
neighbor 100.68.X0.1 next-hop-self
neighbor 100.68.X0.1 send-community
neighbor 100.68.X0.1 activate
!
address-family ipv6
neighbor 2001:db8:X0::1 remote-as X0
neighbor 2001:db8:X0::1 update-source loopback 0
neighbor 2001:db8:X0::1 description iBGP with BX1
neighbor 2001:db8:X0::1 password NSRC-BGP
neighbor 2001:db8:X0::1 next-hop-self
neighbor 2001:db8:X0::1 send-community
neighbor 2001:db8:X0::1 activate
You need a similar conguration for BX2 peering with CX1. What needs to change from the above
conguration example?
Also, what do you think the conguration for CX2 would look like? Is it similar? What is dierent? The
instructors will discuss this in class during the exercise. There is a Cisco IOS conguration scaling
feature called a peer-group. Many network operators using Cisco IOS routers use peer-group to scale
their BGP congurations.
Workshops - http://workshops.nsrc.org/dokuwiki/
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
Once the conguration has been entered, check the conguration as displayed by the router:
show run | begin router bgp
Notice how the router has rearranged the BGP conguration, separating the generic from the
address-family specic conguration.
Check that the BGP sessions are up on both sides.
show ip bgp summary
show bgp ipv6 unicast summary
Explaining some of the above commands we used for the BGP conguration:
update-source species the interface which should be used as the source of all BGP packets
originated by the router. The default is the outgoing interface.
next-hop-self tells iBGP to use the source address of the BGP update message as the value of the
next-hop attribute sent to the iBGP peer, rather than the default value which is the IP address of the
router that we heard the BGP update from.
send-community tells BGP to include the BGP community attribute when sending BGP updates to
neighbouring BGP speakers. Cisco IOS does not include the community attribute by default. It is
important to send BGP communities to all iBGP neighbours, but be very careful about sending
communities to external BGP neighbours, as we will see in the following BGP Policy Lab.
activate tells the router to activate this BGP peering inside this address family. At the time of writing,
Cisco IOS activates IPv4 peers automatically inside IPv4 address families, but does not activate IPv6
peers inside IPv6 address families. Safest just to include the conguration in all templates.
2016/01/17 04:05
5/19
Create a static route for the prex being announced on each router:
On BX1, BX2 and CX1:
ip route 100.68.X0.0 255.255.255.0 null0
ipv6 route 2001:db8:X0::/48 null0
These are called a pull up routes
Get the list of learned paths again. You should see both your prex and the neighbours.
Q. Why are these routes needed?
STOP - Checkpoint One
All groups must nish this part before continuing. Please do NOT continue until the instructor
says so.
Workshops - http://workshops.nsrc.org/dokuwiki/
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
2016/01/17 04:05
7/19
Workshops - http://workshops.nsrc.org/dokuwiki/
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
2016/01/17 04:05
9/19
Bring up BGP between the NREN routers and the RREN and check that the prexes originated by
NREN1, NREN2 and the RREN are all visible in each other's BGP tables.
ISP2:
no
no
no
!
no
no
no
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
ip bgp
bgp ipv6 unicast
ip route
ipv6 route
You should be learning routes advertised by other groups, and also from the NRENs and the ISPs.
Remove your static default routes from routers BX2:
On B12:
no ip route 0.0.0.0 0.0.0.0 100.121.1.1
no ipv6 route ::/0 2001:18:0:10::
You should be able to ping any other router now. If you can't, wait for other groups to nish. If other
groups are nished, work them to work out what might be wrong. If you cannot see what is wrong,
ask the instructors.
Use traceroute to verify the paths that packets are following towards various destinations:
B11# traceroute 100.100.0.1
B11# traceroute 100.68.30.2
...
Repeat the same tests from the other router in your AS and compare. Use the diagram to help you
visualise it.
http://workshops.nsrc.org/dokuwiki/
2016/01/17 04:05
11/19
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
2016/01/17 04:05
13/19
For NREN1:
interface GigabitEthernet2/0
description P2P Link to ISP1
ip address 100.101.2.1 255.255.255.252
no ip redirects
no ip proxy-arp
ipv6 address 2001:11:0:20::/127
ipv6 nd prefix default no-advertise
ipv6 nd ra suppress
no shutdown
!
Do the same for the ISP1, NREN2 and ISP2 routers. They will have a very similar conguration, just the
addresses will be dierent - refer to the address plan.
And then set up the external BGP session between the NREN and ISP routers. Here is a sample
conguration for the ISP1 router:
router bgp 121
address-family ipv4
neighbor 100.101.2.1 remote-as 101
neighbor 100.101.2.1 description eBGP with NREN1 (AS101)
neighbor 100.101.2.1 password NSRC-BGP
neighbor 100.101.2.1 activate
!
address-family ipv6
neighbor 2001:11:0:20:: remote-as 101
neighbor 2001:11:0:20:: description eBGP with NREN1 (AS101)
neighbor 2001:11:0:20:: password NSRC-BGP
neighbor 2001:11:0:20:: activate
!
The conguration for NREN1, NREN2 and ISP2 routers will be very similar - again refer to the address
plan for the correct IP addresses to use.
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
2016/01/17 04:05
15/19
Workshops - http://workshops.nsrc.org/dokuwiki/
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
hostname NREN1
aaa new-model
aaa authentication login default local
aaa authentication enable default enable
username nsrc secret nsrc-PW
enable secret nsrc-EN
service password-encryption
line vty 0 4
transport preferred none
line console 0
transport preferred none
no logging console
logging buffered 8192 debugging
no ip domain-lookup
ipv6 unicast-routing
ipv6 cef
no ip source-route
no ipv6 source-route
!
interface Loopback0
ip address 100.101.0.1 255.255.255.255
ipv6 address 2001:11::1/128
!
interface GigabitEthernet1/0
description P2P Link to RREN
ip address 100.100.1.2 255.255.255.252
no ip directed-broadcast
no ip redirects
no ip proxy-arp
ipv6 address 2001:10:0:10::1/127
ipv6 nd prefix default no-advertise
ipv6 nd ra suppress
no shutdown
!
! (repeat for Group 2 and Group 3 using Gig4/0 and 5/0)
interface GigabitEthernet3/0
description P2P Link to R11
ip address 100.101.1.1 255.255.255.252
no ip directed-broadcast
no ip redirects
no ip proxy-arp
ipv6 address 2001:11:0:10::/127
ipv6 nd prefix default no-advertise
ipv6 nd ra suppress
no shutdown
!
! inbound filter for AS10 - repeat for AS20 and AS30
ip prefix-list AS10-in permit 100.68.10.0/24
ipv6 prefix-list AS10-v6-in permit 2001:db8:10::/48
!
http://workshops.nsrc.org/dokuwiki/
2016/01/17 04:05
17/19
Last update:
2016/01/17 03:36
2016:preginet-bgp:2-lab-bgp-basic http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
http://workshops.nsrc.org/dokuwiki/
2016/01/17 04:05
19/19
From:
http://workshops.nsrc.org/dokuwiki/ - Workshops
Permanent link:
http://workshops.nsrc.org/dokuwiki/doku.php?id=2016:preginet-bgp:2-lab-bgp-basic
Last update: 2016/01/17 03:36
Workshops - http://workshops.nsrc.org/dokuwiki/