当前位置: 首页 > news >正文

华为在ospf area 0单区域的情况下结合pbr对数据包的来回路径进行控制

在这里插入图片描述

配置思路:
两边去的包在R1上用mqc进行下一跳重定向
两边回程包在R4上用mqc进行下一跳重定向

最终让内网
192.168.10.0出去的数据包来回全走上面R-1-2-4
192.168.20.0出去的数据包来回全走 下面R1-3-4

R2和R3就是简单ospf配置和宣告,其它没有配置,这里就不贴上去了。

R1配置:

dis current-configuration
[V200R003C00]
acl number 3000
rule 5 permit ip source 192.168.10.0 0.0.0.255 destination 10.0.3.0 0.0.0.255
rule 10 permit ip source 192.168.10.0 0.0.0.255 destination 10.0.4.0 0.0.0.255
acl number 3001
rule 5 permit ip source 192.168.20.0 0.0.0.255 destination 10.0.4.0 0.0.0.255
rule 10 permit ip source 192.168.20.0 0.0.0.255 destination 10.0.3.0 0.0.0.255

traffic classifier 124 operator or
if-match acl 3000
traffic classifier 134 operator or
if-match acl 3001

traffic behavior 124
redirect ip-nexthop 12.1.1.2
traffic behavior 134
redirect ip-nexthop 13.1.1.3

traffic policy admin
classifier 124 behavior 124
classifier 134 behavior 134

interface GigabitEthernet0/0/0
ip address 11.1.1.1 255.255.255.0
traffic-policy admin inbound
ospf enable 1 area 0.0.0.0

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

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

ospf 1
import-route direct
area 0.0.0.0

LSW1配置

dis current-configuration

sysname hx

undo info-center enable

vlan batch 10 20 30

cluster enable
ntdp enable
ndp enable

drop illegal-mac alarm

dhcp enable

interface Vlanif1

interface Vlanif10
ip address 192.168.10.1 255.255.255.0
dhcp select interface

interface Vlanif20
ip address 192.168.20.1 255.255.255.0
dhcp select interface

interface Vlanif30
ip address 11.1.1.2 255.255.255.0
ospf enable 1 area 0.0.0.0

interface MEth0/0/1

interface GigabitEthernet0/0/1
port link-type access
port default vlan 10

interface GigabitEthernet0/0/2
port link-type access
port default vlan 20

interface GigabitEthernet0/0/3
port link-type access
port default vlan 30

ospf 1
import-route direct
silent-interface Vlanif10
silent-interface Vlanif20
area 0.0.0.0

R4配置:

dis current-configuration
[V200R003C00]

board add 0/4 4GET

snmp-agent local-engineid 800007DB03000000000000
snmp-agent

clock timezone China-Standard-Time minus 08:00:00

portal local-server load portalpage.zip

drop illegal-mac alarm

set cpu-usage threshold 80 restore 75

acl number 3000
rule 10 permit ip source 10.0.3.0 0.0.0.255 destination 192.168.10.0 0.0.0.255
acl number 3001
rule 10 permit ip source 10.0.4.0 0.0.0.255 destination 192.168.20.0 0.0.0.255

traffic classifier 431 operator or
if-match acl 3001
traffic classifier 421 operator or
if-match acl 3000

traffic behavior 431
redirect ip-nexthop 34.1.1.3
traffic behavior 421
redirect ip-nexthop 24.1.1.2

traffic policy 431
classifier 431 behavior 431
traffic policy 421
classifier 421 behavior 421

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

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

interface GigabitEthernet0/0/2
ip address 10.0.3.1 255.255.255.0
traffic-policy 421 inbound

interface GigabitEthernet4/0/0
ip address 10.0.4.1 255.255.255.0
traffic-policy 431 inbound

interface NULL0

ospf 1
import-route direct
silent-interface GigabitEthernet0/0/2
silent-interface GigabitEthernet4/0/0
area 0.0.0.0

http://www.lryc.cn/news/128171.html

相关文章:

  • PyQt5登录界面跳转
  • git add 用法
  • 系统架构设计师---2018年下午试题1分析与解答(试题三)
  • 面试时如何回答接口测试怎么进行
  • 【LeetCode】647.回文子串
  • 【Git】SSH到底是什么
  • 当你出差在外时,怎样轻松访问远程访问企业局域网象过河ERP系统?
  • 机器学习与模型识别1:SVM(支持向量机)
  • 在CentOS7.9上安装最新版本Docker安装步骤
  • 基于 spring boot 的动漫信息管理系统【源码在文末】
  • vue项目根据word模版导出word文件
  • PHP 从 URL(链接) 字符串中获取参数
  • 第一百三十一天学习记录:数据结构与算法基础:栈和队列(下)(王卓教学视频)
  • 全球磁强计市场价值约为16.2亿美元,预测期内将以超过5.21%的增长率增长
  • WebGL游戏站优化实录【myshmup.com】
  • 6、Mysql免安装版本的配置与使用(2023-08)
  • docker之简介与安装
  • vue之动态表单(优化)
  • web连接桌面打开gptmap
  • 做好需求分析的4大关键认知
  • Max Compute 操作记录
  • Windows 11 + Ubuntu20.04 双系统 坑里爬起来
  • touch手势事件及功能封装
  • 面试问题记录
  • ZooKeeper的应用场景(集群管理、Master选举)
  • 面试算法编程题
  • JVM——JDK 监控和故障处理工具总结
  • 多维时序 | MATLAB实现WOA-CNN鲸鱼算法优化卷积神经网络的数据多变量时间序列预测
  • ZoomIt v7.1
  • E8—Aurora 64/66B ip实现GTX与GTY的40G通信2023-08-12