BGP第二次试验

本文档详细记录了BGP的配置过程,包括AS2内的OSPF协议配置,AS间通过环回接口建立BGP邻居关系,以及AS2内部的BGP邻居配置。此外,还涉及了路由宣告和路由反射器的设置,最后实施了GRE隧道进行VP连接。
摘要由CSDN通过智能技术生成

s在这里插入图片描述
一、如图所示配置IP和环回
在这里插入图片描述
二、AS2配置OSPF协议
[r2-ospf-1-area-0.0.0.0]dis th
[V200R003C00]

area 0.0.0.0
network 172.16.0.0 0.0.15.255
network 172.16.32.0 0.0.15.255
network 172.16.128.0 0.0.15.255

return

[r3-ospf-1-area-0.0.0.0]dis th
[V200R003C00]

area 0.0.0.0
network 172.16.0.0 0.0.15.255
network 172.16.16.0 0.0.15.255
network 172.16.144.0 0.0.15.255

return

[r4-ospf-1-area-0.0.0.0]dis th
[V200R003C00]

area 0.0.0.0
network 172.16.16.0 0.0.15.255
network 172.16.80.0 0.0.15.255
network 172.16.160.0 0.0.15.255

return

[r5-ospf-1-area-0.0.0.0]dis th
[V200R003C00]

area 0.0.0.0
network 172.16.32.0 0.0.15.255
network 172.16.48.0 0.0.15.255
network 172.16.176.0 0.0.15.255

return

[r6-ospf-1-area-0.0.0.0]dis th
[V200R003C00]

area 0.0.0.0
network 172.16.48.0 0.0.15.255
network 172.16.64.0 0.0.15.255
network 172.16.192.0 0.0.15.255

return

[r7-ospf-1-area-0.0.0.0]dis th
[V200R003C00]

area 0.0.0.0
network 172.16.64.0 0.0.15.255
network 172.16.80.0 0.0.15.255
network 172.16.208.0 0.0.15.255

return

三、建立BGP
1、AS1与AS2直连建立邻居
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 2

[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]peer 12.1.1.1 as-number 1

2、AS2与AS3之间用环回建邻
[r7]bgp 64513
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2
[r7-bgp]peer 23.1.1.2 as-number 3

[r8]bgp 3
[r8-bgp]router-id 8.8.8.8
[r8-bgp]peer 23.1.1.1 as-number 2

3、AS2之间建邻
[r2]bgp 64512
[r2-bgp]confederation peer-as 64513
[r2-bgp]peer 172.16.144.1 as-number 64512
[r2-bgp]peer 172.16.144.1 connect-interface LoopBack 0
[r2-bgp]peer 172.16.176.1 as-number 64513
[r2-bgp]peer 172.16.176.1 ebgp-max-hop 255
[r2-bgp]peer 172.16.176.1 connect-interface LoopBack 0
[r2-bgp]peer 172.16.144.1 next-hop-local
[r2-bgp]peer 172.16.176.1 next-hop-local

[r4]bgp 64512
[r4-bgp]router-id 4.4.4.4
[r4-bgp]confederation id 2
[r4-bgp]confederation peer-as 64513
[r4-bgp]peer 172.16.144.1 as-number 64512
[r4-bgp]peer 172.16.144.1 connect-interface LoopBack 0
[r4-bgp]peer 172.16.208.1 as-number 64513
[r4-bgp]peer 172.16.208.1 ebgp-max-hop 255
[r4-bgp]peer 172.16.208.1 connect-interface LoopBack 0

[r5]bgp 64513
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]confederation peer-as 64512
[r5-bgp]peer 172.16.128.1 as-number 64512
[r5-bgp]peer 172.16.128.1 ebgp-max-hop 255
[r5-bgp]peer 172.16.128.1 connect-interface LoopBack 0
[r5-bgp]peer 172.16.192.1 as-number 64513
[r5-bgp]peer 172.16.192.1 connect-interface LoopBack 0

[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 2
[r6-bgp]peer 172.16.176.1 as-number 64513
[r6-bgp]peer 172.16.176.1 connect-interface LoopBack 0
[r6-bgp]peer 172.16.208.1 as-number 64513
[r6-bgp]peer 172.16.208.1 connect-interface LoopBack 0

[r7-bgp]dis th
bgp 64513
router-id 7.7.7.7
confederation id 2
confederation peer-as 64512
peer 10.1.2.1 as-number 3
peer 10.1.2.1 ebgp-max-hop 2
peer 10.1.2.1 connect-interface LoopBack0
peer 172.16.160.1 as-number 64512
peer 172.16.160.1 ebgp-max-hop 255
peer 172.16.160.1 connect-interface LoopBack0
peer 172.16.192.1 as-number 64513
peer 172.16.192.1 connect-interface LoopBack0
peer 172.16.160.1 next-hop-local
peer 172.16.192.1 next-hop-local

ipv4-family unicast
undo synchronization
peer 10.1.2.1 enable
peer 172.16.160.1 enable
peer 172.16.192.1 enable

return

四、宣告路由(汇总)
[r1]ip route-static 10.1.1.0 24 NULL 0
[r1]bgp 1
[r1-bgp]net 10.1.1.0 255.255.255.0

[r2]ip route-static 172.16.0.0 16 NULL 0
[r2]bgp 64512
[r2-bgp]net 172.16.0.0

[r7]ip route-static 172.16.0.0 16 NULL 0
[r7]bgp 64513
[r7-bgp]network 172.16.0.0

[r8]ip route-static 10.1.2.0 24 NULL 0
[r8]bgp 3
[r8-bgp]network 10.1.2.0 255.255.255.0

五、配置反射器

[r3]bgp 64512
[r3-bgp]peer 172.16.160.1 r
[r3-bgp]peer 172.16.160.1 reflect-client

[r6]bgp 64513
[r6-bgp]peer 172.16.176.1 r
[r6-bgp]peer 172.16.176.1 reflect-client
在这里插入图片描述
在这里插入图片描述

测试连通性在这里插入图片描述
六、配置vpn
[r1-Tunnel0/0/0]dis th
[V200R003C00]

interface Tunnel0/0/0
ip address 10.1.3.1 255.255.255.0
tunnel-protocol gre
source 10.1.1.1
destination 10.1.2.1
ospf network-type broadcast

return
[r1]ip route-static 192.168.2.0 24 10.1.3.2

[r8-Tunnel0/0/0]dis th
[V200R003C00]

interface Tunnel0/0/0
ip address 10.1.3.2 255.255.255.0
tunnel-protocol gre
source 10.1.2.1
destination 10.1.1.1
ospf network-type broadcast

return
[r8]ip route-static 192.168.1.0 24 10.1.3.1
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值