BGP综合实验

配置基础IP

R1

[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]int l 0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip add 10.0.0.1 24

R2

[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]int lo 0
[R2-LoopBack0]ip add 172.16.2.1 24
[R2-LoopBack0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 29
[R2-GigabitEthernet0/0/1]int g 0/0/2
[R2-GigabitEthernet0/0/2]ip add 172.16.1.9 29

R3

[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 29
[R3-GigabitEthernet0/0/0]
Jul 22 2024 18:13:39-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]int l 0
[R3-LoopBack0]ip add 172.16.3.1 24
[R3-LoopBack0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.1.17 29

R4

[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.18 29
Jul 22 2024 18:54:14-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 172.16.1.25 29
Jul 22 2024 18:54:33-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R4-GigabitEthernet0/0/1]int l 0
[R4-LoopBack0]ip add 172.16.4.1 24

R5

[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.10 29
[R5-GigabitEthernet0/0/0]
Jul 22 2024 18:17:19-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]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.133 29
Jul 22 2024 18:17:41-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 l 0
[R5-LoopBack0]ip add 172.16.5.1 24

R6

[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.1.34 29
Jul 22 2024 18:18:51-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R6-GigabitEthernet0/0/0]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.168.1.41 29
Jul 22 2024 18:19:20-08:00 R6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R6-GigabitEthernet0/0/1]int l 0
[R6-LoopBack0]ip add 172.16.6.1 24

R7

[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 172.16.7.1 24
[R7-GigabitEthernet0/0/0]
Jul 22 2024 18:22:21-08:00 R7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R7-GigabitEthernet0/0/0]undo ip add 172.16.7.1 24
Jul 22 2024 18:22:36-08:00 R7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the DOWN state. 
[R7-GigabitEthernet0/0/0]ip add 172.16.1.42 29
Jul 22 2024 18:22:59-08:00 R7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R7-GigabitEthernet0/0/0]int g 0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.1.26 29
Jul 22 2024 18:23:42-08:00 R7 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R7-GigabitEthernet0/0/1]int g 0/0/2
[R7-GigabitEthernet0/0/2]ip add 78.0.0.1 24
Jul 22 2024 18:24:18-08:00 R7 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R7-GigabitEthernet0/0/2]int l 0
[R7-LoopBack0]ip add 172.16.7.1 24

R8

[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip add 78.0.0.2 24
[R8-GigabitEthernet0/0/0]
Jul 22 2024 18:25:26-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R8-GigabitEthernet0/0/0]int l 0
[R8-LoopBack0]ip add 192.168.2.1 24
[R8-LoopBack0]int l 1
[R8-LoopBack1]ip add 11.0.0.1 24
 

AS2配置OSPF协议

R2

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]netw    
[R2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R3

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]ne    
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R4

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net    
[R4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R5

[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R6

[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R7

[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0 
[R7-ospf-1-area-0.0.0.0]ne    
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

配置BGP对等体
 

R1

[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as 2

R2

[R2]bgp 64512
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation id 2
[R2-bgp]confederation peer-as 64513

[R2-bgp]peer 12.0.0.1 as 1
[R2-bgp]peer 172.16.3.1 as 64512
[R2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 as 64513
[R2-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 ebgp-max-hop 2
[R2-bgp]peer 172.16.3.1 next-hop-local
[R2-bgp]peer 172.16.5.1 next-hop-local

R3

[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.2.1 as 64512
[R3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R3-bgp]peer 172.16.4.1 as 64512

[R3-bgp]peer 172.16.4.1 connect-interface LoopBack 0

R4

[R4]bgp 64512
[R4-bgp]router-id 4.4.4.4
[R4-bgp]confederation id 2
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.3.1 as 64512
[R4-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 as 64513
[R4-bgp]peer 172.16.7.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 ebgp-max-hop 2

R5

[R5]bgp 64513
[R5-bgp]router-id 5.5.5.5
[R5-bgp]confederation id 2
[R5-bgp]confederation peer-as 64512
[R5-bgp]peer 172.16.2.1 as 64512
[R5-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R5-bgp]peer 172.16.2.1 ebgp-max-hop 2
[R5-bgp]peer 172.16.6.1 as 64513
[R5-bgp]peer 172.16.6.1 connect-interface LoopBack 0

R6

[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.5.1 as 64513
[R6-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R6-bgp]peer 172.16.7.1 as 64513
[R6-bgp]peer 172.16.7.1 connect-interface LoopBack 0

R7

[R7]bgp 64513
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.6.1 as 64513
[R7-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 as 64512
[R7-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 ebgp-max-hop 2
[R7-bgp]peer 78.0.0.2 as 3
[R7-bgp]peer 172.16.4.1 next-hop-local
[R7-bgp]peer 172.16.6.1 next-hop-local

R8

[R8]bgp 3
[R8-bgp]router-id 8.8.8.8 
[R8-bgp]peer 78.0.0.1 as 2
 

发布路由

 R1

[R1]bgp 1
[R1-bgp]network 10.0.0.0 24

R8

[R8]bgp 3
[R8-bgp]network 11.0.0.0 24

配置路由反射器

R3

[R3]bgp 64512
[R3-bgp]peer 172.16.2.1 reflect-client

R6

[R6]bgp 64513
[R6-bgp]peer 172.16.7.1 reflect-client

做空接口,汇总,宣告

R2

[R2]ip route-static 172.16.0.0 21 NULL 0
[R2]bgp 64512 
[R2-bgp]network 172.16.0.0 21

R7

[R7]ip route-static 172.16.0.0 22 NULL 0 

建立GRE隧道

R1

[R1]int t0/0/0
[R1-Tunnel0/0/0]ip a 192.168.10.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 10.0.0.1
[R1-Tunnel0/0/0]destination 11.0.0.1
[R1]ip route-static 192.168.1.0 24 99.0.0.2
 

R8

[R8]int t0/0/0
[R8-Tunnel0/0/0]ip a 192.168.10.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre 
[R8-Tunnel0/0/0]source 11.0.0.1
[R8-Tunnel0/0/0]destination 10.0.0.1
[R8]ip route-static 192.168.2.0 24 99.0.0.1
 

  • 24
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值