我有两个路由器,分别是Router1(BGP 100)和Router2(BGP 200),它们相互建立了BGP邻居:
这是我的 Router1 的 BGP 配置:
!
router bgp 100
bgp log-neighbor-changes
no synchronization
neighbor 12.0.0.2 remote-as 200
!
这是我的Router2的BGP配置:
!
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
!
你看,在我的 BGP 200 中,我已经声明了 network network 2.0.0.0 mask 255.255.255.0。
但是为什么在我的Router1中,没有2.0.0.0/24路由呢?
这是Router1的路由:
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
在我的Router2中,show ip route 有显示
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
在 Router1 中,我显示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
我运行show ip bgp,似乎没有 bgp 连接:
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
