程序员人生 网站导航

CCNP实验:BGP路由在MA网络下一跳属性(Next-Hop)特例

栏目:服务器时间:2014-06-06 16:16:29

【实验环境】

C3640-IK9O3S-M Version 12.4(10)

【实验目的】

验证BGP路由协议在MA网络中下一跳属性(Next-Hop)自动更改特例

【实验拓扑】

【实验描述】

BGP关系如图,R1、R2、R3处在同一以太网中(134.0.0.0/24段),R2与R3为EBGP关系,R1与R2为IBGP关系,R1与R4使用串行链路建立EBGP关系

实验观察R3从R2收到的EBGP条目的下一跳属性并分析原因

【实验步骤】

1、R1基本配置,端口,EIGRP,与R2的IBGP,与R4的EBGP:

!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 134.0.0.1 255.255.255.0
!
interface Serial1/0
ip address 14.0.0.1 255.255.255.0
clock rate 64000
!
router eigrp 1
network 1.1.1.1 0.0.0.0
network 134.0.0.0 0.0.0.255
no auto-summary
!
router bgp 1
no synchronization
bgp router-id 1.1.1.1
neighbor 2.2.2.2 remote-as 1
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 14.0.0.2 remote-as 4
no auto-summary
!

2、R2基本配置,端口,EIGRP,与R1的IBGP,与R3的EBGP:

!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 134.0.0.2 255.255.255.0
!
router eigrp 1
network 2.2.2.2 0.0.0.0
network 134.0.0.0 0.0.0.255
no auto-summary
!
router bgp 1
no synchronization
bgp router-id 2.2.2.2
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 134.0.0.3 remote-as 3
no auto-summary
!

3、R3基本配置,端口,与R2的EBGP:

!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 134.0.0.3 255.255.255.0
!
router bgp 3
no synchronization
bgp router-id 3.3.3.3
network 3.3.3.0 mask 255.255.255.0
neighbor 134.0.0.2 remote-as 1
no auto-summary
!

4、R4基本配置,端口,与R1的EBGP:

!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial1/0
ip address 14.0.0.2 255.255.255.0
!
router bgp 4
no synchronization
bgp router-id 4.4.4.4
network 4.4.4.0 mask 255.255.255.0
neighbor 14.0.0.1 remote-as 1
no auto-summary
!

5、在R3上验证与R4的连通性

R3#ping 4.4.4.4 so 3.3.3.3
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/83/116 ms

6、在R3上查看BGP路由表

R3#sh ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.0/24       0.0.0.0                  0         32768 i
*> 4.4.4.0/24       134.0.0.1                              0 1 4 i

注意到4.4.4.0/24这一条路由是从R2上学来的,Next Hop属性本应该为134.0.0.2的,现在却变成了134.0.0.1

7、在R2上使用debug分析BGP路由更新

//开启BGP更新调试
R2#debug ip bgp updates
BGP updates debugging is on for address family: IPv4 Unicast

//由于BGP为触发更新,因此需要软清除一下BGP路由表
R2#clear ip bgp * soft

*Mar  1 00:44:21.315: BGP(0): 1.1.1.1 send UPDATE (format) 3.3.3.0/24, next 2.2.2.2, metric 0, path 3
*Mar  1 00:44:21.319: BGP(0): 134.0.0.3 NEXT_HOP part 3 net 4.4.4.0/24, next 134.0.0.1
*Mar  1 00:44:21.319: BGP(0): 134.0.0.3 send UPDATE (format) 4.4.4.0/24, next 134.0.0.1, metric 0, path 4

从debug信息可以看到,R2在向R3发送的BGP路由更新中,下一跳属性就已经是134.0.0.1了,再看R2的路由表:

R2#sh ip ro
1.0.0.0/32 is subnetted, 1 subnets
D       1.1.1.1 [90/156160] via 134.0.0.1, 00:37:02, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
B       3.3.3.0 [20/0] via 134.0.0.3, 00:18:57
4.0.0.0/24 is subnetted, 1 subnets
B       4.4.4.0 [200/0] via 1.1.1.1, 00:20:18
134.0.0.0/24 is subnetted, 1 subnets
C       134.0.0.0 is directly connected, FastEthernet0/0

这里就是BGP在MA网络中的下一跳特例了,4.4.4.0/24网段的路由是通过1.1.1.1进行转发的,而经过路由表的递归查询,1.1.1.1又是经过134.0.0.1进行转发的,而F0/0接口又与134.0.0.1在同一MA网络,因此BGP就将下一跳属性直接优化为路由更新源的地址了。

总结:如果收到BGP路由的下一跳与发出接口在同一MA网络,将发出路由下一跳直接改为源下一跳。

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐