大数跨境
0
0

华为策略路由实验-不同路由可达

华为策略路由实验-不同路由可达 丰沃创新
2020-03-19
2
导读:如图所示:以3ping 1 和3 ping 2分别走不同的路径则目的不同源相同,则匹配目的sw-1:sysn

如图所示:以3ping 1 和3 ping 2分别走不同的路径

则目的不同源相同,则匹配目的


sw-1:

sysname sw-1

#

vlan batch 12 to 13 24 34

#

stp disable

#

interface Vlanif12

ip address 12.1.1.1 255.255.255.0

#

interface Vlanif13

ip address 13.1.1.1 255.255.255.0

#

interface GigabitEthernet0/0/47

port link-type access

port default vlan 13

#

interface GigabitEthernet0/0/48

port link-type access

port default vlan 12

#

interface LoopBack0

ip address 192.168.1.1 255.255.255.0

#

interface LoopBack1

ip address 192.168.2.1 255.255.255.0

#

interface LoopBack2

ip address 192.168.3.1 255.255.255.0

#

ospf 1

area 0.0.0.0

network 0.0.0.0 255.255.255.255


sw-2

sysname sw-2

#

vlan batch 12 to 13 24 34

#

interface Vlanif12

ip address 12.1.1.2 255.255.255.0

#

interface Vlanif24

ip address 24.1.1.2 255.255.255.0

#

interface GigabitEthernet0/0/47

port link-type access

port default vlan 12

#

interface GigabitEthernet0/0/48

port link-type access

port default vlan 24

#

ospf 1

area 0.0.0.0

network 0.0.0.0 255.255.255.255

return


sw-3

sysname sw-3

#

vlan batch 12 to 13 24 34 666

#

interface Vlanif13

ip address 13.1.1.3 255.255.255.0

#

interface Vlanif34

ip address 34.1.1.3 255.255.255.0

#

interface GigabitEthernet1/0/47

port link-type access

port default vlan 13

#

interface GigabitEthernet1/0/48

port link-type access

port default vlan 34

#

ospf 1

area 0.0.0.0

network 0.0.0.0 255.255.255.255


sw-4

sysname sw-4

#

vlan batch 12 to 13 24 34

#

acl number 3011

rule 5 permit ip destination 192.168.1.1 0

acl number 3021

rule 5 permit ip destination 192.168.2.1 0

#

traffic classifier 11 operator and

if-match acl 3011

traffic classifier 21 operator and

if-match acl 3021

#

traffic behavior b11

redirect ip-nexthop 24.1.1.2

traffic behavior b21

redirect ip-nexthop 34.1.1.3 //重定向,只在接口的入方向,也就是接口的in方向

#

traffic policy Policy match-order config

classifier 11 behavior b11

classifier 21 behavior b21

#

interface Vlanif1

ip address 10.1.1.254 255.255.255.0

#

interface Vlanif24

ip address 24.1.1.4 255.255.255.0

#

interface Vlanif34

ip address 34.1.1.4 255.255.255.0

#

interface GigabitEthernet2/0/34

port link-type access

traffic-policy Policy inbound

#

interface GigabitEthernet2/0/47

port link-type access

port default vlan 34

#

interface GigabitEthernet2/0/48

port link-type access

port default vlan 24

#

ospf 1

area 0.0.0.0

network 0.0.0.0 255.255.255.255


实例分析:

由pc-1 ping pc-2和pc-6分别走不通的链路,一个走左边一个走右边:

因为这个是同一个源访问不同的目的,因此匹配目的;

且在接口调用时注意:在sw-4的g0/0/3口,因为在这里流量分流了。

因此记住:里调用接口最近的接口调用。

切记目的地址匹配时,目的地址必须的精确地址不能是网段,不然不会走策略路由

【声明】内容源于网络
0
0
丰沃创新
国内领先的ICT综合服务提供商,丰沃创新总部位于北京。业务覆盖全国。业务主要涵盖系统集成与软件开发、客户技术支持服务、ICT及AIoT产品教育培训三个事业部,为政府、电力能源、交通、金融、教育等诸多行业客户提供专业化的ICT产品及服务。
内容 1642
粉丝 0
丰沃创新 国内领先的ICT综合服务提供商,丰沃创新总部位于北京。业务覆盖全国。业务主要涵盖系统集成与软件开发、客户技术支持服务、ICT及AIoT产品教育培训三个事业部,为政府、电力能源、交通、金融、教育等诸多行业客户提供专业化的ICT产品及服务。
总阅读1.0k
粉丝0
内容1.6k