华为bgp之多级RR及团体属性、正则表达式多种应用案例

在这里插入图片描述

1、实现总部和分部的oa、财务网段互通
2、分部之间oa也能互通
3、分部之间不能互通财务

主要用到bgp自定义团体属性、一级二级RR配置、bgp正则表达式匹配规则

R1

router id 1.1.1.1 //配全局地址池,又可以给ospf用也可以给bgp用

interface GigabitEthernet0/0/0
ip address 10.0.12.1 255.255.255.0
ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/1
ip address 10.0.11.1 255.255.255.0

interface GigabitEthernet0/0/2

interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf enable 1 area 0.0.0.0

bgp 65100
peer 10.0.11.2 as-number 65001
peer 10.0.11.2 password cipher admin
peer 10.0.11.2 valid-ttl-hops 255 //开启ttl最大限制,为了安全
group ibgp internal //igp设备太多了,用组省事
peer ibgp connect-interface LoopBack0
peer 2.2.2.2 as-number 65100
peer 2.2.2.2 group ibgp
peer 4.4.4.4 as-number 65100
peer 4.4.4.4 group ibgp

ipv4-family unicast
undo synchronization
peer 10.0.11.2 enable
peer 10.0.11.2 route-policy finance export //发去分公司路由进行策略匹配
peer 10.0.11.2 advertise-community //开启传递团队属性功能
peer ibgp enable
peer ibgp next-hop-local
peer ibgp advertise-community //开启传递团队属性功能
peer 2.2.2.2 enable
peer 2.2.2.2 group ibgp
peer 4.4.4.4 enable
peer 4.4.4.4 group ibgp

ospf 1
area 0.0.0.0

route-policy finance permit node 10 //先检测调用匹配到的oa包策略并放行
if-match community-filter oa

route-policy finance deny node 20 //再匹配财务的策略
if-match as-path-filter finance

route-policy finance permit node 30 //其它没有匹配的放行

ip as-path-filter finance permit 65002$ //把起源结尾标签bgp号是65002的财务给正则出来

ip community-filter basic oa permit 65002:2 //把带有这个标签的oa办公包给匹配出来

R2

router id 2.2.2.2

interface GigabitEthernet0/0/0
ip address 10.0.23.2 255.255.255.0
ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/1
ip address 10.0.12.2 255.255.255.0
ospf enable 1 area 0.0.0.0

interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf enable 1 area 0.0.0.0

bgp 65100
group ibgp internal
peer ibgp connect-interface LoopBack0
peer 1.1.1.1 as-number 65100
peer 1.1.1.1 group ibgp
peer 3.3.3.3 as-number 65100
peer 3.3.3.3 group ibgp
peer 4.4.4.4 as-number 65100
peer 4.4.4.4 group ibgp
peer 5.5.5.5 as-number 65100
peer 5.5.5.5 group ibgp

ipv4-family unicast
undo synchronization
reflector cluster-id 24.24.24.24 //用于标识二级RR
peer ibgp enable
peer ibgp reflect-client //把学到的路由RR给所有的对等体
peer ibgp advertise-community //所有的IBGP对开启团体属性传递
peer 1.1.1.1 enable
peer 1.1.1.1 group ibgp
peer 3.3.3.3 enable
peer 3.3.3.3 group ibgp
peer 4.4.4.4 enable
peer 4.4.4.4 group ibgp
peer 5.5.5.5 enable
peer 5.5.5.5 group ibgp

ospf 1
area 0.0.0.0

R3

router id 3.3.3.3

interface GigabitEthernet0/0/0
ip address 10.0.23.3 255.255.255.0
ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/1
ip address 10.0.34.3 255.255.255.0
ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/2
ip address 10.0.33.3 255.255.255.0

interface LoopBack0
ip address 3.3.3.3 255.255.255.255
ospf enable 1 area 0.0.0.0

bgp 65100
peer 10.0.33.1 as-number 65003
peer 10.0.33.1 password cipher admin
peer 10.0.33.1 valid-ttl-hops 255
group ibgp internal
peer ibgp connect-interface LoopBack0
peer 2.2.2.2 as-number 65100
peer 2.2.2.2 group ibgp
peer 4.4.4.4 as-number 65100
peer 4.4.4.4 group ibgp

ipv4-family unicast
undo synchronization
peer 10.0.33.1 enable
peer 10.0.33.1 advertise-community //开启bgp团体属性传递功能
peer ibgp enable
peer ibgp reflect-client
peer ibgp next-hop-local
peer ibgp advertise-community //开启bgp团体属性传递功能
peer 2.2.2.2 enable
peer 2.2.2.2 group ibgp
peer 4.4.4.4 enable
peer 4.4.4.4 group ibgp

ospf 1
area 0.0.0.0

R4

router id 4.4.4.4

interface GigabitEthernet0/0/0
ip address 10.0.34.4 255.255.255.0
ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/1
ip address 10.0.45.4 255.255.255.0
ospf enable 1 area 0.0.0.0

interface LoopBack0
ip address 4.4.4.4 255.255.255.255
ospf enable 1 area 0.0.0.0

bgp 65100
group ibgp internal
peer ibgp connect-interface LoopBack0
peer 1.1.1.1 as-number 65100
peer 1.1.1.1 group ibgp
peer 2.2.2.2 as-number 65100
peer 2.2.2.2 group ibgp
peer 3.3.3.3 as-number 65100
peer 3.3.3.3 group ibgp
peer 5.5.5.5 as-number 65100
peer 5.5.5.5 group ibgp

ipv4-family unicast
undo synchronization
reflector cluster-id 24.24.24.24
peer ibgp enable
peer ibgp reflect-client
peer ibgp advertise-community
peer 1.1.1.1 enable
peer 1.1.1.1 group ibgp
peer 2.2.2.2 enable
peer 2.2.2.2 group ibgp
peer 3.3.3.3 enable
peer 3.3.3.3 group ibgp
peer 5.5.5.5 enable
peer 5.5.5.5 group ibgp

ospf 1
area 0.0.0.0

R5

router id 5.5.5.5

interface GigabitEthernet0/0/0
ip address 10.0.45.5 255.255.255.0
ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/1
ip address 10.0.52.5 255.255.255.0

interface LoopBack0
ip address 5.5.5.5 255.255.255.255
ospf enable 1 area 0.0.0.0

bgp 65100
peer 10.0.52.2 as-number 65002
peer 10.0.52.2 password cipher % % ;^^:7p’wdXiw4.Pc;G9+<*7i% %
peer 10.0.52.2 valid-ttl-hops 255
group ibgp internal
peer ibgp connect-interface LoopBack0
peer 2.2.2.2 as-number 65100
peer 2.2.2.2 group ibgp
peer 4.4.4.4 as-number 65100
peer 4.4.4.4 group ibgp

ipv4-family unicast
undo synchronization
peer 10.0.52.2 enable
peer 10.0.52.2 route-policy finance export
peer 10.0.52.2 advertise-community
peer ibgp enable
peer ibgp next-hop-local
peer ibgp advertise-community
peer 2.2.2.2 enable
peer 2.2.2.2 group ibgp
peer 4.4.4.4 enable
peer 4.4.4.4 group ibgp

ospf 1
area 0.0.0.0

route-policy finance permit node 10
if-match community-filter oa

route-policy finance deny node 20
if-match as-path-filter finance

route-policy finance permit node 30

ip as-path-filter finance permit 65001$

ip community-filter basic oa permit 65001:1

sw1

interface Vlanif1
ip address 10.0.11.2 255.255.255.0

interface GigabitEthernet0/0/1
port link-type access

interface LoopBack0
ip address 11.1.1.1 255.255.255.0

interface LoopBack1
ip address 21.1.1.1 255.255.255.0

bgp 65001
peer 10.0.11.1 as-number 65100
peer 10.0.11.1 password cipher admin

ipv4-family unicast
undo synchronization
network 11.0.0.0
network 11.1.1.0 255.255.255.0
network 21.1.1.0 255.255.255.0
peer 10.0.11.1 enable
peer 10.0.11.1 route-policy attr export //发出去对端时调用策略
peer 10.0.11.1 advertise-community //开启bgp团体属性传递功能

route-policy attr permit node 10 //调用匹配出的oa网段
if-match ip-prefix com
apply community 65001:1 //打上标签

route-policy attr permit node 20 //其它放行

ip ip-prefix com index 10 permit 11.1.1.0 24 //匹配出oa的数据网段

SW2

interface Vlanif1
ip address 10.0.52.2 255.255.255.0

interface MEth0/0/1

interface GigabitEthernet0/0/1
port link-type access

interface LoopBack0
ip address 22.1.1.1 255.255.255.0

interface LoopBack1
ip address 32.1.1.1 255.255.255.0

bgp 65002
peer 10.0.52.5 as-number 65100
peer 10.0.52.5 password cipher admin

ipv4-family unicast
undo synchronization
network 22.1.1.0 255.255.255.0
network 32.1.1.0 255.255.255.0
peer 10.0.52.5 enable
peer 10.0.52.5 route-policy attr export
peer 10.0.52.5 advertise-community

route-policy attr permit node 10
if-match ip-prefix com
apply community 65002:2

route-policy attr permit node 20

ip ip-prefix com index 10 permit 22.1.1.0 24

SW3

interface Vlanif1
ip address 10.0.33.1 255.255.255.0

interface MEth0/0/1

interface GigabitEthernet0/0/1
port link-type access

interface LoopBack0
ip address 33.1.1.1 255.255.255.0

interface LoopBack1
ip address 43.1.1.1 255.255.255.0

bgp 65003
peer 10.0.33.3 as-number 65100
peer 10.0.33.3 password cipher Q`OT=C0XP2sPddVIN=17t&I#

ipv4-family unicast
undo synchronization
network 33.1.1.0 255.255.255.0
network 43.1.1.0 255.255.255.0
peer 10.0.33.3 enable
peer 10.0.33.3 route-policy attr export
peer 10.0.33.3 advertise-community

route-policy attr permit node 10
if-match ip-prefix com
apply community 65003:3

route-policy attr permit node 20

ip ip-prefix com index 10 permit 33.1.1.0 24

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/294262.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

时序预测 | Matlab实现GJO-VMD-LSTM金豺-变分模态分解-长短期记忆网络时间序列预测

时序预测 | Matlab实现GJO-VMD-LSTM金豺-变分模态分解-长短期记忆网络时间序列预测 目录 时序预测 | Matlab实现GJO-VMD-LSTM金豺-变分模态分解-长短期记忆网络时间序列预测预测效果基本介绍模型设计程序设计参考资料 预测效果 基本介绍 Matlab实现GJO-VMD-LSTM金豺-变分模态分…

JAVA集合框架总结

集合框架概述 1.1 生活中的容器 1.2 数组的特点与弊端 一方面&#xff0c;面向对象语言对事物的体现都是以对象的形式&#xff0c;为了方便对多个对象的操作&#xff0c;就要对对象进行存储。另一方面&#xff0c;使用数组存储对象方面具有一些弊端&#xff0c;而Java 集合就…

使用 pg_stat_statements 优化查询

使用 pg_stat_statements 优化查询 就使用量和社区规模而言&#xff0c;PostgreSQL 是增长最快的数据库之一&#xff0c;得到许多专业开发人员的支持&#xff0c;并得到广泛的工具、连接器、库和可视化应用程序生态系统的支持。 PostgreSQL 也是可扩展的&#xff1a;使用 Postg…

这款IDEA插件真的爽,白嫖真香

Apipost-Helper是由Apipost推出的IDEA插件&#xff0c;写完接口可以进行快速调试&#xff0c;且支持搜索接口、根据method跳转接口&#xff0c;还支持生成标准的API文档&#xff0c;注意&#xff1a;这些操作都可以在代码编辑器内独立完成&#xff0c;非常好用&#xff01;这里…

室内效果图没有质感?外国大神这6个实用技巧,带你轻松掌握!

为了创作出高级有质感的效果图&#xff0c;我们需要注意构图、颜色、布光等多种因素&#xff0c;以打造出逼真的渲染效果。不过不要担心&#xff01;今天小编带来了国外知名设计师Arch Viz Artist在油管上分享的6个实用小技巧。看完带你轻松提升室内效果图的表现力&#xff01;…

指针数组做main函数的形参

目录 ​编辑 1. 指针数组 1.1 基本概念 1.2 简单示例 2. 指针数组做main形参 2.1 int main(int argc, char *argv[]); 2.2 简单示例 1. 指针数组 1.1 基本概念 指针数组是指一个数组&#xff0c;其中的每个元素都是指针。 这意味着数组中的每个元素都存储一个地址&…

2024 HarmonyOS NEXT要来了,舍弃Android,预计10亿台设备支持,你准备好了吗?

“纯血”HarmonyOS NEXT要来了&#xff0c;舍弃Android&#xff0c;预计10亿台设备支持&#xff0c;你准备好了吗&#xff1f; 根据最新消息&#xff0c;华为计划在今年第一季度向所有开发者开放全新HarmonyOS NEXT开发者预览版。 此外&#xff0c;据媒体报道&#xff0c;1月1…

(02)半导体前道制程工艺概览

01、半导体制程工艺概览 在第一篇的最后,我们说到金属氧化物半导体场效应晶体管(MOSFET)的平面式结构让人们可以在晶圆上同时制造出好几个MOSFET。且与第一代晶体管BJT不同,MOSFET无需焊接过程。本期内容就让我们来详细了解一下具体的制程工艺。 为方便讲解,我们先来看一…

Python 简单爬虫程序及其工作原理

前言 网络中包含大量的数据&#xff0c;这些数据对于我们来说是非常有价值的&#xff0c;因此编写一个爬虫程序&#xff0c;自动从网页中获取所需的数据&#xff0c;对于信息收集和分析是非常有帮助的。Python 是一种高效而灵活的编程语言&#xff0c;它提供了强大的库和框架来…

DNS被劫持怎么办

DNS劫持是一种网络攻击&#xff0c;攻击者通过篡改DNS记录&#xff0c;将特定域名的解析结果指向错误的IP地址&#xff0c;从而实现对特定网站的访问劫持或流量劫持。这种攻击方式严重影响了用户的上网体验&#xff0c;并可能导致用户隐私泄露。下面也从原因、危害以及应对的策…

静态网页设计——宝马官网(HTML+CSS+JavaScript)

前言 声明&#xff1a;该文章只是做技术分享&#xff0c;若侵权请联系我删除。&#xff01;&#xff01; 感谢大佬的视频&#xff1a; https://www.bilibili.com/video/BV1v64y1E7og/?vd_source5f425e0074a7f92921f53ab87712357b 使用技术&#xff1a;HTMLCSSJS&#xff08;…

使用windows活动目录用户登录vcenter及esxi主机

测试环境&#xff1a;esxi7u3g、vcenter7u3g 一、vcenter加入windows域 vcenter安装好后&#xff0c;将DNS设置为windows域控服务器的ip地址&#xff0c;windows域控服务器配置好DNS.这里域名为kf.tlmyt.petrochina。 找到上图中Administration,进入后找到左侧菜单single sig…

热烈庆祝西安大秦时代网络科技有限公司官网上线了!

热烈庆祝西安大秦时代网络科技有限公司官网上线了&#xff01; 热烈庆祝西安大秦时代网络科技有限公司官网上线了&#xff01; 热烈庆祝西安大秦时代网络科技有限公司官网上线了&#xff01;

如何快速定位php程序运行慢的地方

1 slow log日志 查看slowlog日志位置 编辑php-fpm.conf文件&#xff0c;更改或增加两行内容 slowlog /data/logs/php-slow.log request_slowlog_timeout 2 说明&#xff1a;slowlog定义日志路径和名字&#xff0c;request_slowlog_timeout定义超时时间&#xff0c;单位…

CloudQuery 的过去、现在和未来

CloudQuery (后续简称「CQ」)这个产品从设计/研发到现在&#xff0c;一晃已经 5 年多时间了&#xff0c;在不断的完善中&#xff0c;也积累了不少的社区/企业用户&#xff0c;我意识到&#xff0c;CQ 已经从一个 Idea 变成了公众软件&#xff0c;开始有它的使命、责任和价值主张…

C#上位机与欧姆龙PLC的通信10----开发专用的通讯工具软件(WPF版)

1、介绍 上节开发了一个winform版的通讯测试工具&#xff0c;这节再搞个wpf版的&#xff0c;wpf是什么&#xff1f;请自行百度&#xff0c;也可以看前面的博客&#xff0c;WPF真入门教程&#xff0c;wpf的界面效果是比winform漂亮&#xff0c;因为wpf使用了web项目中的css样式…

jenkins忘记密码后的操作

1、先停止 jenkins 服务 systemctl stop jenkins 关闭Jenkins服务 或者杀掉进程 ps -ef | grep jenkins &#xff5c;awk {print $2} | grep -v "grep" | xargs kill -9 2、找到 config.xml 文件 find /root -name config.xml3、备份config.xml文件 cp /root/.jen…

AI论文指南|ChatGPT助力论文论据搜集!【建议收藏】

点击下方▼▼▼▼链接直达AIPaperPass &#xff01; AIPaperPass - AI论文写作指导平台 公众号原文▼▼▼▼&#xff1a; AI论文指南|ChatGPT助力论文论据搜集&#xff01;【建议收藏】 上一篇文章&#xff0c;小编为宝子们分享了ChatGPT在论文论点提炼方面的内容以及操作流…

Java中的IO与NIO篇----第四篇

系列文章目录 文章目录 系列文章目录前言一、NIO 的非阻塞二、Channel三、Buffer四、Selector前言 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站,这篇文章男女通用,看懂了就去分享给你的码吧。 一、NIO 的非阻塞 I…

安装PyTorch及环境配置(应用于Python上的YOLO)

这个基本都是Bilibili网站里面叫“小手丫子”up的视频教程&#xff0c;此前自己需要装了好几次又卸载了好几次&#xff0c;现在根据视频教学整理出来自己所理解的文档。 注意事项 1.安装的pycharm版本和anaconda版本无要求。 2.运行pycharm尽量以管理员身份运行。 3.Cuda是独…
最新文章