BGP综合

 

1、使用PreVal策略,确保R4通过R2到达192.168.10.0/24。

2、使用AS_Path策略,确保R4迪过R3到达192.168.11.0/24。

3、配置MED策略,确保R4通过R3到达192.168.12.0/24。

4、使用Local Preference策略,确保R1通过R2到达192.168.1.0/24。

5、使用Local Preference策略,确保R1通过R3到达192.168.2.0/24。

6、配置负载均衡,确保R1通过R2和R3到达192.168.3.0/24。

7、使用As策略,As 500不接受任何始发于AS 123的路由。

8、使用自定义Community策略,确保192.168.3.0/24路由不会被发布到AS 500。

9、IBGP使用环回接口建邻,EBGP使用物理接口建邻。

10、修改AS 123中的用户网段为Broadcast,方便后续在BGP中宣告。

11、BGP宣告路由时,仅宣告24网段的用户路由。
 

 R3

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip ad 34.0.0.3 21

[r3-GigabitEthernet0/0/1]ip ad 13.0.0.3 24

[r3-GigabitEthernet0/0/1]int l0
[r3-LoopBack0]ip ad 3.3.3.3 32
[r3-LoopBack0]

[R3]ospf 1 router-id 3.3.3.3

[R3-ospf-1]area 0

[R3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0

[R3-ospf-1-area-0.0.0.0]net 13.0.0.3 0.0.0.0

[R3-ospf-1-area-0.0.0.0]net 34.0.0.3 0.0.0.0

[R3-ospf-1-area-0.0.0.0]net 192.168.30.1 0.0.0.0
 

 

建立BGP连接 

[r2]bgp 123
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 24.0.0.4 as-number 400

[r3]bgp 123
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 34.0.0.4 as-number 400

 R4

[Huawei]bgp 400
[Huawei-bgp]router-id 4.4.4.4
[Huawei-bgp]peer 24.0.0.2 as-number 123
[Huawei-bgp]peer 34.0.0.3 as-number 123

 

 R1 和R5建立BGP连接


[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 15.0.0.5  as-number 500

[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip ad 15.0.0.5 24

[r5]bgp 500
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 15.0.0.1 as-number 123
 

R1,R2,R3建立BGP

[r2]bgp 123
[r2-bgp]peer 1.1.1.1 as-number 123
[r2-bgp]peer 1.1.1.1 connect-interface  l0
[r2-bgp]peer 1.1.1.1 next-hop-local

[r3]bgp 123
[r3-bgp]peer 1.1.1.1 as-number 123
[r3-bgp]peer 1.1.1.1 connect-interface l0
[r3-bgp]peer 1.1.1.1 next-hop-local

[R1-bgp]peer 2.2.2.2 as-number 123

[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0

[R1-bgp]peer 3.3.3.3 as-number 123

[R1-bgp]peer 3.3.3.3 connect-interface LoopBack 0

[R1-bgp]peer 2.2.2.2 next-hop-local

[R1-bgp]peer 3.3.3.3 next-hop-local
 

修改为broadcast

[R1-LoopBack1]ospf network-type broadcast

[R2-LoopBack1]ospf network-type broadcast

[R3-LoopBack1]ospf network-type broadcast
 

 1、使用PreVal策略,确保R4通过R2到达192.168.10.0/24。

AS-P

MED

ip-prefix AS permit 抓流量

route-policy AS permit node 10  写策略

放通流量

[R4]bgp 400

[R4-bgp]peer 24.0.0.2 route-policy AS import  

---调用

 

[R4]ip ip-prefix PV permit 192.168.10.0 24  

[R4]route-policy PV permit node 10   

[R4-route-policy]if-match ip-prefix PV 

[R4-route-policy]apply preferred-value 100  

[R4-route-policy]q

[R4]route-policy PV permit node 20 

[R4]bgp 400

[R4-bgp]peer 24.0.0.2 route-policy PV import  

[R4]ip ip-prefix AS permit 192.168.11.0 24   

[R4]route-policy AS permit node 10  

[R4-route-policy]if-match ip-prefix AS

[R4-route-policy]apply as-path 123 additive  ---添加AS_path

[R4-route-policy]q

[R4]route-policy AS permit node 20  

[R4-route-policy]q

[R4]bgp 400

[R4-bgp]peer 24.0.0.2 route-policy AS import 
 

相关推荐

  1. <span style='color:red;'>BGP</span><span style='color:red;'>综合</span>

    BGP综合

    2023-12-09 11:22:05      50 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-09 11:22:05       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-09 11:22:05       101 阅读
  3. 在Django里面运行非项目文件

    2023-12-09 11:22:05       82 阅读
  4. Python语言-面向对象

    2023-12-09 11:22:05       91 阅读

热门阅读

  1. C语言精选——选择题Day40

    2023-12-09 11:22:05       59 阅读
  2. 【力扣100】9.和为k的子数组

    2023-12-09 11:22:05       70 阅读
  3. vue基本运用之常见问题及案例代码

    2023-12-09 11:22:05       53 阅读
  4. error: overloaded function with no contextual type information

    2023-12-09 11:22:05       50 阅读
  5. 爬虫解析-BeautifulSoup-bs4(七)

    2023-12-09 11:22:05       55 阅读
  6. vue+vite+diff.js使用方法

    2023-12-09 11:22:05       51 阅读
  7. npm、yarn常用命令

    2023-12-09 11:22:05       61 阅读
  8. Mac 打不开github解决方案

    2023-12-09 11:22:05       63 阅读
  9. HTML实现每天单词积累

    2023-12-09 11:22:05       35 阅读
  10. 前端知识笔记(三十七)———Django与Ajax

    2023-12-09 11:22:05       54 阅读
  11. uniapp监听wifi连接状态

    2023-12-09 11:22:05       52 阅读
  12. C/C++——内存管理

    2023-12-09 11:22:05       65 阅读
  13. TCP Keepalive 和 HTTP Keep-Aliv

    2023-12-09 11:22:05       58 阅读