联邦与反射器实验

在这里插入图片描述

实验要求:

1、AS1存在两个环回,一个IP地址为192.168.1.0/24该地址不能在任何协议中宣告

AS3中存在两个环回,一个IP地址为192.168.2.0/24该地址不能在任何协议中宣告,最终要求这两个环回可以互相通讯

AS1的另一个环回为10.0.0.0/24,AS3的另一个环回为11.0.0.0/24

2、整个AS2的IP地址为172.16.0.0/16,请合理划分

3、AS间的骨干链路IP地址随意定制

4、使用BGP协议让整个网络的环回可以互相访问

5、减少路由条目数量,避免环回出现
分析:1.首先给AS2区域根据172.16.0.0/16网段进行合理划分

2.按照划分的网段对路由器的接口进行IP地址的配置

3.在每个路由器上配置ospf协议

4.对路由器进行BGP边界网关协议的配置

5.路由反射器,在R3与R6上配置路由反射器用来打破IBGP的水平分割

6.整个网络的环回可以互相访问、

7.创建虚拟隧道
(1) 对R1
(2) 对R8
(3)此时便可使R1与R8的另外两个环回互相访问

实验:

给每个接口配置IP

R1

[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack1]ip add 10.0.0.1 24
R2

[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/1]ip add 172.16.0.1 21
[R2-GigabitEthernet0/0/2]ip add 172.16.128.1 18
R3

[R3-GigabitEthernet0/0/0]ip add 172.16.0.2 21
[R3-GigabitEthernet0/0/1]ip add 172.16.8.1 21
[R3-LoopBack0]ip add 172.16.24.1 21
R4

[R4-GigabitEthernet0/0/0]ip add 172.16.8.2 21
[R4-GigabitEthernet0/0/1]ip add 172.16.192.1 18
[R4-LoopBack0]ip add 172.16.32.1 21
R5

[R5-GigabitEthernet0/0/0]ip add 172.16.128.2 18
[R5-GigabitEthernet0/0/1]ip add 172.16.64.1 21
[R5-LoopBack0]ip add 172.16.80.1 21
R6

[R6-GigabitEthernet0/0/0]ip add 172.16.64.2 21
[R6-GigabitEthernet0/0/1]ip add 172.16.72.1 21
[R6-LoopBack0]ip add 172.16.88.1 21
R7

[R7-GigabitEthernet0/0/0]ip add 172.16.72.2 21
[R7-GigabitEthernet0/0/1]ip add 172.16.192.2 21
[R7-GigabitEthernet0/0/2]ip add 78.0.0.1 24
[R7-LoopBack0]ip add 172.16.96.1 21
R8

[R8-GigabitEthernet0/0/0]ip add 78.0.0.2 24
[R8-LoopBack0]ip add 192.168.2.1 24
[R8-LoopBack1]ip add 11.0.0.1 24
然后配置OSPF协议:

R1

[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a 0
[R1-ospf-1-area-0.0.0.0]network 10.0.0.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.0.0.1 0.0.0.0
R2

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1-area-0.0.0.0]network 12.0.0.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 172.16.16.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 172.16.128.1 0.0.0.0
R3

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.24.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.8.1 0.0.0.0
R 4

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]network 172.16.8.2 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 172.16.32.1 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 172.16.192.1 0.0.0.0
R 5

[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]network 172.16.128.2 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 172.16.64.1 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 172.16.80.1 0.0.0.0
R 6

[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]network 172.16.64.2 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 172.16.72.1 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 172.16.88.1 0.0.0.0
R7

[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]network 172.16.72.2 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 172.16.96.1 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 78.0.0.1 0.0.0.0
R8

[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]a 0
[R8-ospf-1-area-0.0.0.0]network 78.0.0.2 0.0.0.0
[R8-ospf-1-area-0.0.0.0]network 11.0.0.1 0.0.0.0
R1与R2之间进行EBGP的建立
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as-number 2
[R1-bgp]
Oct 15 2023 19:06:40-08:00 R1 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 12.0.0.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)

[R2]bgp 64512
[R2-bgp]peer 12.0.0.1 as-number 1
[R2-bgp]
Oct 15 2023 20:00:57-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 12.0.0.1 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)
R7与R8之间进行EBGP的建立
[R7]bgp 2
[R7-bgp]router-id 7.7.7.7
[R7-bgp]peer 78.0.0.2 as-number 3

[R8]bgp 3
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.0.0.1 as-number 2
AS2区域中64512内R/2/3/4之间建立联邦

[R2]bgp 64512
[R2-bgp]confederation id 2
[R2-bgp]peer 172.16.24.1 as-number 64512
[R2-bgp]peer 172.16.24.1 next-hop-local

[R3]bgp 64512
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.16.1 as-number 64512
[R3-bgp]peer 172.16.16.1 next-hop-local
[R3-bgp]peer 172.16.32.1 as-number 64512
[R3-bgp]peer 172.16.32.1 next-hop-local

[R4]bgp 64512
[R4-bgp]confederation id 2
[R4-bgp]peer 172.16.24.1 as-number 64512
[R4-bgp]peer 172.16.24.1 next-hop-loca

AS2区域中64513内的R/5/6/7之间建立联邦

[R5]bgp 64513
[R5-bgp]confederation id 2
[R5-bgp]peer 172.16.88.1 as-number 64513
[R5-bgp]peer 172.16.88.1 next-hop-local

[R6]bgp 64513
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.80.1 as-number 64513
[R6-bgp]peer 172.16.80.1 next-hop-local
[R6-bgp]peer 172.16.96.1 as-number 64513
[R6-bgp]peer 172.16.96.1 next-hop-local

[R7]bgp 64513
[R7-bgp]confederation id 2
[R7-bgp]peer 172.16.88.1 as-number 64513
[R7-bgp]peer 172.16.88.1 next-hop-local

R2与R5之间建立EBGP邻居关系
[R2]bgp 64512
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 172.16.128.2 as-number 64513
[R2-bgp]
Oct 15 2022 19:51:13-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 172.16.128.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public
, StateChangeReason=Up)

[R5]bgp 64513
[R5-bgp]confederation peer-as 64512
[R5-bgp]peer 172.16.128.1 as-number 64512
R4与R7之间建立EBGP邻居关系
R4]bgp 64512
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.192.2 as-number 64513

[R7]bgp 64513
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.192.1 as-number 64512
R2与R5之间,R4与R7之间建立EBGP关系后还需修改TTL值
[R2-bgp]peer 172.16.128.2 ebgp-max-hop
[R5-bgp]peer 172.16.128.1 ebgp-max-hop
[R4-bgp]peer 172.16.192.2 ebgp-max-hop
[R7-bgp]peer 172.16.192.1 ebgp-max-hop
在R3与R6上配置路由反射器用来打破IBGP的水平分割

[R3-bgp]peer 172.16.16.1 reflect-client
[R6-bgp]peer 172.16.80.1 reflect-client
整个网络的环回可以互相访问
ping 172.16.16.1
PING 172.16.16.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.16.1: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 172.16.16.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 172.16.16.1: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 172.16.16.1: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 172.16.16.1: bytes=56 Sequence=5 ttl=255 time=20 ms

— 172.16.16.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/22/40 ms

ping 172.16.24.1
PING 172.16.24.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.24.1: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 172.16.24.1: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 172.16.24.1: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 172.16.24.1: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 172.16.24.1: bytes=56 Sequence=5 ttl=254 time=20 ms

— 172.16.24.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/28/40 ms

ping 172.16.32.1
PING 172.16.32.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.32.1: bytes=56 Sequence=1 ttl=253 time=40 ms
Reply from 172.16.32.1: bytes=56 Sequence=2 ttl=253 time=30 ms
Reply from 172.16.32.1: bytes=56 Sequence=3 ttl=253 time=40 ms
Reply from 172.16.32.1: bytes=56 Sequence=4 ttl=253 time=30 ms
Reply from 172.16.32.1: bytes=56 Sequence=5 ttl=253 time=30 ms

— 172.16.32.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/34/40 ms

ping 172.16.88.1
PING 172.16.88.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.88.1: bytes=56 Sequence=1 ttl=253 time=40 ms
Reply from 172.16.88.1: bytes=56 Sequence=2 ttl=253 time=40 ms
Reply from 172.16.88.1: bytes=56 Sequence=3 ttl=253 time=40 ms
Reply from 172.16.88.1: bytes=56 Sequence=4 ttl=253 time=30 ms
Reply from 172.16.88.1: bytes=56 Sequence=5 ttl=253 time=40 ms

— 172.16.88.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/38/40 ms

ping 172.16.96.1
PING 172.16.96.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.96.1: bytes=56 Sequence=1 ttl=252 time=60 ms
Reply from 172.16.96.1: bytes=56 Sequence=2 ttl=252 time=40 ms
Reply from 172.16.96.1: bytes=56 Sequence=3 ttl=252 time=40 ms
Reply from 172.16.96.1: bytes=56 Sequence=4 ttl=252 time=50 ms
Reply from 172.16.96.1: bytes=56 Sequence=5 ttl=252 time=50 ms

— 172.16.96.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/48/60 ms
创建虚拟隧道
(1)对R1
[r1]int t0/0/1
[r1-Tunnel0/0/1]ip add 192.168.3.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 10.0.0.1
[r1-Tunnel0/0/1]description 11.0.0.1
[r1]ip route-static 192.168.2.0 24 192.168.3.2
(2)对R8

[r8]int t0/0/1
[r8-Tunnel0/0/1]ip add 192.168.3.2 24
[r8-Tunnel0/0/1]tunnel-protocol gre
[r8-Tunnel0/0/1]source 11.0.0.1
[r8-Tunnel0/0/1]description 10.0.0.1
[r8]ip route-static 192.168.1.0 24 192.168.3.1

  • 21
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值