47、BGP配置实验之MED选路
2015-12-11 16:22
423 查看
1、as-path选路解析
修改MED值的方法:
2、实验拓扑
3、基础配置R1配置
interface Loopback0 ip address 1.1.1.1 255.255.255.0interface Serial0/0 ip address 13.1.1.1 255.255.255.0interface Serial0/1 ip address 14.1.1.1 255.255.255.0router ospf 110 router-id 1.1.1.1 log-adjacency-changes network 1.1.1.0 0.0.0.255 area 0 network 14.1.1.0 0.0.0.255 area 0router bgp 4 no synchronization bgp router-id 1.1.1.1 neighbor 4.4.4.4 remote-as 4 neighbor 4.4.4.4 update-source Loopback0 neighbor 4.4.4.4 next-hop-self neighbor 13.1.1.3 remote-as 3 no auto-summary
R2配置interface Loopback0 ip address 2.2.2.2 255.255.255.0interface Serial0/1 ip address 23.1.1.2 255.255.255.0interface FastEthernet1/0 ip address 24.1.1.2 255.255.255.0router ospf 110 router-id 2.2.2.2 network 2.2.2.0 0.0.0.255 area 0 network 24.1.1.0 0.0.0.255 area 0router bgp 4 no synchronization bgp router-id 2.2.2.2 neighbor 4.4.4.4 remote-as 4 neighbor 4.4.4.4 update-source Loopback0 neighbor 4.4.4.4 next-hop-self neighbor 23.1.1.3 remote-as 3 no auto-summary
R3配置interface Loopback0 ip address 3.3.3.3 255.255.255.0interface Loopback1 ip address 33.33.33.33 255.255.255.0 interface Serial0/0 ip address 13.1.1.3 255.255.255.0interface Serial0/1 ip address 23.1.1.3 255.255.255.0router bgp 3 no synchronization bgp router-id 3.3.3.3 network 3.3.3.0 mask 255.255.255.0 network 33.33.33.0 mask 255.255.255.0 neighbor 13.1.1.1 remote-as 4 neighbor 23.1.1.2 remote-as 4 no auto-summary
R4配置interface Loopback0 ip address 4.4.4.4 255.255.255.0interface Serial0/1 ip address 14.1.1.4 255.255.255.0interface FastEthernet1/0 ip address 24.1.1.4 255.255.255.0router ospf 110 router-id 4.4.4.4 network 4.4.4.0 0.0.0.255 area 0 network 14.1.1.0 0.0.0.255 area 0 network 24.1.1.0 0.0.0.255 area 0router bgp 4 no synchronization bgp router-id 4.4.4.4 network 4.4.4.0 mask 255.255.255.0 neighbor 1.1.1.1 remote-as 4 neighbor 1.1.1.1 update-source Loopback0 neighbor 2.2.2.2 remote-as 4 neighbor 2.2.2.2 update-source Loopback0 no auto-summary
4、默认选路
根据BGP选路原则第十条可以知道,R3到达4.4.4.0/24默认经过R1。
5、修改MED值让R3访问4.4.4.0/24的时候从R2经过
R1配置
ip prefix-list 1 seq 5 permit 4.4.4.0/24
route-map MED permit 10
match ip address prefix-list 1
set metric 10
route-map MED permit 20
router bgp 4
neighbor 13.1.1.3 route-map MED out
本文出自 “开源殿堂” 博客,请务必保留此出处http://kaiyuandiantang.blog.51cto.com/10699754/1722088
属性 | 传播范围 | 默认值 | 优先值 | 方向 | 备注 |
weight | 本路由器 | 本路由器32768,其他路由器0 | 大值优先 | IN | CISCO私有 |
Local preference | AS内部 | 100:边界路由器,通告给IBGP邻居,告知如何离开本AS | 大值优先 | OUT | |
As path | AS之间 | 无 | 短优先 | IN、OUT | |
MED | AS内部 | 0:通告给EBGP,告知如何进入本AS | 小优先 | OUT |
2、实验拓扑
3、基础配置R1配置
interface Loopback0 ip address 1.1.1.1 255.255.255.0interface Serial0/0 ip address 13.1.1.1 255.255.255.0interface Serial0/1 ip address 14.1.1.1 255.255.255.0router ospf 110 router-id 1.1.1.1 log-adjacency-changes network 1.1.1.0 0.0.0.255 area 0 network 14.1.1.0 0.0.0.255 area 0router bgp 4 no synchronization bgp router-id 1.1.1.1 neighbor 4.4.4.4 remote-as 4 neighbor 4.4.4.4 update-source Loopback0 neighbor 4.4.4.4 next-hop-self neighbor 13.1.1.3 remote-as 3 no auto-summary
R2配置interface Loopback0 ip address 2.2.2.2 255.255.255.0interface Serial0/1 ip address 23.1.1.2 255.255.255.0interface FastEthernet1/0 ip address 24.1.1.2 255.255.255.0router ospf 110 router-id 2.2.2.2 network 2.2.2.0 0.0.0.255 area 0 network 24.1.1.0 0.0.0.255 area 0router bgp 4 no synchronization bgp router-id 2.2.2.2 neighbor 4.4.4.4 remote-as 4 neighbor 4.4.4.4 update-source Loopback0 neighbor 4.4.4.4 next-hop-self neighbor 23.1.1.3 remote-as 3 no auto-summary
R3配置interface Loopback0 ip address 3.3.3.3 255.255.255.0interface Loopback1 ip address 33.33.33.33 255.255.255.0 interface Serial0/0 ip address 13.1.1.3 255.255.255.0interface Serial0/1 ip address 23.1.1.3 255.255.255.0router bgp 3 no synchronization bgp router-id 3.3.3.3 network 3.3.3.0 mask 255.255.255.0 network 33.33.33.0 mask 255.255.255.0 neighbor 13.1.1.1 remote-as 4 neighbor 23.1.1.2 remote-as 4 no auto-summary
R4配置interface Loopback0 ip address 4.4.4.4 255.255.255.0interface Serial0/1 ip address 14.1.1.4 255.255.255.0interface FastEthernet1/0 ip address 24.1.1.4 255.255.255.0router ospf 110 router-id 4.4.4.4 network 4.4.4.0 0.0.0.255 area 0 network 14.1.1.0 0.0.0.255 area 0 network 24.1.1.0 0.0.0.255 area 0router bgp 4 no synchronization bgp router-id 4.4.4.4 network 4.4.4.0 mask 255.255.255.0 neighbor 1.1.1.1 remote-as 4 neighbor 1.1.1.1 update-source Loopback0 neighbor 2.2.2.2 remote-as 4 neighbor 2.2.2.2 update-source Loopback0 no auto-summary
4、默认选路
根据BGP选路原则第十条可以知道,R3到达4.4.4.0/24默认经过R1。
5、修改MED值让R3访问4.4.4.0/24的时候从R2经过
R1配置
ip prefix-list 1 seq 5 permit 4.4.4.0/24
route-map MED permit 10
match ip address prefix-list 1
set metric 10
route-map MED permit 20
router bgp 4
neighbor 13.1.1.3 route-map MED out
本文出自 “开源殿堂” 博客,请务必保留此出处http://kaiyuandiantang.blog.51cto.com/10699754/1722088
相关文章推荐
- GGV跟了两年多的亮风台,怎么用工程师情怀做AR?
- 常见字符串时间处理
- Android SharedPreferences存储数据的使用方法
- myeclipse配置tomcat
- python全局可变变量的坑
- Android中播放视频时保持屏幕不变黑
- 【SSH项目实战】国税协同平台-31.我要投诉功能1
- Android开发简单使用surfaceview
- UISlider
- LeetCode - 6. ZigZag Conversion
- AOP 那点事儿(续集)
- 结构体 + typedef
- js原生设计模式——12装饰者模式
- 在Linux中卸载Refind
- 老李分享:java线程生命周期 2
- 关于dubbo的一点记录
- 老李分享:java线程生命周期 1
- android 6.0 权限的坑
- fragment之基本使用
- 前端预加载器提升网页加载速度