实验拓扑
基本配置:R1
L0:1.1.1.1/32L1:11.1.1.1/32E1/0:10.1.12.1/24E1/1:10.1.14.1/24
R2L0:2.2.2.2/32L1:22.2.2.2/32E1/0:10.1.12.2/24E1/1:10.1.24.2/24
R4L0:4.4.4.4/32L1:44.4.4.4/32E1/0:10.1.24.4/24E1/1:10.1.14.4/24
配置IGP(RIP):
R1router ripversion 2network 1.0.0.0network 10.0.0.0no auto-summaryR2router ripversion 2network 2.0.0.0network 10.0.0.0no auto-summaryR4router ripversion 2network 4.0.0.0network 10.0.0.0no auto-summary
配置BGP:router bgp 1bgp router-id 1.1.1.1bgp log-neighbor-changesnetwork 1.1.1.1 mask 255.255.255.255network 2.2.2.2 mask 255.255.255.255 backdoornetwork 4.4.4.4 mask 255.255.255.255 backdoornetwork 11.1.1.1 mask 255.255.255.255neighbor 2.2.2.2 remote-as 23neighbor 2.2.2.2 ebgp-multihop 2neighbor 2.2.2.2 update-source Loopback0neighbor 4.4免费云主机域名.4.4 remote-as 23neighbor 4.4.4.4 ebgp-multihop 2neighbor 4.4.4.4 update-source Loopback0R2router bgp 23bgp router-id 2.2.2.2bgp log-neighbor-changesnetwork 1.1.1.1 mask 255.255.255.255 backdoornetwork 2.2.2.2 mask 255.255.255.255network 22.2.2.2 mask 255.255.255.255neighbor 1.1.1.1 remote-as 1neighbor 1.1.1.1 ebgp-multihop 2neighbor 1.1.1.1 update-source Loopback0neighbor 4.4.4.4 remote-as 23neighbor 4.4.4.4 update-source Loopback0R4
router bgp 23bgp router-id 4.4.4.4bgp log-neighbor-changesnetwork 1.1.1.1 mask 255.255.255.255 backdoornetwork 4.4.4.4 mask 255.255.255.255network 44.4.4.4 mask 255.255.255.255neighbor 1.1.1.1 remote-as 1neighbor 1.1.1.1 ebgp-multihop 2neighbor 1.1.1.1 update-source Loopback0neighbor 2.2.2.2 remote-as 23neighbor 2.2.2.2 update-source Loopback0
查看R1路由表:origin 为i,表示从IGP 学来的路由。R1#sh ip bgpBGP table version is 5, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed,Origin codes: i – IGP, e – EGP, ? – incompleteRPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Pathr 2.2.2.2/32 4.4.4.4 0 23 ir> 2.2.2.2 0 0 23 ir 4.4.4.4/32 4.4.4.4 0 0 23 ir> 2.2.2.2 0 23 i* 22.2.2.2/32 4.4.4.4 0 23 i*> 2.2.2.2 0 0 23 i* 44.4.4.4/32 4.4.4.4 0 0 23 i*> 2.2.2.2 0 23 i
查看22.2.2.2 44.4.4.4的路由表:R1#sh ip bgp 22.2.2.2BGP routing table entry for 22.2.2.2/32, version 4Paths: (2 available, best #2, table default) Advertised to update-groups: 18 Refresh Epoch 1 23 4.4.4.4 (metric 1) from 4.4.4.4 (4.4.4.4) Origin IGP, localpref 100, valid, external rx pathid: 0, tx pathid: 0 Refresh Epoch 1 23 2.2.2.2 (metric 1) from 2.2.2.2 (2.2.2.2) Origin IGP, metric 0, localpref 100, valid, external, best rx pathid: 0, tx pathid: 0x0R1#sh ip bgp 44.4.4.4BGP routing table entry for 44.4.4.4/32, version 5Paths: (2 available, best #2, table default) Advertised to update-groups: 18 Refresh Epoch 1 23 4.4.4.4 (metric 1) from 4.4.4.4 (4.4.4.4) Origin IGP, metric 0, localpref 100, valid, external rx pathid: 0, tx pathid: 0 Refresh Epoch 1 23 2.2.2.2 (metric 1) from 2.2.2.2 (2.2.2.2) Origin IGP, localpref 100, valid, external, best rx pathid: 0, tx pathid: 0x0
origin皆为IGP。修改 bgp origin-clde 属性,使R1到R2的22.2.2.2 永久的从R4走,到R4的44.4.4.4永久的从R2走。在R1上配置:第一步:配置prefix-listip prefix-list 22 seq 5 permit 22.2.2.2/32ip prefix-list 44 seq 5 permit 44.4.4.4/32
第二步:配置route-maproute-map ori-r2 permit 10match ip address prefix-list 22set origin incompleteroute-map ori-r2 permit 20
route-map ori-r4 permit 10match ip address prefix-list 44set origin incompleteroute-map ori-r4 permit 20
第三步:在BGP中,对相应的邻居in方向调用route-map。neighbor 2.2.2.2 route-map ori-r2 inneighbor 4.4.4.4 route-map ori-r4 in
第四步:重置BGP邻居,重新学习路由clea ip bgp *
查看R1 BGP路由表:R1#sh ip bgpBGP table version is 16, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed,Origin codes: i – IGP, e – EGP, ? – incompleteRPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path*> 1.1.1.1/32 0.0.0.0 0 32768 ir 2.2.2.2/32 4.4.4.4 0 23 ir> 2.2.2.2 0 0 23 ir 4.4.4.4/32 4.4.4.4 0 0 23 ir> 2.2.2.2 0 23 i*> 11.1.1.1/32 0.0.0.0 0 32768 i*> 22.2.2.2/32 4.4.4.4 0 23 i* 2.2.2.2 0 0 23 ?* 44.4.4.4/32 4.4.4.4 0 0 23 ?*> 2.2.2.2 0 23 i
此是,BGP表显示从R2学来的22.2.2.2路由,origin-code属性已改为?(incomplete),从R4学来的44.4.4.4路由,属性也改为?(incomplete),优先选择origin-clde为i的路由。
IGP(i)优于EGP(e)优于incomplete(?)的路由。
R1#sh ip bgp 22.2.2.2BGP routing table entry for 22.2.2.2/32, version 16Paths: (2 available, best #1, table default) Advertised to update-groups: 18 Refresh Epoch 1 23 4.4.4.4 (metric 1) from 4.4.4.4 (4.4.4.4) Origin IGP, localpref 100, valid, external, best rx pathid: 0, tx pathid: 0x0 Refresh Epoch 1 23 2.2.2.2 (metric 1) from 2.2.2.2 (2.2.2.2) Origin incomplete, metric 0, localpref 100, valid, external rx pathid: 0, tx pathid: 0R1#sh ip bgp 44.4.4.4BGP routing table entry for 44.4.4.4/32, version 15Paths: (2 available, best #2, table default) Advertised to update-groups: 18 Refresh Epoch 1 23 4.4.4.4 (metric 1) from 4.4.4.4 (4.4.4.4) Origin incomplete, metric 0, localpref 100, valid, external rx pathid: 0, tx pathid: 0 Refresh Epoch 1 23 2.2.2.2 (metric 1) from 2.2.2.2 (2.2.2.2) Origin IGP, localpref 100, valid, external, best rx pathid: 0, tx pathid: 0x0实验完成。
修改文件 /etc/udev/rules.d/70-persistent-net.rules,修改ma免费云主机域名c地址对应网卡的名字。相关推荐: 配电终端加密装置功能及现场应用调试方案ISU-208N配电终端加密模块现场应用调试方案现场调试手册V2.0本文…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。