BGP基础实验

拓扑图:

需求

1.如图连接网络,合理规格IP地址,AS200内IGP协议 为OSPF

2.R1属于AS 100 ; R2-R3-R4小AS 234   R5-R6-R7小AS  567,同时声明大AS 200,R8属于AS300

3.R2-R5   R4-R7之间为联邦EBGP邻居关系

4.R1-R8之间通信

需求分析

1 合理规划ip地址

2 配置IP 地址启用ospf协议

3 根据要求启用BGP协议

实验过程

1 配置各设备的IP地址

r1

[r1-bgp]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.1.1.1/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         1.1.1.1/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

r2

[r2-bgp]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.1.1.2/24          up         up        
GigabitEthernet0/0/1              23.1.1.1/24          up         up        
GigabitEthernet0/0/2              25.1.1.1/24          up         up        
LoopBack0                         2.2.2.2/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

r3

[r3-bgp]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              23.1.1.2/24          up         up        
GigabitEthernet0/0/1              34.1.1.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         3.3.3.3/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

r4

[r4-bgp]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              34.1.1.2/24          up         up        
GigabitEthernet0/0/1              47.1.1.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)    

r5

[r5-bgp]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              25.1.1.2/24          up         up        
GigabitEthernet0/0/1              56.1.1.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         5.5.5.5/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[r5-bgp]

r6

[r6-bgp]di ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              56.1.1.2/24          up         up        
GigabitEthernet0/0/1              67.1.1.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         6.6.6.6/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

r7

[r7]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              47.1.1.2/24          up         up        
GigabitEthernet0/0/1              67.1.1.2/24          up         up        
GigabitEthernet0/0/2              78.1.1.1/24          up         up        
LoopBack0                         7.7.7.7/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

r8

[r8-bgp]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              78.1.1.2/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         8.8.8.8/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

2 启用ospf协议并且宣告

[r2]ospf 100 r	
[r2]ospf 100 router-id 91.1.1.1
[r2-ospf-100]net	
[r2-ospf-100]ar	
[r2-ospf-100]area 0
[r2-ospf-100-area-0.0.0.0]network 12.1.1.2 0.0.0.0
[r2-ospf-100-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[r2-ospf-100-area-0.0.0.0]network 25.1.1.1 0.0.0.0
[r2-ospf-100-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r3]ospf 100 r	
[r3]ospf 100 router-id 92.2.2.2
[r3-ospf-100]ar	
[r3-ospf-100]area 0
[r3-ospf-100-area-0.0.0.0]net	
[r3-ospf-100-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-100-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[r4]ospf 100 r	
[r4]ospf 100 router-id 94.4.4.4
[r4-ospf-100]ar	
[r4-ospf-100]area 0
[r4-ospf-100-area-0.0.0.0]network 34.1.1.2 0.0.0.0
[r4-ospf-100-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-100-area-0.0.0.0]network 47.1.1.1 0.0.0.0
[r5]ospf 100 r	
[r5]ospf 100 router-id 95.5.5.5
[r5-ospf-100]area 0
[r5-ospf-100-area-0.0.0.0]net	
[r5-ospf-100-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-100-area-0.0.0.0]network 56.1.1.1 0.0.0.0
[r6]ospf 100 router-id 96.6.6.6
[r6-ospf-100]ar	
[r6-ospf-100]area 0
[r6-ospf-100-area-0.0.0.0]net	
[r6-ospf-100-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r6-ospf-100-area-0.0.0.0]network 56.1.1.2 0.0.0.0
[r6-ospf-100-area-0.0.0.0]network 67.1.1.1 0.0.0.0
[r7]ospf 100 r	
[r7]ospf 100 router-id 97.7.7.7
[r7-ospf-100]ar	
[r7-ospf-100]area 0
[r7-ospf-100-area-0.0.0.0]net	
[r7-ospf-100-area-0.0.0.0]network 67.1.1.2 0.0.0.0
[r7-ospf-100-area-0.0.0.0]network 47.1.1.2 0.0.0.0
[r7-ospf-100-area-0.0.0.0]network 78.1.1.1 0.0.0.0
[r7-ospf-100-area-0.0.0.0]network 7.7.7.7 0.0.0.0

3 启用BGP协议并且进行声明 R2-R5 R4-R7之间为联邦EBGP邻居关系还要在r3 r6上建立路由反射器

[r1]bgp 100
[r1-bgp]ro	
[r1-bgp]router-id 1.1.1.1	
[r1-bgp]peer 12.1.1.2 as	
[r1-bgp]peer 12.1.1.2 as-number 200
[r2]bgp 234
[r2-bgp]router-id 2.2.2.2
[r2-bgp]con	
[r2-bgp]confederation id 200
[r2-bgp]confederation peer	
[r2-bgp]confederation peer-as 567
[r2-bgp]peer 12.1.1.1 as-number 100
[r2-bgp]peer 3.3.3.3 as	
[r2-bgp]peer 3.3.3.3 as-number 234	
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0 
[r2-bgp]peer 5.5.5.5 as-number 567	
[r2-bgp]peer 5.5.5.5 connect-interface l	
[r2-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[r2-bgp]peer eb	
[r2-bgp]peer 5.5.5.5 eb	
[r2-bgp]peer 5.5.5.5 ebgp-max-hop 
[r3]bgp 234
[r3-bgp]r
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer	
[r3-bgp]peer 2.2.2.2 as	
[r3-bgp]peer 2.2.2.2 as-number 234
[r3-bgp]peer 2.2.2.2 connect-interface lo	
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 c	
[r3-bgp]peer 4.4.4.4 connect-interface lo	
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r4]bgp 234
[r4-bgp]ro	
[r4-bgp]route-select
[r4-bgp]router-id 4.4.4.4
[r4-bgp]con	
[r4-bgp]confederation id 200	
[r4-bgp]confederation peer-as 567
[r4-bgp]peer 3.3.3.3 as	
[r4-bgp]peer 3.3.3.3 as-number 234
[r4-bgp]peer 3.3.3.3 co	
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r4-bgp]peer 7.7.7.7 as	
[r4-bgp]peer 7.7.7.7 as-number 567
[r4-bgp]peer 7.7.7.7 con	
[r4-bgp]peer 7.7.7.7 connect-interface l	
[r4-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[r4-bgp]peer 7.7.7.7 eb	
[r4-bgp]peer 7.7.7.7 ebgp-max-hop
[r5-ospf-100]q
[r5]bgp 567
[r5-bgp]con
[r5-bgp]confederation id 200
[r5-bgp]confederation peer 	
[r5-bgp]confederation peer-as 234
[r5-bgp]peer 2.2.2.2 as	
[r5-bgp]peer 2.2.2.2 as-number
[r5-bgp]peer 2.2.2.2 as-number 234	
[r5-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r5-bgp]peer 2.2.2.2 eb	
[r5-bgp]peer 2.2.2.2 ebgp-max-hop 
[r5-bgp]peer 6.6.6.6 as-number 567
[r5-bgp]peer 6.6.6.6 connect-interface l	
[r5-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[r6]bgp 567
[r6-bgp]ro	
[r6-bgp]route-select
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 200
[r6-bgp]peer 5.5.5.5 as	
[r6-bgp]peer 5.5.5.5 as-number 567
[r6-bgp]peer 5.5.5.5 con	
[r6-bgp]peer 5.5.5.5 connect-interface l	
[r6-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[r6-bgp]peer 7.7.7.7 as	
[r6-bgp]peer 7.7.7.7 as-number 567
[r6-bgp]peer 7.7.7.7 connect-interface l	
[r6-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[r7]bgp 567
[r7-bgp]ro	
[r7-bgp]route-select
[r7-bgp]router-id 7.7.7.7
[r7-bgp]con	
[r7-bgp]confederation id 200
[r7-bgp]con	
[r7-bgp]confederation peer 	
[r7-bgp]confederation peer-as 234
[r7-bgp]peer 6.6.6.6 as	
[r7-bgp]peer 6.6.6.6 as-number 567	
[r7-bgp]peer 6.6.6.6 connect-interface LoopBack 0	
[r7-bgp]peer 4.4.4.4 as	
[r7-bgp]peer 4.4.4.4 as-number 234	
[r7-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r7-bgp]peer 78.1.1.2 as	
[r7-bgp]peer 78.1.1.2 as-number
[r7-bgp]peer 78.1.1.2 as-number 300
[r7-bgp]peer 4.4.4.4 eb	
[r7-bgp]peer 4.4.4.4 ebgp-max-hop 
[r8]bgp 300
[r8-bgp]ro	
[r8-bgp]route-select
[r8-bgp]router-id 8.8.8.8
[r8-bgp]peer 78.1.1.1 as	
[r8-bgp]peer 78.1.1.1 as-number 567

在r3 r6上建立路由反射器

[r3-bgp]peer 2.2.2.2 reflect-client
[r3-bgp]peer 4.4.4.4 reflect-client




[r6-bgp]peer 5.5.5.5 reflect-client
[r6-bgp]peer 7.7.7.7 reflect-client

将ospf协议发布到BGP中

[r2-bgp]import-route ospf 100
[r7-bgp]import-route ospf 100

4 全网可达

[r1-bgp]ping 7.7.7.7
  PING 7.7.7.7: 56  data bytes, press CTRL_C to break
    Reply from 7.7.7.7: bytes=56 Sequence=1 ttl=252 time=70 ms
    Reply from 7.7.7.7: bytes=56 Sequence=2 ttl=252 time=40 ms
    Reply from 7.7.7.7: bytes=56 Sequence=3 ttl=252 time=50 ms
    Reply from 7.7.7.7: bytes=56 Sequence=4 ttl=252 time=50 ms
    Reply from 7.7.7.7: bytes=56 Sequence=5 ttl=252 time=50 ms

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值