BGP路由协议设备
Internal BGP
•IGBP refers to the presence of BGP neighbors within the same AS. • The neighbors do not have to be directly connected.
External BGP
• When BGP neighbors belong to different autonomous systems they are called EBGP. • EBGP neighbors, by default, need to be directly connected.
BGP forwarding table/database
❖List of all networks learned from each neighbor ❖Can contain multiple pathways to destination networks ❖Database contains BGP attributes for each pathway
• The term remote-as shows what AS this neighbor is in. This AS number is used to determine if the neighbor is internal or external.(邻居AS号一样,为 IBGP;不一样为EBGP.)
Network *> 10.0.0.0 *> 172.16.10.0/24
Next Hop 10.1.1.100 10.1.1.100
Metric LocPrf Weight Path
0
0 65200 i
0
0 65200 i
BGP Message Types
BGP defines the following message types: – Open:(版本号4,AS号,保持时间,路由器ID)
before it can set up a BGP relationship.
Example: BGP neighbor Command
BGP network Command
Router(config-router)#
network network-number [mask network-mask]
BGP Characteristics (特征)
BGP is a distance-vector protocol with the following enhancements:
Reliable updates: BGP runs on top of TCP (port 179;可靠通信.)
Incremental, triggered updates only(增量更新,触发更新) Periodic keepalive messages to verify
BGP路由协议
BGP Autonomous Systems
• An AS is a collection of networks under a single technical administration.(自治系统经典定义:在单一 技术下管理下,采用同一种内部网关协议和统一度量值在AS内转发数据包,并采用一种外部协议将 数据包转发到其他AS的一组路由器.) • IGPs operate within an AS. • BGP is used between Autonomous Systems. • Exchange of loop-free routing information is guaranteed.(BGP的主要目标是提供一种能够保证自治 系统间无环路的路由选择信息交换的域间路由系统.)
IP routing table
❖List of best paths to destination networks(列出了到目标网 络的最佳路径)
BGP表
运行BGP的路由器保存着一个独立于IP路由表 的BGP表.
SHOW IP BGP
BGP table version is 23, local router ID is 192.168.1.49 Status codes: s suppressed, d damped, h history, * valid, > best, i internal Origin codes: i - IGP, e - EGP, ? - incomplete
• This command tells BGP what network to advertise, not how to advertise the network.(宣告什么网络,将此路由注入BGP;也可使用再发布.)
• The command does not activate the protocol on an interface. • Without a mask option, it advertises classful networks. If a subnet of the classful network
Neighbor
V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down
State/PfxRcd
10.1.1.100
4 65200
211
211
13 0 0 00:01:53
5
192.168.1.18 4 65101
ቤተ መጻሕፍቲ ባይዱ
214
226
23 0 0 00:00:13
1
192.168.1.34 4 65101
• This command is used for both external and internal neighbors. • The IP address specified is the destination address of BGP packets going to
this neighbor.(TCP连接或环回口地址.) • This router must have an IP pathway to reach this neighbor
BGP States
When establishing a BGP session, BGP goes through the following steps: Idle(闲置状态): Router is searching routing table to
see if a route exists to reach the neighbor. Connect(连接状态): Router found route and has
214
226
23 0 0 00:00:09
1
192.168.1.50 4 65101
214
225
23 0 0 00:00:06
3
BGP Commands
Router(config)#
router bgp autonomous-system(64512-65535)
• This command, with no subcommands, does not activate BGP.(还需要其他子命令配合.)
• Includes holdtime and BGP router ID – Keepalive:(类似HELLO包) – Update:(撤消路由,路径属性,网络层可达信息)
• Information for one path only (could be to multiple networks) • Includes path attributes and networks – Notification:(通告消息,检测到出错条件时,发送通知消息) • When error is detected • BGP connection is closed after sent
BGP Peering
RouterA# show ip bgp summary
BGP table version is 23, main routing table version 23 10 network entries and 11 paths using 1242 bytes of memory 4 BGP path attribute entries using 380 bytes of memory BGP activity 23/13 prefixes, 38/27 paths 0 prefixes revised.
• The autonomous system number in this command is compared to the autonomous system numbers listed in neighbor statements to determine if the neighbor is an internal or external neighbor.(确定邻居关系)
BGP neighbor Command
Router(config-router)#
neighbor {ip-address | peer-group-name} remote-as autonomous-system
• The neighbor command activates a BGP session with this neighbor.(只有指定邻居双方,才能建立会话.)
completed three-way TCP handshake. Open sent(发送消息): Open message sent with
the parameters(参数) for the BGP session. Open confirm(确认消息): Router received agreement