cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
372
Views
0
Helpful
6
Replies

bgp route error

i_hanu
Level 1
Level 1

Hi! I see the prefixes from R4 on R1 and the prefixes from R1 in R4 but I can't ping from R1 to the prefixes from R4 and vice versa. Why? Where am I wrong? I attached photo with network. Thanks!

CiscoLinuxBase-4:
Router#show ip bgp
BGP table version is 41, local router ID is 100.100.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.10.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.20.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.30.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.40.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.50.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.60.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.70.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
     Network          Next Hop            Metric LocPrf Weight Path
 *   1.80.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.90.0.0/24      192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *   1.100.0.0/24     192.168.34.1                           0 123 i
 *>                   192.168.24.1                           0 123 i
 *>  100.10.0.0/24    0.0.0.0                  0         32768 i
 *>  100.20.0.0/24    0.0.0.0                  0         32768 i
 *>  100.30.0.0/24    0.0.0.0                  0         32768 i
 *>  100.40.0.0/24    0.0.0.0                  0         32768 i
 *>  100.50.0.0/24    0.0.0.0                  0         32768 i
 *>  100.60.0.0/24    0.0.0.0                  0         32768 i
 *>  100.70.0.0/24    0.0.0.0                  0         32768 i
 *>  100.80.0.0/24    0.0.0.0                  0         32768 i
 *>  100.90.0.0/24    0.0.0.0                  0         32768 i
 *>  100.100.0.0/24   0.0.0.0                  0         32768 i
Router#traceroute 1.10.0.1
Type escape sequence to abort.
Tracing the route to 1.10.0.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.24.1 3 msec 7 msec 4 msec
  2  *  *  * 
  3  *  *  * 
  4  *  *  * 
  5  *  * 
Router#show ip bgp 1.10.0.1
BGP routing table entry for 1.10.0.0/24, version 32
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     2         
  Refresh Epoch 1
  123
    192.168.34.1 from 192.168.34.1 (3.3.3.3)
      Origin IGP, localpref 100, valid, external
      rx pathid: 0, tx pathid: 0
  Refresh Epoch 1
  123
    192.168.24.1 from 192.168.24.1 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0
Router#show ip cef 1.10.0.0 Detail 
1.10.0.0/24, epoch 0, flags [rib only nolabel, rib defined all labels]
recursive via 192.168.34.1
attached to GigabitEthernet0/1 CiscoLinuxBase-1: Router#show ip bgp BGP table version is 41, local router ID is 1.100.0.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *> 1.10.0.0/24 0.0.0.0 0 32768 i *> 1.20.0.0/24 0.0.0.0 0 32768 i *> 1.30.0.0/24 0.0.0.0 0 32768 i *> 1.40.0.0/24 0.0.0.0 0 32768 i *> 1.50.0.0/24 0.0.0.0 0 32768 i *> 1.60.0.0/24 0.0.0.0 0 32768 i *> 1.70.0.0/24 0.0.0.0 0 32768 i *> 1.80.0.0/24 0.0.0.0 0 32768 i *> 1.90.0.0/24 0.0.0.0 0 32768 i *> 1.100.0.0/24 0.0.0.0 0 32768 i *>i 100.10.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.20.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i Network Next Hop Metric LocPrf Weight Path *>i 100.30.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.40.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.50.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.60.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.70.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.80.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.90.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i *>i 100.100.0.0/24 2.2.2.2 0 100 0 4444 i * i 3.3.3.3 0 100 0 4444 i Router#traceroute 100.10.0.1 Type escape sequence to abort. Tracing the route to 100.10.0.1 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.12.2 6 msec 5 msec 5 msec 2 * * * 3 * * * 4 Router#ping 100.10.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 100.10.0.1, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Router#ping 100.10.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 100.10.0.1, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Router#show ip route 100.10.0.1 Routing entry for 100.10.0.0/24 Known via "bgp 123", distance 200, metric 0 Tag 4444, type internal Last update from 2.2.2.2 00:04:11 ago Routing Descriptor Blocks: * 2.2.2.2, from 2.2.2.2, 00:04:11 ago Route metric is 0, traffic share count is 1 AS Hops 1 Route tag 4444 MPLS label: none

Config:

CiscoLinuxBase-4:
interface Loopback1
 ip address 100.10.0.1 255.255.255.0
!
interface Loopback2
 ip address 100.20.0.1 255.255.255.0
!
interface Loopback3
 ip address 100.30.0.1 255.255.255.0
!
interface Loopback4
 ip address 100.40.0.1 255.255.255.0
!
interface Loopback5
 ip address 100.50.0.1 255.255.255.0
!
interface Loopback6
 ip address 100.60.0.1 255.255.255.0
!
interface Loopback7
 ip address 100.70.0.1 255.255.255.0
!
interface Loopback8
 ip address 100.80.0.1 255.255.255.0
!
interface Loopback9
 ip address 100.90.0.1 255.255.255.0
!         
interface Loopback10
 ip address 100.100.0.1 255.255.255.0
!
interface GigabitEthernet0/0
 ip address 192.168.24.2 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
interface GigabitEthernet0/1
 ip address 192.168.34.2 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
router bgp 4444
 bgp log-neighbor-changes
 network 100.10.0.0 mask 255.255.255.0
 network 100.20.0.0 mask 255.255.255.0
 network 100.30.0.0 mask 255.255.255.0
 network 100.40.0.0 mask 255.255.255.0
 network 100.50.0.0 mask 255.255.255.0
 network 100.60.0.0 mask 255.255.255.0
 network 100.70.0.0 mask 255.255.255.0
 network 100.80.0.0 mask 255.255.255.0
 network 100.90.0.0 mask 255.255.255.0
 network 100.100.0.0 mask 255.255.255.0
 neighbor 192.168.24.1 remote-as 123
 neighbor 192.168.34.1 remote-as 123

CiscoLinuxBase-3:
interface Loopback1
 ip address 3.3.3.3 255.255.255.0
!
interface GigabitEthernet0/0
 ip address 192.168.13.2 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
interface GigabitEthernet0/1
 ip address 192.168.23.2 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
interface GigabitEthernet0/2
 ip address 192.168.34.1 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
router ospf 100
 network 3.3.3.0 0.0.0.255 area 0
 network 192.168.13.0 0.0.0.255 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
router bgp 123
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback1
 neighbor 1.1.1.1 next-hop-self
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 update-source Loopback1
 neighbor 2.2.2.2 next-hop-self
 neighbor 192.168.34.2 remote-as 4444
 
CiscoLinuxBase-2:
interface Loopback1
 ip address 2.2.2.2 255.255.255.0
!
interface GigabitEthernet0/0
 ip address 192.168.12.2 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
interface GigabitEthernet0/1
 ip address 192.168.23.1 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
interface GigabitEthernet0/2
 ip address 192.168.24.1 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
router ospf 100
 network 2.2.2.0 0.0.0.255 area 0
 network 192.168.12.0 0.0.0.255 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
router bgp 123
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback1
 neighbor 1.1.1.1 next-hop-self
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source Loopback1
 neighbor 3.3.3.3 next-hop-self
 neighbor 192.168.24.2 remote-as 4444
 
CiscoLinuxBase-1:
interface Loopback1
 ip address 1.1.1.1 255.255.255.0
!
interface Loopback2
 ip address 1.20.0.1 255.255.255.0
!
interface Loopback3
 ip address 1.30.0.1 255.255.255.0
!
interface Loopback4
 ip address 1.40.0.1 255.255.255.0
!
interface Loopback5
 ip address 1.50.0.1 255.255.255.0
!
interface Loopback6
 ip address 1.60.0.1 255.255.255.0
!
interface Loopback7
 ip address 1.70.0.1 255.255.255.0
!
interface Loopback8
 ip address 1.80.0.1 255.255.255.0
!
interface Loopback9
 ip address 1.90.0.1 255.255.255.0
!         
interface Loopback10
 ip address 1.100.0.1 255.255.255.0
!
interface Loopback11
 ip address 1.10.0.1 255.255.255.0
!
interface GigabitEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
!
interface GigabitEthernet0/1
 ip address 192.168.13.1 255.255.255.0
 duplex auto
 speed auto
 media-type rj45

router ospf 100
 network 1.1.1.0 0.0.0.255 area 0
 network 192.168.12.0 0.0.0.255 area 0
 network 192.168.13.0 0.0.0.255 area 0
!
router bgp 123
 bgp log-neighbor-changes
 network 1.10.0.0 mask 255.255.255.0
 network 1.20.0.0 mask 255.255.255.0
 network 1.30.0.0 mask 255.255.255.0
 network 1.40.0.0 mask 255.255.255.0
 network 1.50.0.0 mask 255.255.255.0
 network 1.60.0.0 mask 255.255.255.0
 network 1.70.0.0 mask 255.255.255.0
 network 1.80.0.0 mask 255.255.255.0
 network 1.90.0.0 mask 255.255.255.0
 network 1.100.0.0 mask 255.255.255.0
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 update-source Loopback1
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source Loopback1
2 Accepted Solutions

Accepted Solutions

there is no attachment 
and for ping try use 

redisturbte connected under bgp and check 

MHM

View solution in original post

Jens Albrecht
Level 4
Level 4

Hello @i_hanu,

the network topology is missing but I assume that your topology looks similar to R1 - R2 - R3 - R4.

On R1 and R4 you have network statements for your Loopback interfaces in your BGP config so that e.g. R1 learns the Loopback networks of R4.

This means that you must use the correct source interface for your ping and traceroute commands because the transport networks are not known to the other routers.

So on R1 you have to enter the command "ping 100.10.0.1 source Loopback1" to make sure that R1 uses its Loopback1 IP address as the source address because only the Loopback addresses are known by R4. Same is true for the traceback command or when pinging from R4 to R1. You always have to use one of the Loopback addresses as source in order to get a reply.

Without a source interface R1 uses the IP address of its outgoing interface but this IP address is not know to R4. Hence your ping will arrive but R4 cannot answer because that IP is not in its routing table.

HTH!

View solution in original post

6 Replies 6

there is no attachment 
and for ping try use 

redisturbte connected under bgp and check 

MHM

I attached the photo.

It works, but why? In CEF it's the same thing with network and redistribute.


@MHM Cisco World wrote:

there is no attachment 
and for ping try use 

redisturbte connected under bgp and check 

MHM


Router(config)#router bgp 123
Router(config-router)#no network 1.10.0.0 mask 255.255.255.0
Router(config-router)#no network 1.20.0.0 mask 255.255.255.0
Router(config-router)#no network 1.30.0.0 mask 255.255.255.0
Router(config-router)#no network 1.40.0.0 mask 255.255.255.0
Router(config-router)#no network 1.50.0.0 mask 255.255.255.0
Router(config-router)#no network 1.60.0.0 mask 255.255.255.0
Router(config-router)#no network 1.70.0.0 mask 255.255.255.0
Router(config-router)#no network 1.80.0.0 mask 255.255.255.0
Router(config-router)#no network 1.90.0.0 mask 255.255.255.0
Router(config-router)#no network 1.100.0.0 mask 255.255.255.0
Router(config-router)#redistribute connected
Router(config-router)#exit
Router(config)#exit
Router#show ip cef 100.10.0.0 detail
100.10.0.0/24, epoch 0, flags [rib only nolabel, rib defined all labels]
recursive via 2.2.2.2
nexthop 192.168.12.2 GigabitEthernet0/0
Router#ping 100.10.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.10.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/7/8 ms

======================================================================


Router(config)#router bgp 4444
Router(config-router)#no network 100.10.0.0 mask 255.255.255.0
Router(config-router)#no network 100.20.0.0 mask 255.255.255.0
Router(config-router)#no network 100.30.0.0 mask 255.255.255.0
Router(config-router)#no network 100.40.0.0 mask 255.255.255.0
Router(config-router)#no network 100.50.0.0 mask 255.255.255.0
Router(config-router)#no network 100.60.0.0 mask 255.255.255.0
Router(config-router)#no network 100.70.0.0 mask 255.255.255.0
Router(config-router)#no network 100.80.0.0 mask 255.255.255.0
Router(config-router)#no network 100.90.0.0 mask 255.255.255.0
Router(config-router)#no network 100.100.0.0 mask 255.255.255.0
Router(config-router)#redistribute connected
Router(config-router)#exit
Router(config)#exit
Router#show ip cef 1.10.0.0
1.10.0.0/24
nexthop 192.168.24.1 GigabitEthernet0/0
Router#show ip cef 1.10.0.0 det
Router#show ip cef 1.10.0.0 detail
1.10.0.0/24, epoch 0, flags [rib only nolabel, rib defined all labels]
recursive via 192.168.24.1
attached to GigabitEthernet0/0
Router#ping 1.10.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.10.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/7/9 ms


@i_hanu wrote:

I attached the photo.

It works, but why? In CEF it's the same thing with network and redistribute.


It works because now you also redistribute the connecting links from R1 to R2 and R3 which you did not advertise originally.

However, the "redistribute connected" is nothing but a quick and dirty trick that should NOT be used in real-world implementations!

Why? Because transport networks should not be advertised.

There are two solution 

1- select source in your ping that is reachable from destiantion router 

2- redistrubte connected 

Why?

Source router of ping select IP as source ip which is not reachable from destiantion router' 

This selection not work always 

When we do solution above we forced source router to select IP reachable ( for icmp ping echo' i.e. return back)

MHM

Jens Albrecht
Level 4
Level 4

Hello @i_hanu,

the network topology is missing but I assume that your topology looks similar to R1 - R2 - R3 - R4.

On R1 and R4 you have network statements for your Loopback interfaces in your BGP config so that e.g. R1 learns the Loopback networks of R4.

This means that you must use the correct source interface for your ping and traceroute commands because the transport networks are not known to the other routers.

So on R1 you have to enter the command "ping 100.10.0.1 source Loopback1" to make sure that R1 uses its Loopback1 IP address as the source address because only the Loopback addresses are known by R4. Same is true for the traceback command or when pinging from R4 to R1. You always have to use one of the Loopback addresses as source in order to get a reply.

Without a source interface R1 uses the IP address of its outgoing interface but this IP address is not know to R4. Hence your ping will arrive but R4 cannot answer because that IP is not in its routing table.

HTH!

Your topology is now visible. There was probably a delay because all attachments go through virus scanning before they are shown.

It looks pretty much as expected so that you indeed need to use the ping and traceroute with source interface as explained above.