【无标题】

实验拓扑

1.配置IP地址

[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.22 30
May 11 2024 15:31:15-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R5-GigabitEthernet0/0/0]
[R5-GigabitEthernet0/0/0]
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.17 30
May 11 2024 15:31:35-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R5-GigabitEthernet0/0/1]int L0
[R5-LoopBack0]ip add 172.16.0.5 32
[R5-LoopBack0]int l1
[R5-LoopBack1]ip add 172.16.5.5 24

2.使用ospf实现内网通

由于分配IP地址的特殊性在骨干区域内可以使用ospf广泛宣告的特征宣告172.16.0.0 0.0.255.255

所有骨干区域路由器都使用这条命令

ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 172.16.0.0 0.0.255.255 

3.根据区域划分建立BGP邻居

R1:

 peer 12.1.1.2 as-number 2

R2:

bgp 64512
 confederation id 2
 confederation peer-as 64513
 peer 172.16.0.3 as-number 64512 
 peer 172.16.0.3 connect-interface LoopBack0
 peer 172.16.0.5 as-number 64513 
 peer 172.16.0.5 ebgp-max-hop 255 
 peer 172.16.0.5 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.0.3 enable
  peer 172.16.0.5 enable
  peer 172.16.0.5 next-hop-local 

R3:

bgp 64512
 peer 172.16.0.2 as-number 64512 
 peer 172.16.0.2 connect-interface LoopBack0
 peer 172.16.0.4 as-number 64512 
 peer 172.16.0.4 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.0.2 enable
  peer 172.16.0.4 enable

R4:

#
bgp 64512
 peer 172.16.0.3 as-number 64512 
 peer 172.16.0.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.0.3 enable
#

R5:

bgp 64513
 confederation id 2
 confederation peer-as 64512
 peer 172.16.0.2 as-number 64512 
 peer 172.16.0.2 ebgp-max-hop 255 
 peer 172.16.0.2 connect-interface LoopBack0
 peer 172.16.0.6 as-number 64513 
 peer 172.16.0.6 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.0.2 enable
  peer 172.16.0.2 next-hop-local 
  peer 172.16.0.6 enable
#

R6:

bgp 64513
 peer 172.16.0.5 as-number 64513 
 peer 172.16.0.5 connect-interface LoopBack0
 peer 172.16.0.7 as-number 64513 
 peer 172.16.0.7 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.0.5 enable
  peer 172.16.0.7 enable

R7:

#
bgp 64513
 peer 34.1.1.8 as-number 3 
 peer 172.16.0.6 as-number 64513 
 peer 172.16.0.6 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 34.1.1.8 enable
  peer 172.16.0.6 enable

R8:

bgp 3
 peer 34.1.1.7 as-number 64513 
 #
 ipv4-family unicast
  undo synchronization
  peer 34.1.1.7 enable

将AR3作为反射器(RR),AR4作为客户端
[r3]peer 172.16.0.4 reflect-client

[r3]peer 172.16.0.2 reflect-client

将AR6作为反射器(RR),AR7作为客户端
[r6】peer 172.16.0.7 reflect-client

[r6]peer 172.16.0.5 reflect-client

以172.16.0.2作为例子实验发现可以传输

4.宣告空接口
[R2]ip rou    
[R2]ip route
[R2]ip route-static 172.16.0.0 nu    
[R2]ip route-static 172.16.0.0 NU    
[R2]ip route-static 172.16.0.0 16 NULL 0
[R2]bgp 64512
[R2-bgp]ne    
[R2-bgp]network 172.16.0.0 16
[R2-bgp]a    
[R2-bgp]aggregate 172.16.0.0 16 de    
[R2-bgp]aggregate 172.16.0.0 16 detail-suppressed 


Enter system view, return user view with Ctrl+Z.
[R7]bgp 64513
[R7-bgp]ne    
[R7-bgp]network 172.16.0.0 16
[R7-bgp]ag    
[R7-bgp]aggregate 172.16.0.0 16 de    
[R7-bgp]aggregate 172.16.0.0 16 detail-suppressed 
[R7-bgp]q
[R7]ip rou    
[R7]ip route
[R7]ip route-static 172.16.0.0 16 NU    
[R7]ip route-static 172.16.0.0 16 NULL 0
[R7]

[R2]ip route-static 0.0.0.0 0 12.1.1.1
[R2]
[R7]ip rou    
[R7]ip route
[R7]ip route-static 0.0.0.0 0 34.1.1.2
[R7]

5.建隧道

[R1]int t    
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip ad    
[R1-Tunnel0/0/0]ip address 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre 
[R1-Tunnel0/0/0]so    
[R1-Tunnel0/0/0]source 172.16.0.1
[R1-Tunnel0/0/0]de    
[R1-Tunnel0/0/0]description 172.16.0.8
[R1-Tunnel0/0/0]


[R8]int t    
[R8]int Tunnel 0/0/0
[R8-Tunnel0/0/0]ip ad    
[R8-Tunnel0/0/0]ip address 10.1.1.1 24
[R8-Tunnel0/0/0]tu    
[R8-Tunnel0/0/0]tunnel-protocol ge    
[R8-Tunnel0/0/0]tunnel-protocol gr    
[R8-Tunnel0/0/0]tunnel-protocol gre 
[R8-Tunnel0/0/0]

6.检测

[R2]ping -a 172.16.0.2 172.16.0.4
  PING 172.16.0.4: 56  data bytes, press CTRL_C to break
    Reply from 172.16.0.4: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 172.16.0.4: bytes=56 Sequence=2 ttl=254 time=20 ms
    Reply from 172.16.0.4: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 172.16.0.4: bytes=56 Sequence=4 ttl=254 time=40 ms
    Reply from 172.16.0.4: bytes=56 Sequence=5 ttl=254 time=20 ms

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

[R2]ping -a 172.16.0.2 172.16.0.6
  PING 172.16.0.6: 56  data bytes, press CTRL_C to break
    Reply from 172.16.0.6: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 172.16.0.6: bytes=56 Sequence=2 ttl=254 time=20 ms
    Reply from 172.16.0.6: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 172.16.0.6: bytes=56 Sequence=4 ttl=254 time=20 ms
    Reply from 172.16.0.6: bytes=56 Sequence=5 ttl=254 time=20 ms

  --- 172.16.0.6 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/24/30 ms

[R2]ping -a 172.16.0.2 172.16.0.7
  PING 172.16.0.7: 56  data bytes, press CTRL_C to break
    Reply from 172.16.0.7: bytes=56 Sequence=1 ttl=253 time=50 ms
    Reply from 172.16.0.7: bytes=56 Sequence=2 ttl=253 time=30 ms
    Reply from 172.16.0.7: bytes=56 Sequence=3 ttl=253 time=50 ms
    Reply from 172.16.0.7: bytes=56 Sequence=4 ttl=253 time=40 ms
    Reply from 172.16.0.7: bytes=56 Sequence=5 ttl=253 time=30 ms
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值