4.5 优选更低Origin路由

图片[1]-4.5 优选更低Origin路由-大赛人网
图4-5  BGP优选更低Origin路由网络拓扑

1.R1配置OSPF

[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255

2.R2配置OSPF

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255

3.R1配置IBGP、EBGP

[R1]bgp 12
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 2.2.2.2 as-number 12
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R1-bgp]peer 2.2.2.2 next-hop-local
[R1-bgp]peer 13.1.1.3 as-number 300

4.R2配置IBGP、EBGP

[R2]bgp 12
[R2-bgp]router-id 2.2.2.2 
[R2-bgp]peer 1.1.1.1 as-number 12
[R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[R2-bgp]peer 1.1.1.1 next-hop-local
[R2-bgp]peer 23.1.1.3 as-number 300

5.R3配置EBGP,宣告3.3.3.3/32到BGP

[R3]bgp 300
[R3-bgp]router-id 3.3.3.3
[R3-bgp]peer 13.1.1.1 as-number 12
[R3-bgp]peer 23.1.1.2 as-number 12
[R3-bgp]network 3.3.3.3 32

6.使用策略方法修改Origin值

[R1]ip ip-prefix dsrw.com permit 3.3.3.3 32
[R1]route-policy dsrw permit node 10
[R1-route-policy]if-match ip-prefix dsrw.com
[R1-route-policy]apply origin incomplete 
[R1-route-policy]quit
[R1]route-policy drw permit node 20
[R1-route-policy]quit
[R1]bgp 12
[R1-bgp]peer 13.1.1.3 route-policy dsrw import 

7.R1查看BGP路由信息

[R1]display bgp routing-table 
*>i  3.3.3.3/32         2.2.2.2         0          100        0      300i
 *                       13.1.1.3        0                     0      300?

[R1]display bgp routing-table 3.3.3.3
 BGP local router ID : 1.1.1.1
 Local AS number : 12
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 3.3.3.3/32:
 From: 2.2.2.2 (2.2.2.2)
 Route Duration: 01h07m27s  
 Relay IP Nexthop: 12.1.1.2
 Relay IP Out-Interface: GigabitEthernet0/0/0
 Original nexthop: 2.2.2.2
 Qos information : 0x0
 AS-path 300, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255, IGP cost 1
 Advertised to such 1 peers:
    13.1.1.3
 BGP routing table entry information of 3.3.3.3/32:
 From: 13.1.1.3 (3.3.3.3)
 Route Duration: 00h01m27s  
 Direct Out-interface: GigabitEthernet0/0/2
 Original nexthop: 13.1.1.3
 Qos information : 0x0
 AS-path 300, origin incomplete, MED 0, pref-val 0, valid, external, pre 255, not preferred for Origin
 Not advertised to any peer yet
© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容