我们先看一下下面的输出,也就是团体属性的列表和描述
ITAA(config-route-map)#set community ?
<1-4294967295> community number
aa:nn community number in aa:nn format
additive Add to the existing community
internet Internet (well-known community)
local-AS Do not send outside local AS (well-known community)
no-advertise Do not advertise to any peer (well-known community)
no-export Do not export to next AS (well-known community)
none No community attribute
<cr>
其中local-as和no-expert的
实验过程中我有些疑问:
先看拓扑:
基本配置不说了,就看团体属性配置这块:
ITAA(config)#access-list 10 per 1.1.1.0 0.0.0.255
ITAA(config)#route-map OUTLIMIT per 10
ITAA(config-route-map)#match ip address 10
ITAA(config-route-map)#set community no-export
ITAA(config-route-map)#route-map OUTLIMIT per 20
ITAA(config-route-map)#exi
ITAA(config)#router bgp 100
ITAA(config-router)#nei 192.168.1.2 route-map OUTLIMIT out
ITAA(config-router)#nei 192.168.1.2 send-community
验证结果:
通过配置路由策略,控制1.1.1.0的网段通告给下一个AS(不包括ISP)。我们来验证一下:
查看OUT路由器上面的BGP表:
OUT#sh ip bgp
BGP table version is 7, local router ID is 3.3.3.3
Network
Next Hop
Metric LocPrf Weight Path
*> 2.2.2.0/24
172.16.1.1
0
0 200 i
*> 3.3.3.0/24
0.0.0.0
0
32768 i
|
可以看到,1.1.1.0的路由条目已经消失了,我们再来查看一下ISP上面的BGP条目:
ISP#sh ip bgp
BGP table version is 4, local router ID is 2.2.2.2
Network
Next Hop
Metric LocPrf Weight Path
*> 1.1.1.0/24
192.168.1.1
0
0 100 i
*> 2.2.2.0/24
0.0.0.0
0
32768 i
*> 3.3.3.0/24
172.16.1.2
0
0 400 i
|
在这个实验中,成功的使用no-export属性控制了1.1.1.0的路由发布到AS400,但我出于好奇更改如下配置想验证local-as属性:
ITAA(config-route-map)#match ip address 10
ITAA(config-route-map)#set community local-AS
|
从IOS上的解释来看,local-as属性的作用是方式数据包发送到外部AS区域,也就是控制符合策略的路由条目只在本AS内传播,
但是,我使用上述命令后,ISP路由器依然存在1.1.1.0的路由,于是,我郁闷了........,还望指点!