Configuring BGP
Problem
You want to run BGP in a simple network.
Solution
In its simplest configuration, BGP exchanges routes between a router in one AS and another router in a different AS. The first router is in AS 65500:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface
Router1(config-if)#
Serial0
ip address
Router1(config-if)#
192.168.55.6 255.255.255.252
exit
Router1(config)#router bgp
Router1(config-router)#
65500
network
Router1(config-router)#
192.168.1.0
neighbor
192.168.55.5
remote-as
Router1(config-router)#
65501
no synchronization
Router1(config-router)#exit
Router1(config)#end
Router1#
The second router is in AS 65501:
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router2(config)#interface
Router2(config-if)#
Serial0
ip address
Router2(config-if)#
192.168.55.5 255.255.255.252
exit
Router2(config)#router bgp
Router2(config-router)#
65501
network
172.25.17.0
mask
Router2(config-router)#
255.255.255.0
neighbor
192.168.55.6
remote-as
Router2(config-router)#
65500
no synchronization
Router2(config-router)#exit
Router2(config)#end
Router2#
Discussion
This example shows two routers in different Autonomous Systems.
Router1
is in AS 65500, and is
configured to share routing information only for a single network
using the command network
192.168.1.0
. Because this is a
classful network, we don’t need to include a mask. However, you will
notice that the syntax of the network command on
Router2 ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.