BGP实验1

文章详细描述了在路由器R1-R5上配置IP地址,使用OSPF协议连接内网,以及通过EBGP和IBGP建立邻居关系。重点展示了如何通过BGP通告业务网段并引入到IGP以解决路由黑洞问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,配置IP地址

[R1]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.1/24         up         up            
LoopBack0                         192.168.1.1/24       up         up(s)     

[R2]dis ip int brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.2/24         up         up        
GigabitEthernet0/0/1              100.2.2.2/24         up         up          
LoopBack0                         2.2.2.2/32           up         up(s)     

[R3]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.2.2.3/24         up         up        
GigabitEthernet0/0/1              100.3.3.3/24         up         up             
LoopBack0                         3.3.3.3/32           up         up(s)     

[R4]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.3.3.4/24         up         up        
GigabitEthernet0/0/1              100.4.4.4/24         up         up            
LoopBack0                         4.4.4.4/32           up         up(s)     

[R5]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.4.4.5/24         up         up              
LoopBack0                         192.168.2.5/24       up         up(s)     

2,内网通过OSPF协议搞通

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]net	
[R2-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 100.3.3.0 0.0.0.255

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]network 100.3.3.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

3,R1,R2,R4,R5运行BGP,R1和R2建立EBGP邻居;

   R4和R5建立EBGP邻居,R2和R4建立IBGP邻居;

   要求EBGP邻居使用直连接口建立邻居,IBGP邻居使用环回口     建立邻居;

[R1]bgp 100
[R1-bgp]peer 100.1.1.2 as-number 200

[R2]bgp 200
[R2-bgp]peer 100.1.1.1 as-number 100
[R2]bgp 200	
[R2-bgp]peer 4.4.4.4 as-number 200
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R2-bgp]peer 4.4.4.4 next-hop-local 

[R4]bgp 200
[R4-bgp]peer 2.2.2.2 as-number 200	
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R4-bgp]peer 2.2.2.2 next-hop-local 
[R4]bgp 200
[R4-bgp]peer 100.4.4.5 as-number 300


[R5]bgp 300
[R5-bgp]peer 100.4.4.4 as-number 200

4,R1和R5把业务网段置告进BGP。

[R1]bgp 100
[R1-bgp]network 192.168.1.0 24

[R5]bgp 300
[R5-bgp]network 192.168.2.0 24

5,在R2和R4上把BGP引入到IGP解决BGP路由黑洞问题。

[R2-ospf-1]import-route bgp 

[R4-ospf-1]import-route bgp

—— 在R1上必须通过-a操作指定哪一个地址ping,因为其他地址没有倍宣告进bgp

协议

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值