实验目的:
1、BGP路由汇总
2、BGP默认路由
3、通过修改更新源来实现链路冗余
4、修改EBGP的多跳
实验拓扑如下
配置:
R1:
interface Loopback0
ip address 1.1.1.1 255.255.255.0
interface Loopback1
ip address 1.1.2.2 255.255.255.0
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
router bgp 100
no synchronization
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
network 1.1.2.0 mask 255.255.255.0
aggregate-address 1.1.0.0 255.255.252.0 summary-only 【BGP路由汇总】
redistribute static 【静态路由重分发到BGP】
neighbor 12.1.1.2 remote-as 200 启动BGP
default-information originate 【默认路由,类似ospf】
no auto-summary
ip route 0.0.0.0 0.0.0.0 Serial1/0 如果没有这条默认路由其他路由器就没有办法ping通1.1.1.1
R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface FastEthernet0/0
ip address 23.1.1.1 255.255.255.0
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
interface FastEthernet2/0
ip address 32.1.1.2 255.255.255.0
router eigrp 1
network 2.0.0.0
network 23.0.0.0
network 32.0.0.0
no auto-summary
!
router bgp 200
no synchronization
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 update-source Loopback0 【修改更新源 实现路径冗余】
neighbor 3.3.3.3 next-hop-self 解决下一跳不可达问题,告诉邻居我将作为下一跳,这样之后R3和R4就可以ping 通1.1.1.1了
neighbor 12.1.1.1 remote-as 100
no auto-summary
R3:
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface FastEthernet0/0
ip address 23.1.1.2 255.255.255.0
interface Serial1/0
ip address 34.1.1.1 255.255.255.0
interface FastEthernet2/0
ip address 32.1.1.1 255.255.255.0
router eigrp 1
network 3.0.0.0
network 23.0.0.0
network 32.0.0.0
no auto-summary
router bgp 200
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 update-source Loopback0 【修改更新源 实现路径冗余】
neighbor 2.2.2.2 next-hop-self
neighbor 4.4.4.4 remote-as 300
neighbor 4.4.4.4 ebgp-multihop 3 修改多跳【默认ebgp的TTL等于1】
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
ip route 4.4.4.0 255.255.255.0 Serial1/0 为了使用更新源4.4.4.4 和3.3.3.3能建立TCP连接
R4:
interface Loopback0
ip address 4.4.4.4 255.255.255.0
interface Loopback1
ip address 5.5.5.5 255.255.255.0
interface Serial1/0
ip address 34.1.1.2 255.255.255.0
router bgp 300
no synchronization
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
network 5.5.5.0 mask 255.255.255.0
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 ebgp-multihop 3 修改多跳
neighbor 3.3.3.3 update-source Loopback0
no auto-summary
ip route 0.0.0.0 0.0.0.0 Serial1/0 为了使得数据包有来有去。
ip route 3.3.3.0 255.255.255.0 Serial1/0 为了使用更新源4.4.4.4 和3.3.3.3能建立TCP连接
R2#show ip bgp
BGP table version is 7, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 12.1.1.1 0 0 100 ?
*> 1.1.0.0/22 12.1.1.1 0 100 i
*>i4.4.4.0/24 3.3.3.3 0 100 0 300 i
*>i5.5.5.0/24 3.3.3.3 0 100 0 300 i
R2#show ip route bgp
1.0.0.0/22 is subnetted, 1 subnets
B 1.1.0.0 [20/0] via 12.1.1.1, 00:18:24
4.0.0.0/24 is subnetted, 1 subnets
B 4.4.4.0 [200/0] via 3.3.3.3, 00:10:57
5.0.0.0/24 is subnetted, 1 subnets
B 5.5.5.0 [200/0] via 3.3.3.3, 00:10:57
B* 0.0.0.0/0 [20/0] via 12.1.1.1, 00:16:02 //默认路由
在R1上ping 5.5.5.5是可以通的(由于有重分发了默认路由的作用,否则是不通)
在R3上ping 5.5.5.5和1.1.1.1 是可以通的
在R4上ping 1.1.1.1 source 5.5.5.5是可以通的
在R2上ping 5.5.5.5是可以通的
疑问:为何使用默认路由不可以建立邻居
如上所示:如果我没有配置静态路由,而在R3上面添加一条默认路由指向s1/0。