第5章 BGP协议

图片[1]-第5章 BGP协议-大赛人网
图5-1 基本配置网络拓扑

1.AS 234内配置OSPF

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[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 23.1.1.0 0.255.255.255
[R3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.255.255.255

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.255.255.255

2.R2、R3、R4使用环回接口配置IBGP,R3配置路由反射器

[R2]bgp 234
[R2-bgp]peer 3.3.3.3 as-number 234
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R2-bgp]peer 3.3.3.3 next-hop-local

[R3]bgp 234
[R3-bgp]peer 2.2.2.2 as-number 234
[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R3-bgp]peer 4.4.4.4 as-number 234
[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R3-bgp]peer 2.2.2.2 reflect-client
[R3-bgp]peer 4.4.4.4 reflect-client

[R4]bgp 234
[R4-bgp]peer 3.3.3.3 as-number 234
[R4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R4-bgp]peer 3.3.3.3 next-hop-local

3.R1与R2配置EBGP,并宣告环回口路由到bgp

[R1]bgp 100
[R1-bgp]peer 12.1.1.2 as-number 234
[R1-bgp]network 1.1.1.1 32

[R2]bgp 234
[R2-bgp]peer 12.1.1.1 as-number 100

4.R4与R5配置EBGP

[R4]bgp 234
[R4-bgp]peer 45.1.1.5 as-number 500
[R5]bgp 500
[R5-bgp]peer 45.1.1.4 as-number 234
[R5-bgp]network 5.5.5.5 32

5.查看BGP邻居

[R1]display bgp peer 
 BGP local router ID : 1.1.1.1
 Local AS number : 100
 Total number of peers : 1                Peers in established state : 1
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv
  12.1.1.2        4         234        2        3     0 00:00:55 Established 

6.查看BGP路由信息

<R1>display bgp routing-table 
 Total Number of Routes: 2
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>   1.1.1.1/32         0.0.0.0         0                     0      i
 *>   5.5.5.5/32         12.1.1.2                              0      234 500i

7.连通性测试

<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=50 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/42/50 ms
© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容