F
F
FloorZ2015-02-27 05:08:43
Cisco
FloorZ, 2015-02-27 05:08:43

How to properly configure BGP?

Good afternoon. I'm trying to figure out the BGP protocol.
Created the diagram below. Registered everywhere BGP.
Here is what sh ip bgp shows at 117:

Router#sh ip bgp
BGP table version is 25, local router ID is 192.168.0.15
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 100.0.0.0/23      0.0.0.0                  0     0     0 117 i
*>                   117.0.0.2                0     0     0 108 i
*                    105.0.0.1                0     0     0 105 109 i
*                    116.1.0.1                0     0     0 116 i
*> 192.168.0.0/24    0.0.0.0                  0     0 32768 i
*                    105.0.0.1                0     0     0 105 i
*                    105.0.0.1                0     0     0 105 i
*                    116.1.0.1                0     0     0 116 120 i
*                    117.0.0.2                0     0     0 108 109 i

For testing on a BGP 117 router, I registered Lo1 with IP 192.168.0.16. I registered Lo1 with IP 192.168.0.1 on the BGP 120 router.
I want 192.168.0.16 to be able to ping 192.168.0.1. I tried to register a static route on lo1 on BGP 120, something like this:
ip route 192.168.0.0 255.255.255.0 lo1
But something does not ping. Although there seems to be a route.
5539b3b3726d4fa781af95123c91d332.jpg
BGP 117 Configuration
Router(config)#do sh run
Building configuration...

Current configuration : 1069 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX152410ZM
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 100.0.0.17 255.255.255.255
!
interface Loopback1
 ip address 192.168.0.15 255.255.255.0
!
interface GigabitEthernet0/0
 ip address 117.0.0.1 255.255.255.252
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 105.0.0.2 255.255.255.252
 duplex auto
 speed auto
!
interface GigabitEthernet0/2
 ip address 116.1.0.2 255.255.255.252
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router bgp 117
 bgp log-neighbor-changes
 no synchronization
 neighbor 117.0.0.2 remote-as 108
 neighbor 105.0.0.1 remote-as 105
 neighbor 116.1.0.1 remote-as 116
 network 100.0.0.0 mask 255.255.254.0
 network 192.168.0.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

BGP 120 configuration:
Router#sh run
Building configuration...

Current configuration : 932 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 100.0.0.20 255.255.255.255
!
interface Loopback1
 ip address 192.168.0.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 116.0.0.2 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 120.0.0.1 255.255.255.252
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router bgp 120
 bgp log-neighbor-changes
 no synchronization
 neighbor 120.0.0.2 remote-as 104
 neighbor 116.0.0.1 remote-as 116
 network 100.0.0.0 mask 255.255.254.0
 network 192.168.0.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FloorZ, 2015-02-27
@FloorZ

Although retreat. Already figured out the protocol by trial and error. I did not understand the protocol correctly, more precisely, in the principle of its routing. Now I thought a little and realized that I did not correctly understand the principle of BGP.
Now 117 and other routers are quietly pinging the entire 192.168.0.0/23 mesh.
3aad8326472c4958bda0ca920b790bc4.jpg

Router#ping 192.168.0.35

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.35, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

Here is what sh ip bgp shows:
Router(config)#do ip bgp
ip bgp
   ^
% Invalid input detected at '^' marker.
  
Router(config)#do sh ip bgp
BGP table version is 71, local router ID is 100.0.0.17
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 104.0.0.0/24      117.0.0.2                0     0     0 108 109 104 i
*  105.0.0.0/24      117.0.0.2                0     0     0 108 109 105 i
*> 108.0.0.0/24      117.0.0.2                0     0     0 108 i
*> 109.0.0.0/24      117.0.0.2                0     0     0 108 109 i
*> 116.0.0.0/24      117.0.0.2                0     0     0 108 109 104 120 116 i
*  116.1.0.0/24      117.0.0.2                0     0     0 108 109 104 120 116 i
*> 117.0.0.0/24      0.0.0.0                  0     0 32768 i
*> 120.0.0.0/24      117.0.0.2                0     0     0 108 109 104 120 i
*> 192.168.0.0/23    117.0.0.2                0     0     0 108 109 104 120 i

But I "broke" one of the wires:
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
%BGP-5-ADJCHANGE: neighbor 117.0.0.2 Down Interface flap
%BGP-5-ADJCHANGE: neighbor 116.1.0.1 Up
%BGP-5-ADJCHANGE: neighbor 105.0.0.1 Up
Router(config)#do sh ip bgp
BGP table version is 87, local router ID is 100.0.0.17
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 104.0.0.0/24      116.1.0.1                0     0     0 116 120 104 i
*                    105.0.0.1                0     0     0 105 109 104 i
*  105.0.0.0/24      116.1.0.1                0     0     0 116 120 104 109 105 i
*                    105.0.0.1                0     0     0 105 i
*  108.0.0.0/24      116.1.0.1                0     0     0 116 120 104 109 108 i
*>                   105.0.0.1                0     0     0 105 109 108 i
*  109.0.0.0/24      116.1.0.1                0     0     0 116 120 104 109 i
*>                   105.0.0.1                0     0     0 105 109 i
*> 116.0.0.0/24      116.1.0.1                0     0     0 116 i
*                    105.0.0.1                0     0     0 105 109 104 120 116 i
*  116.1.0.0/24      116.1.0.1                0     0     0 116 i
*                    105.0.0.1                0     0     0 105 109 104 120 116 i
*> 117.0.0.0/24      0.0.0.0                  0     0     0 117 i
*> 120.0.0.0/24      116.1.0.1                0     0     0 116 120 i
*                    105.0.0.1                0     0     0 105 109 104 120 i
*> 192.168.0.0/23    116.1.0.1                0     0     0 116 120 i
*                    105.0.0.1                0     0     0 105 109 104 120 i

And here is the complete config 117 (I did the same on all routers)
Router(config)#do sh run
Building configuration...

Current configuration : 1065 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX152410ZM
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 100.0.0.17 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 117.0.0.1 255.255.255.252
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 105.0.0.2 255.255.255.252
 duplex auto
 speed auto
!
interface GigabitEthernet0/2
 ip address 116.1.0.2 255.255.255.252
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router bgp 117
 bgp log-neighbor-changes
 no synchronization
 neighbor 117.0.0.2 remote-as 108
 neighbor 105.0.0.1 remote-as 105
 neighbor 116.1.0.1 remote-as 116
 network 100.0.0.0 mask 255.255.254.0
 network 117.0.0.0 mask 255.255.255.0
!
ip classless
ip route 117.0.0.0 255.255.255.0 Null0 
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end


Router(config)#

On BGP 120 there is such a route.
Everything seems to be =)

A
Alexander, 2015-03-05
@aleksashka

I was wondering how the 117th router announces the 100th network:
Network Next Hop Metric LocPrf Weight Path
*> 100.0.0.0/23 0.0.0.0 0 0 0 117 i
if the mask in the network command in router bgp 117 is different from that , what hangs on the interface?
interface Loopback0
ip address 100.0.0.17 255.255.255.255
router bgp 117
network 100.0.0.0 mask 255.255.254.0 A
real BGP network will only work if both network and mask match an existing route in the routing table. So it's most likely a Packet Tracer glitch.
Besides strongly confuse the static routes looking in loopback. What for? Do you need to pass traffic through the routing table twice?
What for in general a statics if the purpose - to understand with dynamics?
Why are the loopbacks of different routers on the same subnet 192.168.0.0/24? They must be on different subnets (give each a /32 mask).
As a result: you can remove all statics, all network commands, raise neighborhoods on all physical links (neigbor), declare only (!) your loopback networks (network 192.168.0.17 mask 255.255.255.255 for 117, network 192.168.0.1 mask 255.255 .255.255 for 120 and similar for all others).
We will get sh ip bgp in each of the routers, showing only 192.168.0.x/32 routes. After that, you can safely ping any loopback from your loopback (from the one advertised in BGP).
ping 192.168.0.1 source lo0
No static needed, drop any link - pings will be restored as long as there is at least one way to get to the target.
It is not necessary to declare connections between routers (you can generally have repeated addressing and achieve normal ping between all loopbacks). I don’t know if this will work adequately in Packet Tracer, I would recommend raising GNS3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question