CCIE-认证指南之外部网关协议BGP同步学习知识23
实验 23语 法: Default-metric metric
作用:指定重新分配路由的一 个 度量或是 med 值 。大于 为 1-4294967295. 第一 种 方法,
当 把路由重新分配到 bgp 时 ,不指定度量,那 么 重新分配的度量 为 0 。第二 种 , 当 重新分
配度量 时 ,指定一 个值 。第三 种 ,使用 default-metric 命令指定度量或 med 值 。
例如:
Redistribute ospf 1 给 ospf 一 个 度量 为 0 的 值
Redistribute ospf 1 metric 5 给 ospf 一 个 度量 为 5 的 值
Redistribute ospf 1 metric 5
Redistribute static
Default-metric 10 给 ospf 一 个 度量 为 5 的 值 而 静态 路由 给 一 个 10 的度量 值
设备 需求: Cisco2501 路由器三台
配置 实 例:
[img=502,289]http://www.56cto.com/uploads/userup/0808/03115Q2J51.jpg[/img]
ra#conf t
ra(config)#int lo0
ra(config-if)#ip add 144.223.1.1 255.255.255.255
ra(config-if)#int s0
ra(config-if)#int e0
ra(config-if)#ip add 172.17.1.2 255.255.255.0
ra(config-if)#no sh
ra(config-if)#end
rb#conf t
rb(config)#int e0
rb(config-if)#ip add 172.17.1.1 255.255.255.0
rb(config-if)#no sh
rb(config-if)#end
rb(config)#
rb(config)#int s1
rb(config-if)#ip add 10.1.1.1 255.255.255.252
rb(config-if)#no sh
rb(config-if)#cl ra 64000
rb(config-if)#end
rc#conf t
rc(config)#int s1
rc(config-if)#ip add 10.1.1.2 255.255.255.252
rc(config-if)#no sh
rc(config-if)#end
rc(config)#int lo0
rc(config-if)#ip add 205.40.30.129 255.255.255.192
rc(config-if)#end
ra#conf t
ra(config)#router bgp 1
ra(config-router)#nei 172.17.1.1 remote 2
ra(config-router)#end
先指定一 条静态 路由到 e0
rb#conf t
rb(config)#ip route 144.223.1.1 255.255.255.255 e0
rb(config)#router ospf 1
rb(config-router)#net 10.0.0.0 0.255.255.255 ar 0
rb(config-router)#exit
rb(config)#router bgp 2
rb(config-router)#nei 172.17.1.2 remote 1
rb(config-router)#red stat
rb(config-router)#red ospf 1 met 5
rb(config-router)#no auto
rb(config-router)#end
rc#conf t
rc(config)#router ospf 1
rc(config-router)#net 10.0.0.0 0.255.255.255 ar 0
rc(config-router)#net 205.0.0.0 0.255.255.255 ar 2
rc(config-router)#end
rb#sh ip b
BGP table version is 4, local router ID is 172.17.1.1
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
*> 10.1.1.0/30 0.0.0.0 0 32768 ?
*> 144.223.1.1/32 0.0.0.0 0 32768 ?
*> 205.40.30.129/32 10.1.1.2 5 32768 ?
在 这 里因 为没 有使用 default-metric 这个 命令,所以 给静态 路由指定一 个为 0 的度量。 现
在使用 这 一命令。如果用 redistribute 这 一命令 时 ,而后面 没 有 metric 时 ,使用 default-
metric 这 一命令意思是剩下的所有重分布 给 相同的度量 值 。
rb#conf t
rb(config)#router bgp 2
rb(config-router)#default-metric 10
rb(config-router)#end
rb#
上面的意思是 给静态 路由一 个 度量 为 10 的 值
rb#sh ip b
BGP table version is 4, local router ID is 172.17.1.1
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
*> 10.1.1.0/30 0.0.0.0 0 32768 ?
*> 144.223.1.1/32 0.0.0.0 10 32768 ?
*> 205.40.30.129/32 10.1.1.2 5 32768 ?
现 在度量改成 10 了。 Default-metric 这 一命令指定度量。
页:
[1]
