BGP 边界网关协议 心得


关于BGP 的一些总结
·BGP是一种路径向量路由选择协议 。路由更新带有到达一个远程网络所需通过网络的全部列表
·peer根据本地AS号的关系进行定义 。在相同AS内的对等体形成了一个内部BGP关系,而在不同AS内的对等体则使用EBGP.
·IBGP对等体彼此交换可到达信息,并把BGP信息重新分发给运行在相同AS内的IGP 。
·IBGP对等体必须和IGP保持同步以确保IGP 路由通过本地AS传播 。
·MED是一种没有单位的量度,可以用Router map 进行修改
·指定本地优先级属性来控制路径选择进程 。本地首选采用网络前缀在AS中广播,也就是说只在AS中有意义 。
·weight同样只对本地路由器有意义 。
·最佳路径的选择参照上一个帖子
·BGP使用UDP端口179和TCP端口179 形成对等体或邻居之间的可靠传输
关于聚合
R2#sh ip bgp
BGP table version is 5, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.1.24.0 192.1.1.1 0 0 100 i
*> 192.1.25.0 192.1.1.1 0 0 100 i
*> 192.1.26.0 194.1.1.1 0 0 300 i
*> 192.1.27.0 194.1.1.1 0 0 300 i
R2(config-router)#aggregate-address 192.1.24.0 255.255.252.0 ?
advertise-map Set condition to advertise attribute
as-set Generate AS set path information
attribute-map Set attributes of aggregate
route-map Set parameters of aggregate
summary-only Filter more specific routes from updates
suppress-map Conditionally filter more specific routes from updates

R2(config-router)#aggregate-address 192.1.24.0 255.255.252.0 as
R2(config-router)#aggregate-address 192.1.24.0 255.255.252.0 as-set
R2(config-router)#end
R2#
01:00:17: %SYS-5-CONFIG_I: Configured from console by console
R2#
R6#2
[Resuming connection 2 to r3 ... ]
R3>
R3>
R3>en
PassWord:
R3#sh ip bgp
BGP table version is 6, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i192.1.24.0 193.1.1.1 0 100 0 100 i
*>i192.1.24.0/22 193.1.1.1 100 0 {100,300} i
*>i192.1.25.0 193.1.1.1 0 100 0 100 i
*>i192.1.26.0 193.1.1.1 0 100 0 300 i
*>i192.1.27.0 193.1.1.1 0 100 0 300 i
==========================================================================
router bgp 200
no synchronization
bgp log-neighbor-changes
aggregate-address 192.1.24.0 255.255.252.0 as-set summary-only
neighbor 192.1.1.1 remote-as 100
neighbor 193.1.1.2 remote-as 200
neighbor 193.1.1.2 next-hop-self
neighbor 194.1.1.1 remote-as 300
!

ip classless
no ip http server
!
!
line con 0
transport input none
line aux 0
transport input all
line vty 0 4
password cisco
login
!
end
R2#
R6#2
[Resuming connection 2 to r3 ... ]
R3#clear ip bgp *
R3#
04:49:01: %BGP-5-ADJCHANGE: neighbor 193.1.1.1 Down User reset
R3#
04:49:29: %BGP-5-ADJCHANGE: neighbor 193.1.1.1 Up sh
R3#show ip bgp
BGP table version is 2, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i192.1.24.0/22 193.1.1.1 100 0 {100,300} i
BGP 正则表达式
_300_ 匹配所有经过AS300的路由
_300$ 匹配所有来自AS300中的路由
^300_ 匹配接受的路由

推荐阅读