欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > 华为单臂路由 与 策略路由

华为单臂路由 与 策略路由

2025/4/2 10:20:11 来源:https://blog.csdn.net/qq_40390383/article/details/146568509  浏览:    关键词:华为单臂路由 与 策略路由

单臂路由

概念:如图大纲LSW1是二层交换机不具备三层路由功能,并且连接着不同的vlan,并使每个vlan都可以与外网通信,那么就要用单臂路由技术,原理是将图中的AR1的ge0/0/0接口逻辑上分为多个子接口,分别对应不同的vlan的网关。

LSW1配置:

vlan batch 10 20
interface GigabitEthernet0/0/1port link-type trunkport trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2port link-type accessport default vlan 10
#
interface GigabitEthernet0/0/3port link-type accessport default vlan 20

AR1配置

interface GigabitEthernet0/0/0.10dot1q termination vid 10    //将子接口作为vlan 10的网关ip address 192.168.1.1 255.255.255.0 arp broadcast enable        //启用arp广播功能,不启用vlan间无法通信
#
interface GigabitEthernet0/0/0.20dot1q termination vid 20ip address 192.168.2.1 255.255.255.0 arp broadcast enable

效果:从pc1中tracert 192.168.2.2

策略路由

原理:使用基于原地址或者目标地址策略转发数据到下一个接口,策略路由不会影响路由表,案例如图所示

全局启用ospf协议,正常情况下pc1访问pc2路径为pc1—>AR1—>AR3—>pc2,先通过在AR1上通过策略路由将路径改为pc1—>AR1—>AR2—>AR3—>pc2

无论是使用策略路由前,还是之后,AR1路由表中去往192.168.2.0/24,都是下图:

拓扑图

AR1不配置策略路由时 pc1 tracert 192.168.2.2

AR1配置策略路由时 pc1 tracert 192.168.2.2

AR1配置:

interface GigabitEthernet0/0/0ip address 13.1.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/1ip address 12.1.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/2ip address 192.168.1.1 255.255.255.0 ospf 1 router-id 1.1.1.1 area 0.0.0.0 network 12.1.1.0 0.0.0.255 network 13.1.1.0 0.0.0.255 network 192.168.1.0 0.0.0.255 以下策略路由:抓取流量:
acl number 3000  rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255定义流分类:
traffic classifier dingxiang operator orif-match acl 3000定义流行为:
traffic behavior bdingxingredirect ip-nexthop 12.1.1.2定义流策略
traffic policy pdingxiangclassifier dingxiang behavior bdingxing在接口启用策略:
interface GigabitEthernet0/0/2ip address 192.168.1.1 255.255.255.0 traffic-policy pdingxiang inbound

AR2配置:

interface GigabitEthernet0/0/0ip address 12.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/1ip address 23.1.1.1 255.255.255.0 ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 12.1.1.0 0.0.0.255 network 23.1.1.0 0.0.0.255 

AR3配置:

interface GigabitEthernet0/0/0ip address 13.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/1ip address 23.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/2ip address 192.168.2.1 255.255.255.0ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 13.1.1.0 0.0.0.255 network 23.1.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词