I have two Routers, which are Router1(BGP 100) and Router2(BGP 200), they have set up BGP neighbor for each other:
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
sh ip bgp neighbors 12.0.0.2 routes
on Router1 say?show ip bgp neigh
shows it.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 thenetwork
statements tell BGP to advertise exactly that, but only if it already exists in the routing table.