BGP基础配置实验

 配置

R1

R2

 

R3

R4

 

R5

建立直连邻居关系

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

 

 

[r2]bgp 2
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 12.0.0.1 as-number 1

 

[r4]bgp 2
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 45.0.0.2 as-number 3

[r5]bgp 3
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 45.0.0.1 as-number 2

 

 建立 BGP对等体关系

ospf

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]a 0
[r2-ospf-1-area-0.0.0.0]network 23.0.0.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 23.0.0.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 34.0.0.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 34.0.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

bgp

[r2]bgp 2
[r2-bgp]peer 3.3.3.3 as-number 2	
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r2-bgp]peer 4.4.4.4 as-number 2
[r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r3]bgp 2
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 2.2.2.2 as-number 2
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 as-number 2
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r4-bgp]bgp 2
[r4-bgp]peer 2.2.2.2 as-number 2
[r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r4-bgp]peer 3.3.3.3 as-number 2	
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0

 

保证两个网段可以相互通信

 

[r1]ping -a 1.1.1.1 5.5.5.5
  PING 5.5.5.5: 56  data bytes, press CTRL_C to break
    Reply from 5.5.5.5: bytes=56 Sequence=1 ttl=252 time=80 ms
    Reply from 5.5.5.5: bytes=56 Sequence=2 ttl=252 time=50 ms
    Reply from 5.5.5.5: bytes=56 Sequence=3 ttl=252 time=30 ms
    Reply from 5.5.5.5: bytes=56 Sequence=4 ttl=252 time=40 ms
    Reply from 5.5.5.5: bytes=56 Sequence=5 ttl=252 time=40 ms
 
  --- 5.5.5.5 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/48/80 ms
-------------------------------------------------------------------------------------
[r5]ping -a 5.5.5.5 1.1.1.1
  PING 1.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=40 ms
    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=50 ms
    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=252 time=40 ms
    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=252 time=40 ms
 
  --- 1.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/40/50 ms

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值