IBGP 与EBGP会话
一、 实验目的
配置IBGP以及 EBGP 为使ibgp与对等体之间能正确的交换路由信息配置next-hop-self aggregtae-addres 命令!
二、 实验拓扑结构图
三、 实验步骤
1.
配置基本接口地址(略)
2.
配置isp1 内部的bgp
配置内部的路由协议
isp 1A (config-if)#router ospf 1
isp 1A (config-router)#net 10.0.0 .0 0.255.255.255 area 0
isp 1A (config-router)#net 172.16.0.0 0.0.255.255 area 0
isp1B(config)#router ospf 1
isp1B(config-router)#net 10.0.0 .0 0.255.255.255 area 0
isp1B(config-router)#net 172.16.0.0 0.0.255.255 area 0
配置ibgp协议
isp1B(config-if)#router bgp 200
isp1B(config-router)#neigh 10.1.1 .1 remote-as 200
isp1B(config-router)#neigh 10.1.1 .1 update-source lo 0
isp1B(config-router)#no synchronization
isp1B(config-router)#no auto-summary
isp 1A (config)#router bgp 200
isp 1A (config-router)#neigh 10.2.2 .2 remote-as 200
isp 1A (config-router)#neigh 10.2.2 .2 update-source lo 0
isp 1A (config-router)#no synchronization
isp 1A (config-router)#no auto-summary
3.
配置ebgp
isp 1A (config)#router bgp 200
isp 1A (config-router)#nei 192.168.1.5 remote-as 100
isp 1A (config-router)#net 172.16.1.0 mask 255.255.255.0
sanjsoe1(config-if)#router bgp 100
sanjsoe1(config-router)#neigh 192.168.1.6 remote-as 200
sanjsoe1(config-router)#net 192.168.1.32 ma 255.255.255.224
sanjsoe1#show ip route
172.16.0.0/24 is subnetted, 1 subnets
B 172.16.1.0 [20/0] via 192.168.1.6, 00:10:19
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.32/27 is directly connected, FastEthernet1/0
C 192.168.1.4/30 is directly connected, Serial0/0
sanjsoe1#ping 172.16.1.1 通
sanjsoe1#ping 172.16.1.2 不通 为什么有路由却不可到达??
isp1B#show ip route
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet1/0
10.0.0 .0/32 is subnetted, 2 subnets
C 10.2.2 .2 is directly connected, Loopback0
O 10.1.1 .1 [110/2] via 172.16.1.1, 00:30:06, FastEthernet1/0
没有到带192.168.1.0 网络的路由 icmp 不能回去
isp1B#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
r>i172.16.1.0/24 10.1.1 .1 0 100 0 i
* i192.168.1.32/27 192.168.1.5 0 100 0 100 i
bgp 学习到了192.168.1.32网络的路由 下一跳却不可到达
4.
配置next-hop-self
isp 1A (config)#router bgp 200
isp 1A (config-router)#neigh 10.2.2 .2 next-hop-self
参看配置结果
isp1B#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i192.168.1.32/27 10.1.1 .1 0 100 0 100 i
isp1B#show ip route
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet1/0
10.0.0 .0/32 is subnetted, 2 subnets
C 10.2.2 .2 is directly connected, Loopback0
O 10.1.1 .1 [110/2] via 172.16.1.1, 00:34:40, FastEthernet1/0
192.168.1.0/27 is subnetted, 1 subnets
B 192.168.1.32 [200/0] vi a 10.1.1 .1, 00:00:16
sanjsoe1#ping 172.16.1.2 还是不通! 为什么有路由条目还是不同
原因:sanjose1 采用最近接口的ip即原地址是192.168.1.5 没有到达这个网络的路由
验证假设: sanjsoe1#ping 172.16.1.2 source 192.168.1.33 通
sanjsoe1#ping 172.16.1.2 source 192.168.1.5不通 假设成立
5.
手工汇总路由条目解决上述问题
sanjsoe1(config)#router bgp 100
sanjsoe1(config-router)#aggregate-address 192.168.0.0 255.255.254.0
isp1B#show ip route
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet1/0
10.0.0 .0/32 is subnetted, 2 subnets
C 10.2.2 .2 is directly connected, Loopback0
O 10.1.1 .1 [110/2] via 172.16.1.1, 00:43:12, FastEthernet1/0
192.168.1.0/27 is subnetted, 1 subnets
B 192.168.1.32 [200/0] vi a 10.1.1 .1, 00:08:48
B 192.168.0.0/23 [200/0] vi a 10.1.1 .1, 00:00:26 路由条目改变
sanjsoe1#ping 172.16.1.2通