0

I have two Routers, which are Router1(BGP 100) and Router2(BGP 200), they have set up BGP neighbor for each other:

enter image description here

this is my Router1's BGP configuration:

!
router bgp 100
 bgp log-neighbor-changes
 no synchronization
 neighbor 12.0.0.2 remote-as 200
!

and this is my Router2's BGP configuration:

 !
 router bgp 200
 bgp log-neighbor-changes
 no synchronization
 neighbor 12.0.0.1 remote-as 100
 network 2.0.0.0 mask 255.255.255.0
!

you see, in my BGP 200, I have declared the network network 2.0.0.0 mask 255.255.255.0.

but why in my Router1, there do not have the 2.0.0.0/24 route?

this is the Router1's route:

     1.0.0.0/32 is subnetted, 1 subnets
C       1.0.0.1/32 is directly connected, Loopback0
     12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       12.0.0.0/24 is directly connected, GigabitEthernet0/0
L       12.0.0.1/32 is directly connected, GigabitEthernet0/0

In my Router2, show ip route there show

     2.0.0.0/32 is subnetted, 1 subnets
C       2.0.0.2/32 is directly connected, Loopback0
     12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       12.0.0.0/24 is directly connected, GigabitEthernet0/0/0
L       12.0.0.2/32 is directly connected, GigabitEthernet0/0/0

In Router1, I show the bgp neighbors:

Router1#  show ip bgp neighbors 
BGP neighbor is 12.0.0.2,  remote AS 200, external link
  BGP version 4, remote router ID 2.0.0.2
  BGP state = Established, up for 00:09:05
  Last read 00:09:05, last write 00:09:05, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    InQ depth is 0
    OutQ depth is 0

                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                0          0
    Keepalives:            10         10
    Route Refresh:          0          0
    Total:                 11         11
  Default minimum time between advertisements runs is 30 seconds

 For address family: IPv4 Unicast
  BGP table version 1, neighbor version 6/0
  Output queue size : 0
  Index 1, Offset 0, Mask 0x2
  1 update-group member
                                 Sent       Rcvd
  Prefix activity:               ----       ----
    Prefixes Current:               0          0 (Consumes 0 bytes)
    Prefixes total:                 0          0
    Implicit Withdraw:              0          0
    Explicit Withdraw:              0          0
    Used as bestpath:             n/a          1
    Used as multipath:            n/a          0

                                       Outbound    Inbound
      Local Policy Denied Prefixes:    --------    -------
        Total:                                0          0
      Number of NLRIs in the update sent: max 3, min 1

  Address tracking is enabled, the RIB does have a route to 12.0.0.2
  Connections established 1; dropped 0
  Last reset never
  Transport(tcp) path-mtu-discovery is enabled
Connection state is ESTAB, I/O status: 1, unread input bytes: 0 
Connection is ECN Disabled, Minimum incoming TTL 0, Outgoing TTL 1
Local host: 12.0.0.1, Local port: 1025
Foreign host: 12.0.0.2, Foreign port: 179
Connection tableid (VRF): 0

Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)

Event Timers (current time is 0xC69F4):
Timer          Starts    Wakeups            Next
Retrans             0          0             0x0
TimeWait            0          0             0x0
AckHold            10          0             0x0
SendWnd             0          0             0x0
KeepAlive          10          0             0x0
GiveUp              0          0             0x0
PmtuAger            0          0             0x0
DeadWait            0          0             0x0
Linger              0          0             0x0
ProcessQ            0          0             0x0

iss: 2057115318  snduna: 2057115748  sndnxt: 2057115748     sndwnd:  15955
irs: 3480424370  rcvnxt: 3480424751  rcvwnd:      16004  delrcvwnd:    380

SRTT: 259 ms, RTTO: 579 ms, RTV: 320 ms, KRTT: 0 ms
minRTT: 16 ms, maxRTT: 300 ms, ACK hold: 200 ms
Status Flags: passive open, gen tcbs
Option Flags: nagle, path mtu capable
IP Precedence value : 6

Datagrams (max data segment is 1460 bytes):
Rcvd: 11 (out of order: 0), with data: 0, total data bytes: 0
Sent: 11 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 0, total data bytes: 0
 Packets received in fast path: 0, fast processed: 0, slow path: 0
 fast lock acquisition failures: 0, slow path: 0

EDIT-02

I run the show ip bgp, there seems has no bgp connection:

Router1#show ip bgp 
BGP table version is 1, local router ID is 1.0.0.1
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
  • 4
    Is the BGP session up? What does sh ip bgp neighbors 12.0.0.2 routes on Router1 say? – Teun Vink Mar 27 at 12:03
  • how to check whether the BGP session whether is up? – 244boy Mar 28 at 2:21
  • That's actually in the output you recently added: show ip bgp neigh shows it. – Teun Vink Mar 28 at 5:31
  • The network statements for your IGPs are to tell the IGP which interfaces will participate in the IGP, and the IGP will pick up the networks to advertise from the participating interfaces. That is not how it is done for BGP, which needs to know exactly what to advertise, so the network statements tell BGP to advertise exactly that, but only if it already exists in the routing table. – Ron Maupin Mar 28 at 13:35
8

Router 2 will not advertise networks that are not in its routing table. So if router 2 does not have a route to 2.0.0.0, it will not advertise it. This prevents BGP routers from "blackholing" traffic (i.e. advertising prefixes it can't reach).

  • 4
    And that's one of the uses of null routes. (so the route is always in the table) – Ricky Beam Mar 27 at 16:21
  • the Router2's lo0 use the 2.0.0.2/32 address. so there is a 2.0.0.0 route in Router2. – 244boy Mar 28 at 2:32
  • See my Edited post. there is 2.0.0.0 network in my Router2. – 244boy Mar 28 at 3:42
  • 3
    2.0.0.2/32 is not 2.0.0.0/24, there is no route for that /24, as Ron pointed out. – Teun Vink Mar 28 at 5:32
  • 2
    For a prefix to be advertised, the exact route must be in your routing table. The prefix size is irrelevant. – Teun Vink Mar 28 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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