Вы находитесь на странице: 1из 5

Configuring external BGP on Cisco Router

To configure external Border Gateway Routing Protocol (eBGP) on Cisco a router.

Cisco IOS Router Command List


Command Router# configure terminal Router(config-if)# No shutdown Description Activates the configuration mode from the terminal. Enable the interface Displays the summary of IP addresses and status of each interface in the router Displays the routers IP routes Used to test the reach ability of a host on an Internet Protocol (IP) network. This command is used to enable bgp protocol on a router in a specific Autonomous System. The neighbor command specifies the peer routers interface IP address with which bgp communication will take place for exchanging the routes. This command is used to enter configuration commands to a particular interface. The ex: Shows the command to configure on the serial 0/0/0 interface. This command is used to ping an IP address to verify connectivity. This command is used to show the BGP neighbours

Router# show ip interface brief Router# show ip route Router# ping <ip address> Router(config)# router bgp < AS Number>

Router(config-router)#neighbor <y.y.y.y> remote-as <AS Number> Router(config)# interface <interface name> Router # ping <x.x.x.x>

Router# show ip bgp neighbors

Lab Topology
The lab topology to configure external BGP (eBGP) consists of devices R1, R2, and Core Router. When eBGP routing protocol is enabled on Routers R1 & R2, they will advertise the

networks connected to them through eBGP. The configuration for core router is already done with the IP address shown in the topology. The students will login either into R1 or R2, assign the IP address on Fast Ethernet interfaces, and configure BGP. Once the configuration is over, they will verify the operation of the IBGP protocol by using the show ip route command. To ensure it is external BGP (eBGP) we will use show ip bgp neighbours command. To check whether we are able to reach to a new network, we will use the command ping. As per our topology, router R1 will learn about network 10.0.0.0 through eBGP and router R2 will learn network 192.168.1.1 through eBGP protocol. Figure 1.1 below shows the topology used for this lab exercise.

Table 5.1 below shows the commands the students should use to configure the routers.
Table 5.1: IP address for the interface

Interface Fast Ethernet 0/0 Fast Ethernet 0/0

Router R1 R2

IP address 192.168.1.10 10.0.0.10

Subnet Mask 255.255.255.0 255.255.255.0

Note: When configuring BGP, if the autonomous system number used is different on all the routers then it will be external Border Gateway Protocol (IBGP).

Enabling BGP
We need to first ensure that there is connectivity from routers R1 and R2 to the core router. This is achieved by configuring IP address on FastEthernet interfaces of both routers R1 and R2. After the IP addresses are assigned, and BGP has been enabled, the core router will advertise new routes to both routers R1 and R2. Router R1 configuration 1. IP address configuration

Assign the IP address on the both Fast Ethernet interfaces of routers R1 and R2. IP addresses can be referred from the table 1.1 above. Also the interfaces should be administratively up for traffic to flow.
R1# configure terminal R1(config)# interface FastEthernet 0/0 R1(config-if)# ip address 192.168.1.10 255.255.255.0 R1(config-if)# no shutdown R1(config-if)#^Z

2. Enabling BGP BGP protocol is used to exchange route information between routers. Routers can be part of the same autonomous system (AS) or can belong to different autonomous system (AS). Every router will be part of an autonomous system. An autonomous system is a group of networks under the same administrative domain. To ensure the routers send out advertisements and exchange routes known to them, enable BGP routing protocol on them using the following set of commands.
R1 (config) # router bgp 100 R1 (config-router) # neighbor 192.168.1.1 remote-as 200 R1 (config-router) #^Z

Observe the neighbor command, here we have specified the IP address of the peer routers (core router in this case) interface, along with the autonomous system number with which router R1 will be establishing the BGP connection. As the Autonomous number of router R1 and the autonomous system number of the peer router are different this makes the BGP as external BGP (eBGP). 3. Verifying BGP When BGP routing protocol is enabled, both router will establish a peer connection and exchange information about the paths they know. In our topology the router R1 will advertise network 192.168.1.0/24 and router R2 will advertise 10.0.0.0/24 networks to the core router. The core router will advertise network 10.0.0.0/24 to router R1 and network 192.168.1.0/24 to router R2. BGP routes are maintained in the routing table with letter B preceding the route. First verify that the routers have learnt the paths with the help of BGP protocol. Also verify whether it is eBGP or not. And finally we can verify the connectivity using ping command.
R1# show ip bgp neighbors | include bgp BGP neighbor is 192.168.1.1, remote AS 200, external link BGP version 4, remote router ID 192.168.1.1 BGP state = Established, up for 00:04:20 BGP table version 1, neighbor version 1

Show ip bgp neighbours command shows the details of the bgp neighbouring. We have filtered the output of this command by using | include bgp where it will show only the bgp neighbour details and not other details like the packets exchanged etc.
R1#sh ip route C 192.168.1.0/24 is directly connected, FastEthernet0/0 B 10.0.0.0/24 [200/0] via 192.168.1.1, 01:41:17

To verify that we can actually reach the network 10.0.0.0 learnt via eBGP, we will perform ping to IP address 10.0.0.10 in that network. The following commands illustrates ping on router R1.
R1# ping 10.0.0.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

As you can see from the output, the ping is successful indicating connectivity between router R1 and network 10.0.0.0 via the core router. Router 2 configurations eBGP protocol can be verified from router R2 as well by following the steps given above. The configuration for router R2 is given below: IP address configuration
R2# configure terminal R2(config)# interface FastEthernet 0/0 R2(config-if)# ip address 10.0.0.10 255.255.255.0 R2(config-if)# no shutdown R2(config-if)#^Z

Configuring BGP protocol


R2 (config) # router bgp 300 R2 (config-router) # neighbor 10.0.0.1 remote-as 200 R2 (config-router) #^Z

Observe that the core router is configured with autonomous number 200. Verifying routing table
R2#sh ip route C 10.0.0.0/24 is directly connected, FastEthernet0/0 B 192.168.1.0/24 [200/0] via 10.0.0.1, 01:41:17

Verify BGP Neighbours


R1# show ip bgp neighbors | include bgp BGP neighbor is 10.0.0.1, remote AS 200, external link BGP version 4, remote router ID 10.0.01 BGP state = Established, up for 00:04:20 BGP table version 1, neighbor version 1

Verify Connectivity
R1# ping 192.168.1.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Вам также может понравиться