0

I'm learning bgp and studying on a simple lab I'm unable to ping a loop0 two hops away while the loop0 on the nex-hop router is reachable

Topology is simple R3-R1-R2, from R2 i'm able to ping loop0 on R1 but not the one on R3

All destinations are reachable only from direct connected router

All prefixes are present in bgp table and correctly advertised and also the routes in routing table of all routers as per logs below

R1

R1#sh ip route bgp | b Gateway
Gateway of last resort is not set

      192.168.0.0/32 is subnetted, 3 subnets
B        192.168.0.2 [20/0] via 10.0.0.1, 02:23:18
B        192.168.0.3 [20/0] via 10.0.13.1, 02:23:18

R1#sh bgp ipv4 uni | b Network
     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.0.1/32   0.0.0.0                  0         32768 i
 *>  192.168.0.2/32   10.0.0.1                 0             0 2 i
 *>  192.168.0.3/32   10.0.13.1                0             0 3 i

R2

R2#sh ip route bgp | b Gateway
Gateway of last resort is not set

      192.168.0.0/32 is subnetted, 3 subnets
B        192.168.0.1 [20/0] via 10.0.0.0, 02:25:53
B        192.168.0.3 [20/0] via 10.0.0.0, 02:25:53

R2#sh bgp ipv4 uni | b Network
     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.0.1/32   10.0.0.0                 0             0 1 i
 *>  192.168.0.2/32   0.0.0.0                  0         32768 i
 *>  192.168.0.3/32   10.0.0.0                               0 1 3 i

R3

R3#sh ip route bgp | b Gateway
Gateway of last resort is not set

      192.168.0.0/32 is subnetted, 3 subnets
B        192.168.0.1 [20/0] via 10.0.13.0, 02:27:45
B        192.168.0.2 [20/0] via 10.0.13.0, 02:27:14

R3#sh bgp ipv4 uni | b Network
     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.0.1/32   10.0.13.0                0             0 1 i
 *>  192.168.0.2/32   10.0.13.0                              0 1 2 i
 *>  192.168.0.3/32   0.0.0.0                  0         32768 i

Also a trace from R2 should go through R1 to reach R3 but stops on R1

R2#trace 192.168.0.3
Type escape sequence to abort.
Tracing the route to 192.168.0.3
VRF info: (vrf in name/id, vrf out name/id)
  1 10.0.0.0 5 msec 5 msec 6 msec
  2  *  *  *
  3  *  *  *
  4

And the BGP config on all routers (in order R1-2-3)

R1#sh run | s bg
router bgp 1
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 network 192.168.0.1 mask 255.255.255.255
 neighbor 10.0.0.1 remote-as 2
 neighbor 10.0.13.1 remote-as 3

R2#sh run | s bg
router bgp 2
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 network 192.168.0.2 mask 255.255.255.255
 neighbor 10.0.0.0 remote-as 1

R3#sh run | s bg
router bgp 3
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 network 192.168.0.3 mask 255.255.255.255
 neighbor 10.0.13.0 remote-as 1

Could someone please help me to better understand what's wrong?

3
  • Are your pings sourced from the loopback? We need to see your configs too.
    – Ron Trunk
    Commented Nov 4, 2023 at 12:15
  • Just tried and it works fine, but why without source it does not work? R2#ping 192.168.0.3 source 192.168.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.3, timeout is 2 seconds: Packet sent with a source address of 192.168.0.2 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/6 ms R2#ping 192.168.0.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.3, timeout is 2 seconds: .... Success rate is 0 percent (0/4)
    – Matteo
    Commented Nov 4, 2023 at 12:27
  • R3#sh run Building configuration... Current configuration : 2067 bytes ! mmi polling-interval 60 no mmi auto-configure no mmi pvc mmi snmp-timeout 180 ! no ip icmp rate-limit unreachable ! no ip domain lookup ip cef no ipv6 cef ! ip tcp synwait-time 5 ! interface Loopback0 ip address 192.168.0.3 255.255.255.255 ! interface Ethernet0/0 ip address 10.0.13.1 255.255.255.254 ! router bgp 3 bgp router-id 3.3.3.3 bgp log-neighbor-changes network 192.168.0.3 mask 255.255.255.255 neighbor 10.0.13.0 remote-as 1 ! ip forward-protocol nd other routers are the same
    – Matteo
    Commented Nov 4, 2023 at 12:33

1 Answer 1

1

When you ping without specifying the source address, the router uses the closest interface for the source of the pings. So R1 will use the interface address connected to R2 (10.0.0.0) as the source of the pings. But R3 has no route to 10.0.0.0, so it can't send a reply.

1
  • Adding a default 0/0 to both R2 and R3 and redistributing into bgp now it works fine. Thanks a lot, solved
    – Matteo
    Commented Nov 4, 2023 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.