46、BGP配置实验之As path选路


1、as-path选路解析修改As path值的方法:方法一:在OUT方向上修改As path值,例如ip prefix-list 1 seq 5 permit 33.33.33.0/24route-map AS permit 10match ip address prefix-list 1set as-path prepend 2 2 2 2 2route-map AS permit 20router bgp 3neighbor 23.1.1.2 route-map AS out方法二:在IN方向上修改As path值,例如
2、实验拓扑3、基础配置R1配置
interface Loopback0ip address 1.1.1.1 255.255.255.0interface Serial0/0ip address 13.1.1.1 255.255.255.0interface Serial0/1ip address 14.1.1.1 255.255.255.0router ospf 110router-id 1.1.1.1log-adjacency-changesnetwork 1.1.1.0 0.0.0.255 area 0network 14.1.1.0 0.0.0.255 area 0router bgp 4no synchronizationbgp router-id 1.1.1.1neighbor 4.4.4.4 remote-as 4neighbor 4.4.4.4 update-source Loopback0neighbor 4.4.4.4 next-hop-selfneighbor 13.1.1.3 remote-as 3no auto-summary
R2配置interface Loopback0ip address 2.2.2.2 255.255.255.0interface Serial0/1ip address 23.1.1.2 255.255.255.0interface FastEthernet1/0ip address 24.1.1.2 255.255.255.0router ospf 110router-id 2.2.2.2network 2.2.2.0 0.0.0.255 area 0network 24.1.1.0 0.0.0.255 area 0router bgp 4no synchronizationbgp router-id 2.2.2.2neighbor 4.4.4.4 remote-as 4neighbor 4.4.4.4 update-source Loopback0neighbor 4.4.4.4 next-hop-selfneighbor 23.1.1.3 remote-as 3no auto-summary
R3配置interface Loopback0ip address 3.3.3.3 255.255.255.0interface Loopback1ip address 33.33.33.33 255.255.255.0 interface Serial0/0ip address 13.1.1.3 255.255.255.0interface Serial0/1ip address 23.1.1.3 255.255.255.0router bgp 3no synchronizationbgp router-id 3.3.3.3network 3.3.3.0 mask 255.255.255.0network 33.33.33.0 mask 255.255.255.0neighbor 13.1.1.1 remote-as 4neighbor 23.1.1.2 remote-as 4no auto-summary
R4配置interface Loopback0ip address 4.4.4.4 255.255.255.0interface Serial0/1ip address 14.1.1.4 255.255.255.0interface FastEthernet1/0ip address 24.1.1.4 255.255.255.0router ospf 110router-id 4.4.4.4network 4.4.4.0 0.0.0.255 area 0network 14.1.1.0 0.0.0.255 area 0network 24.1.1.0 0.0.0.255 area 0router bgp 免费云主机域名4no synchronizationbgp router-id 4.4.4.4neighbor 1.1.1.1 remote-as 4neighbor 1.1.1.1 update-source Loopback0neighbor 2.2.2.2 remote-as 4neighbor 2.2.2.2 update-source Loopback0no auto-summary
4、默认选路根据BGP选路原则第八条可以知道,R4到达3.3.3.0/24、33.33.33.0/24都是经过R2。
5、在OUT方向上修改As path值R4到达3.3.3.0/24、33.33.33.0/24都是经过R2,我们通过修改As path值将R4到达3.3.3.0/24经过R2、达到33.33.33.0/24都是经过R1。R3配置ip prefix-list 1 seq 5 permit 33.33.33.0/24route-map AS permit 10match ip address prefix-list 1set as-path prepend 2 2 2 2 2route-map AS permit 20router bgp 3neighbor 23.1.1.2 route-map AS out

6、在IN方向上修改As path值R4到达3.3.3.0/24、33.33.33.0/24都是经过R2,我们通过修改As path值将R4到达3.3.3.0/24经过R2、达到33.33.33.0/24都是经过R1。R2配置ip prefix-list 1 seq 5 permit 33.33.33.0/24route-map AS permit 10match ip address prefix-list 1set as-path prepend 2 2 2 2 2route-map AS permit 20router bgp 4neighbor 23.1.1.3 route-map AS in

相关推荐: iptables端口映射实例

环境:主机1: IP:192免费云主机域名.168.10.25(能访问外网) IP:192.168.100.1(网关)主机2:IP:192.168.100.23(web服务器)要求:192.168.10.0/24网段IP能访问web服务器,web服务器也能访问…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

Like (0)
Donate 微信扫一扫 微信扫一扫
Previous 01/30 11:05
Next 01/30 11:05