BGP对等体组、聚合、路由反射器、联盟、团体属性

一.实验拓扑


二.实验需求

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

    As3中存在两个环回,一个地址为192.168.2.0/24,、该地址不能在任何协议中宣告,最终要求这两个环回可以ping通;

2.整个AS2的IP地址为172.16.0.0/16,请合理划分;并且其内部配置osPF协议

3.R1-R8的建邻环回用x.x.x.x/32表示;R2-R7上除了建邻环回,每个设备再划分一个业务网段;

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

5、使用BGP协议让整个网络所有设备的环回可以互相访问;

三、实验思路

1.划IP配IP

2..配OSPF使AS2通

3.配BGP

5.近BGP宣告网段   

6.做隧道,使全网通



四、实验步骤

1.划IP

172.16.0.0 /16

1)R1-R8的环回

R1 ---172.16.0.1  /32

........

2)R2--R7的业务网段

R2-----172.16.2.0  /24

........

3)6个骨干链路

172.16.1.0 /24

172.16.1.0000 0000 /30 ==172.16.1.0  

172.16.1.0000 0100  /30 ==172.16.1.4

172.16.1.0000 1000  /30==172.16.1.8

172.16.1.0000 1100  /30==172.16.1.12

172.16.1.0001 0000  /30==172.16.1.16

172.16.1.0001 0100  /30==172.16.1.20

2.配ip

[R1]INT G0/0/0
[R1-GigabitEthernet0/0/0]IP ADD 12.1.1.1 24
[R1-GigabitEthernet0/0/0]
Aug  4 2024 09:55:02-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]q
[R1]int l0
[R1-LoopBack0]ip add 172.16.0.1 32
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 192.168.1.0 24
Error: The specified IP address is invalid.
[R1-LoopBack1]ip add 192.168.1.1 24
[R1-LoopBack1]q
[R1]

[R2]INT G0/0/1
[R2-GigabitEthernet0/0/1]172.16.1.1 30
                         ^
Error: Unrecognized command found at '^' position.
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 30
[R2-GigabitEthernet0/0/1]
Aug  4 2024 09:55:42-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 172.16.1.21 30
Aug  4 2024 09:56:04-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R2-GigabitEthernet0/0/2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
Aug  4 2024 09:56:23-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip add 172.16.0.2 32
[R2-LoopBack0]ip add 172.16.0.2 32
Error: The address already exists.
[R2-LoopBack0]int l1
[R2-LoopBack1]ip add 172.16.2.0 24
Error: The specified IP address is invalid.
[R2-LoopBack1]ip add 172.16.2.1 24
[R2-LoopBack1]ip add 172.16.2.1 24
Error: The address already exists.
[R2-LoopBack1]q
[R2]

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 30
[R3-GigabitEthernet0/0/0]
Aug  4 2024 10:02:16-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 g0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.1.5 30
Aug  4 2024 10:02:47-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R3-GigabitEthernet0/0/1]int l0
[R3-LoopBack0]ip add 172.16.0.3 32
[R3-LoopBack0]int l1
[R3-LoopBack1]ip add 172.16.3.1 24
[R3-LoopBack1]q
[R3]

[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.6 30
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 172.16.1.9 30
[R4-GigabitEthernet0/0/1]int l0
[R4-LoopBack0]ip add 172.16.0.4 32
[R4-LoopBack0]int l1
[R4-LoopBack1]ip add 172.16.4.1 24
[R4-LoopBack1]q
[R4]

[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.22 30
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.17 30
Aug  4 2024 10:09:21-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R5-GigabitEthernet0/0/0]ip add 172.16.1.17 30
Error: The address already exists.
[R5-GigabitEthernet0/0/0]int l0
[R5-LoopBack0]ip add 172.16.0.5 32
[R5-LoopBack0]int l1
[R5-LoopBack1]ip add 172.16.5.0 24
Error: The specified IP address is invalid.
[R5-LoopBack1]ip add 172.16.5.1 24
[R5-LoopBack1]ip add 172.16.5.1 24
Error: The address already exists.
[R5-LoopBack1]q
[R5]

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.1.13 30
[R6-GigabitEthernet0/0/0]
Aug  4 2024 10:13:40-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 g0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.16.1.18 30
Aug  4 2024 10:14:00-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 l0
[R6-LoopBack0]ip add 172.16.0.6 32
[R6-LoopBack0]int l1
[R6-LoopBack1]ip add 172.16.6.1 24
[R6-LoopBack1]q
[R6]

[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 172.16.1.14 30
[R7-GigabitEthernet0/0/0]
Aug  4 2024 10:15:23-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]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.1.10 30
Aug  4 2024 10:15:46-08:00 R7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R7-GigabitEthernet0/0/1]int g0/0/2
[R7-GigabitEthernet0/0/2]ip add 34.1.1.1 24
Aug  4 2024 10:16:36-08:00 R7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R7-GigabitEthernet0/0/2]int l0
[R7-LoopBack0]ip add 172.16.0.7 32
[R7-LoopBack0]int l1
[R7-LoopBack1]ip add 172.16.7.0 24
Error: The specified IP address is invalid.
[R7-LoopBack1]ip add 172.16.7.1 24
[R7-LoopBack1]ip add 172.16.7.1 24
Error: The address already exists.
[R7-LoopBack1]q
[R7]

[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 34.1.1.2 24
Aug  4 2024 10:18:05-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]q
[R8]int l0
[R8-LoopBack0]ip add 172.16.0.8 32
[R8-LoopBack0]int l1
[R8-LoopBack1]ip add 192.168.2.1 24
[R8-LoopBack1]q
[R8]

3.配OSPF使AS2通

[R2]ospf 1 r    
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]

[R3]os    
[R3]ospf 1 r    
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R3-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R3-ospf-1-area-0.0.0.0]

[R4]os    
[R4]ospf 1 r    
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R4-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R4-ospf-1-area-0.0.0.0]

[R5]osp    
[R5]ospf 1 r    
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R5-ospf-1-area-0.0.0.0]

[R6]os    
[R6]ospf 1 r    
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R6-ospf-1-area-0.0.0.0]

[R7]os    
[R7]ospf 1 r    
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.255.255
[R7-ospf-1-area-0.0.0.0]

4.配BGP

1)BGP联盟

[R1]bgp 1
[R1-bgp]pe    
[R1-bgp]peer 12.1.1.2 as 2
[R1-bgp]

[R2-bgp]pe    
[R2-bgp]peer 172.16.0.3 as 64512
[R2-bgp]peer 172.16.0.3 conn    
[R2-bgp]peer 172.16.0.3 connect-interface l0
[R2-bgp]peer 172.16.0.3 ne    
[R2-bgp]peer 172.16.0.3 next-hop-invariable
[R2-bgp]peer 172.16.0.3 next-hop-local
[R2-bgp]p    
[R2-bgp]peer 172.16.0.4 as 64512
[R2-bgp]peer 172.16.0.4 con    
[R2-bgp]peer 172.16.0.4 connect-interface l0
[R2-bgp]
[R2-bgp]
[R2-bgp]
[R2-bgp]pe    
[R2-bgp]peer 172.16.0.5 as 64513
[R2-bgp]peer 172.16.0.5 con    
[R2-bgp]peer 172.16.0.5 connect-interface l0
[R2-bgp]peer 172.16.0.5 ne    
[R2-bgp]peer 172.16.0.5 next-hop-invariable

[R2-bgp]peer 172.16.0.5 next-hop-local
[R2-bgp]p    
[R2-bgp]peer 172.16.0.5 eb    

[R2-bgp]peer 172.16.0.5 ebgp-max-hop (修改最大跳数255(默认的是255))
[R2-bgp]

[R3]bgp 64512
[R3-bgp]con    
[R3-bgp]confederation id 2
[R3-bgp]pe    
[R3-bgp]peer 172.16.0.2 as 64512
[R3-bgp]peer 172.16.0.2 con    
[R3-bgp]peer 172.16.0.2 connect-interface l0
[R3-bgp]p    
[R3-bgp]peer 172.16.0.4 as 64512
[R3-bgp]peer 172.16.0.4 connect-interface l0
[R3-bgp]

[R4]bg    
[R4]bgp 64512
[R4-bgp]con    
[R4-bgp]confederation i    
[R4-bgp]confederation id 2
[R4-bgp]p    
[R4-bgp]peer 172.16.0.3 as 64512
[R4-bgp]peer 172.16.0.3 co    
[R4-bgp]peer 172.16.0.3 connect-interface l0
[R4-bgp]p    
[R4-bgp]peer 172.16.0.2 as 64512
[R4-bgp]peer 172.16.0.2 con    
[R4-bgp]peer 172.16.0.2 connect-interface l0
[R4-bgp]

(如果R4不和R2键邻,可以在R3上做反射器(反射群里的所有反射客户端需与反射器建立IBGP邻居关系)解决路由学不全的问题

[R5]bg    
[R5]bgp 64513
[R5-bgp]con    
[R5-bgp]confederation p    
[R5-bgp]confederation i    
[R5-bgp]confederation id 2
[R5-bgp]confederation p    
[R5-bgp]confederation peer-as 64512
[R5-bgp]p    
[R5-bgp]peer 172.16.0.6 as 64513
[R5-bgp]peer 172.16.0.6 con    
[R5-bgp]peer 172.16.0.6 connect-interface l0
[R5-bgp]peer 172.16.0.6 ne    
[R5-bgp]peer 172.16.0.6 next-hop-invariable
[R5-bgp]peer 172.16.0.6 next-hop-local
[R5-bgp]pe    

[R5-bgp]peer 172.16.0.7 as 64513
[R5-bgp]peer 172.16.0.7 con    
[R5-bgp]peer 172.16.0.7 connect-interface l0
[R5-bgp]q
[R5-bgp]
[R5-bgp]peer 172.16.0.2 as 64512
[R5-bgp]peer 172.16.0.2 conn    
[R5-bgp]peer 172.16.0.2 connect-interface l0
[R5-bgp]peer 172.16.0.2 next-hop-local
[R5-bgp]peer 172.16.0.2 eb    
[R5-bgp]peer 172.16.0.2 ebgp-max-hop 
[R5-bgp]

[R6]bgp 64513
[R6-bgp]con    
[R6-bgp]confederation 
[R6-bgp]confederation i    
[R6-bgp]confederation id 2
[R6-bgp]pe    
[R6-bgp]peer 172.16.0.5 as 64513
[R6-bgp]peer 172.16.0.5 con    
[R6-bgp]peer 172.16.0.5 connect-interface l0
[R6-bgp]pe    
[R6-bgp]peer 172.16.0.7 as 64513
[R6-bgp]peer 172.16.0.7 connect-interface l0

[R6-bgp]peer 172.16.0.7 next-hop-local
[R6-bgp]
[R6-bgp]p   
[R6-bgp]q
[R6]

[R7]bgp 64513
[R7-bgp]con    
[R7-bgp]confederation i    
[R7-bgp]confederation id 2
[R7-bgp]pe    
[R7-bgp]peer 172.16.0.5 as 64513
[R7-bgp]peer 172.16.0.5 con    
[R7-bgp]peer 172.16.0.5 connect-interface l0
[R7-bgp]
[R7-bgp]peer 172.16.0.6 as 64513
[R7-bgp]peer 172.16.0.6 connect-interface l0
[R7-bgp]peer 172.16.0.6 ne    
[R7-bgp]peer 172.16.0.6 next-hop-invariable
[R7-bgp]peer 172.16.0.6 next-hop-local
[R7-bgp]pe    
[R7-bgp]peer 34
[R7-bgp]peer 34.1.1.2 as 3
[R7-bgp]
[R7-bgp]

(如果R5不和R7键邻,可以在R3上做反射器(反射群里的所有反射客户端需与反射器建立IBGP邻居关系)解决路由学不全的问题

[R8]bg    
[R8]bgp 3
[R8-bgp]p    
[R8-bgp]peer 34.1.1.1 as 2
[R8-bgp]

检查

5.近BGP宣告网段

[R2]bgp 64512
[R2-bgp]ne    
[R2-bgp]network 172.16.2.0 24
[R2-bgp]

[R3]bg    
[R3]bgp 64512
[R3-bgp]ne    
[R3-bgp]network 172.16.3.0 24
[R3-bgp]


[R4]bgp 64512
[R4-bgp]n    
[R4-bgp]network 172.16.4.0 24
[R4-bgp]

[R5]bg    
[R5]bgp 64513
[R5-bgp]n    
[R5-bgp]network 172.16.5.0 24
[R5-bgp]

[R6]bg    
[R6]bgp 64513
[R6-bgp]n    
[R6-bgp]network 172.16.6.0 24
[R6-bgp]

[R7]bg    
[R7]bgp 64513
[R7-bgp]n    
[R7-bgp]network 172.16.7.0 24
[R7-bgp]q
[R7]

6.做隧道,使全网通

[R1]bg    
[R1]bgp 1
[R1-bgp]n    
[R1-bgp]network 172.16.0.1 32
[R1-bgp]
[R1-bgp]q

[R8]bg    
[R8]bgp 3
[R8-bgp]n    
[R8-bgp]network 172.16.0.8 32
[R8-bgp]


[R1]int t0/0/0
[R1-Tunnel0/0/0]ip add 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]des    
[R1-Tunnel0/0/0]description
[R1-Tunnel0/0/0]destination 172.16.0.8

[R8]int t0/0/0
[R8-Tunnel0/0/0]ip add 10.1.1.8 24
[R8-Tunnel0/0/0]TUN    
[R8-Tunnel0/0/0]tunnel-protocol G    
[R8-Tunnel0/0/0]tunnel-protocol gre 
[R8-Tunnel0/0/0]s    
[R8-Tunnel0/0/0]so    
[R8-Tunnel0/0/0]source 172.16.0.8
[R8-Tunnel0/0/0]des    
[R8-Tunnel0/0/0]description
[R8-Tunnel0/0/0]destination 172.16.0.1

[R1]ip route-static 192.168.2.0 24 10.1.1.8

[R8]ip route-static 192.168.1.0 24 10.1.1.1
[R8]

测试

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值