Lab Objective:
Learn how to configure BGP.
Lab Purpose:
BGP is the protocol which allows the internet to function. It is an exterior gateway routing protocol and concerns itself with autonomous systems rather than networks. You can see R0 below is in AS1 and R1 is in AS2. BGP makes its forwarding decisions based on paths and rules. In order to understand it fully we would need to spend several weeks studying it, but today we’ll just cover some very basic commands.
Lab Tool:
Packet Tracer
Lab Topology:
Please use the following topology to complete this lab exercise:

Lab Walkthrough:
Task 1:
Connect two routers together using a crossover cable.
Task 2:
Add the IP addresses to the routers connecting the interfaces and then the loopback interfaces. BGP will use the loopback interfaces as the BGP identifier (inserted into the routing updates). The identifier allows the source of the packets to be recorded by all other routers as well as establishes the best path to take.
Router>en
Router#conf t
Router(config)#hostname R0
R0(config)#
Enter configuration commands, one per line. End with CNTL/Z.
R0(config)#int loopback 0
R0(config-if)#ip add 1.1.1.1 255.255.255.0
R0(config-if)#int g0/0
R0(config-if)#ip add 192.168.1.1 255.255.255.252
R0(config-if)#no shut
Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int lo0
R1(config-if)#ip add 2.2.2.2 255.255.255.0
R1(config-if)#int g0/0
R1(config-if)#ip add 192.168.1.2 255.255.255.252
R1(config-if)#no shut
Task 3:
Ping from R0 to R1 to check the connection works.
R0#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms
R0#
Task 4:
Configure BGP on both routers. You need to specify the neighbor details you want the Router to communicate with and the network you wish to advertise.
R0(config)#router bgp 1
R0(config-router)#neighbor 192.168.1.2 remote-as 2
R0(config-router)#network 1.1.1.0 mask 255.255.255.0
R1(config)#router bgp 2
R1(config-router)#neighbor 192.168.1.1 remote-as 1
%BGP-5-ADJCHANGE: neighbor 192.168.1.1 Up
R1(config-router)#network 2.2.2.0 mask 255.255.255.0
You should see the information message below appear when the link comes up.
BGP-5-ADJCHANGE: neighbor 192.168.1.1 Up
Task 5:
Check the routing table with the show ip route command and the routing configurations with the show ip protocols command. We’ll also look at some other BGP commands.
R0#show ip route
Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level-2, ia – IS-IS inter area
* – candidate default, U – per-user static route, o – ODR
P – periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback0
L 1.1.1.1/32 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
B 2.2.2.0/24 [20/0] via 192.168.1.2, 00:00:00
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/30 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
R0#show ip protocols
Routing Protocol is “bgp 1”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
IGP synchronization is disabled
Automatic route summarization is disabled
Neighbor(s):
Address FiltIn FiltOut DistIn DistOut Weight RouteMap
192.168.1.2
Maximum path: 1
Routing Information Sources:
Gateway Distance Last Update
192.168.1.2 20 00:00:00
Distance: external 20 internal 200 local 200
Task 6:
Issue the show tcp brief and show ip bgp neighbors commands. Keep an eye out for the BGP TCP port, which is 179.
R0#show tcp brief
TCB Local Address Foreign Address (state)
517164B0 192.168.1.1.179 192.168.1.2.1025 ESTABLISHED
R0#show ip bgp neighbors
BGP neighbor is 192.168.1.2, remote AS 2, external link
BGP version 4, remote router ID 2.2.2.2
BGP state = Established, up for 00:23:01
Last read 00:23:01, last write 00:23:01, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
[output truncated]
Note:
BGP is an advanced topic and is usually studied for Cisco CCNP or other advanced routing exams.