« Back
in BGP 路由 思科 read.

BGP Neighbor Configuration 命令(1)

1. neighbor {ip-address | peer-group-name} advertisement-interval seconds
ip-address— Neighbor's IP address.
peer-group-name— Name of the peer group.
seconds— 0 to 600.

Defaults: IBGP 5 seconds. EBGP 30 seconds.
To set the minimum interval between the sending of Border Gateway Protocol (BGP) routing updates.
设置发送BGP路由更新的最小时间间隔.
用来解决路由翻动,控制泛洪.

R1 和 R2 EBGP邻居关系 (IBGP同理)
R1#sh ip bgp nei 10.1.12.2
BGP neighbor is 10.1.12.2, remote AS 2, external link
BGP version 4, remote router ID 2.2.2.2
BGP state = Established, up for 00:20:49
Last read 00:00:49, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 3 3
Notifications: 0 0
Updates: 11 0
Keepalives: 31 31
Route Refresh: 3 0
Total: 48 34
Default minimum time between advertisement runs is 30 seconds
修改R1配置,R2保持默认

R1(config)#router bgp 1
R1(config-router)#nei 10.1.12.2 advertisement-interval 20
R1#sh ip bgp nei 10.1.12.2
BGP neighbor is 10.1.12.2, remote AS 2, external link
BGP version 4, remote router ID 2.2.2.2
BGP state = Established, up for 02:32:47
Last read 00:00:47, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 3 3
Notifications: 0 0
Updates: 11 0
Keepalives: 163 163
Route Refresh: 3 0
Total: 180 166
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 12, neighbor version 12
Index 1, Offset 0, Mask 0x2
Condition-map lo12, Advertise-map lo3, status: Advertise
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 1 0
Prefixes Total: 3 0
Implicit Withdraw: 0 0
Explicit Withdraw: 2 0
Used as bestpath: n/a 0
Used as multipath: n/a 0
Outbound Inbound
Local Policy Denied Prefixes: -------- -------
advertise-map: 1 n/a
Suppressed due to dampening: 2 n/a
Total: 3 0
Number of NLRIs in the update sent: max 1, min 0
Minimum time between advertisement runs is 20 seconds

R2#sh ip bgp nei 10.1.12.1
BGP neighbor is 10.1.12.1, remote AS 1, external link
BGP version 4, remote router ID 1.1.1.1
BGP state = Established, up for 02:33:45
Last read 00:00:45, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 3 3
Notifications: 0 0
Updates: 0 11
Keepalives: 165 164
Route Refresh: 0 3
Total: 168 181
Default minimum time between advertisement runs is 30 seconds

2. neighbor {ip-address | peer-group-name} default-originate
The router owning the default route can advertise it through BGP using the **default-originate** form of the **neighbor** command. Using this form is not recommended, because the router always advertises the default route, even if the router does not have a default route or if the network to the default route is down..
有默认路由的路由器可以通过neighbor 命令default-originate 通告. 用这样的形式不被推荐,因为路由器总是通告默认路由,甚至路由器没有默认路由或到默认路由的网络断掉的情况下. 即neighbor {ip-address | peer-group-name} default-originate 始终向邻居通告默认路由.

neighbor {ip-address | peer-group-name} default-originate route-map route-map-name
The router owning the default route can advertise it through BGP using the **default-originate route-map** form of the** neighbor **command. Using this form is recommended, because the router advertises the default route only if the condition of the specified route map is satisfied. The condition that is typically used is whether or not the default network is up.
有默认路由的路由器可以通过neighbor 命令default-originate route-map通告. 用这样的形式被推荐,因为仅仅只在指定的route map 满足条件的时候,路由器才通告默认路由。条件即看默认网络是否up 。

例: nei 10.1.12.2 default-originate route-map lo0
route-map lo0
Match ip add pre 1
ip pre 1 per 1.1.1.1/32
1.1.1.1/32 路由存在的情况,则向邻居10.1.12.2 通告默认路由,否则不通告.

3. neighbor {ip-address | peer-group-name} filter-list as-path-list-number weight weight
  as-path-list-number— IP AS path list number.
weight— 1 to 65535. This value is applied to the weight attribute of incoming routes matching the conditions in the AS path filter list.     值1-65535,对匹配AS PATH过滤列表进来的路由设置 weight 属性.

Purpose:
Routes learned from BGP neighbors have the weight attribute set to 0. This form of the filter-list command allows you to set the weight attribute of selected routes received from a particular neighbor. This command applies only to incoming route updates. The operation of the filter list is identical for both IBGP and EBGP neighbors. 从BGP邻居学来的路由weight 属性默认设置为0。filter-list允许设置weight属性给从邻居接收来的路由. 仅仅应用于进来的路由更新. 命令操作对IBGP和EBGP邻居适用.
 
Cisco IOS Software Release: the weight keyword was removed in Release 12.1.
Weight 关键字已经在Release 12.1被移除.