搜档网
当前位置:搜档网 › CISCO交换机策略路由配置说明

CISCO交换机策略路由配置说明

CISCO交换机策略路由配置说明
CISCO交换机策略路由配置说明

Configuring Policy-Based Routing

You can use policy-based routing (PBR) to configure a defined policy for traffic flows. By using PBR, you can have more control over routing by reducing the reliance on routes derived from routing protocols. PBR can specify and implement routing policies that allow or deny paths based on:

?Identity of a particular end system

?Application

?Protocol

You can use PBR to provide equal-access and source-sensitive routing, routing based on interactive versus batch traffic, or routing based on dedicated links. For example, you could transfer stock records to a corporate office on a high-bandwidth, high-cost link for a short time while transmitting routine application data such as e-mail over a low-bandwidth, low-cost link.

With PBR, you classif y traffic using access control lists (ACLs) and then make traffic go through a different path. PBR is applied to incoming packets. All packets received on an interface with PBR enabled are passed through route maps. Based on the criteria defined in the route maps, packets are forwarded (routed) to the appropriate next hop.

?If packets do not match any route map statements, all set clauses are applied.

?If a statement is marked as permit and the packets do not match any route-map statements, the packets are sent through the normal forwarding channels, and destination-based routing is performed.

?For PBR, route-map statements marked as deny are not supported.

For more information about configuring route maps, see the "Using Route Maps to Redistribute Routing Information" section.

You can use standard IP ACLs to specify match criteria for a source address or extended IP ACLs to specify match criteria based on an application, a protocol type, or an end station. The process proceeds through the route map until a match is found. If no match is found, normal

destination-based routing occurs. There is an implicit deny at the end of the list of match statements.

If match clauses are satisfied, you can use a set clause to specify the IP addresses identifying the next hop router in the path.

For details about PBR commands and keywords, see the Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols, Release 12.2. For a list of PBR commands that are visible but not supported by the switch, see Appendix C, "Unsupported Commands in

Cisco IOS Release 12.2(35)SE,"

Note This software release does not support PBR when processing IPv4 and IPv6 traffic.

PBR Configuration Guidelines

Before configuring PBR, you should be aware of this information:

?To use PBR, you must have the IP services image installed on the switch.

?Multicast traffic is not policy-routed. PBR applies to only to unicast traffic.

?You can enable PBR on a routed port or an SVI.

?The switch does not support route-map deny statements for PBR.

?You can apply a policy route map to an EtherChannel port channel in Layer 3 mode, but you cannot apply a policy route map to a physical interface that is a member of the EtherChannel. If you try to do so, the command is rejected. When a policy route map is applied to a physical interface, that interface cannot become a member of an EtherChannel.

?You can define a maximum of 246 IP policy route maps on the switch.

?You can define a maximum of 512 access control entries (ACEs) for PBR on the switch.

?When configuring match criteria in a route map, follow these guidelines:

–Do not match ACLs that permit packets destined for a local address. PBR would forward these packets, which could cause ping or Telnet failure or route protocol flapping.

–Do not match ACLs with deny ACEs. Packets that match a deny ACE are sent to the CPU, which could cause high CPU utilization.

?To use PBR, you must first enable the routing template by using the sdm prefer routing global configuration command. PBR is not supported with the VLAN or default template. For more information on the SDM templates, see Chapter 7, "Configuring SDM Templates."

?VRF and PBR are mutually exclusive on a switch interface. You cannot enable VRF when PBR is enabled on an interface. In contrast, you cannot enable PBR when VRF is enabled on an interface.

?The number of TCAM entries used by PBR depends on the route map itself, the ACLs used, and the order of the ACLs and route-map entries.

?Policy-based routing based on packet length, TOS, set interface, set default next hop, or set default interface are not supported. Policy maps with no valid set actions or with set action set to Don't Fragment are not supported.

?Beginning with Cisco IOS Release 12.2(35)SE, the switch supports quality of service (QoS) DSCP and IP precedence matching in PBR route maps with these limitations:

–You cannot apply QoS DSCP mutation maps and PBR route maps to the same interface.

–You cannot configure DSCP transparency and PBR DSCP route maps on the same switch.

–When you configure PBR with QoS DSCP, you can set QoS to be enabled (by entering the mls qos global configuration command) or disabled (by entering the no mls qos command). When QoS is enabled, to ensure that the DSCP value of the traffic is unchanged, you should configure DSCP trust state on the port where traffic enters the switch by entering the mls qos trust dscp interface configuration command. If the trust state is not DSCP, by default all nontrusted traffic would have the DSCP value marked to 0.

Enabling PBR

By default, PBR is disabled on the switch. To enable PBR, you must create a route map that specifies the match criteria and the resulting action if all of the match clauses are met. Then, you must enable PBR for that route map on an interface. All packets arriving on the specified interface matching the match clauses are subject to PBR.

PBR can be fast-switched or implemented at speeds that do not slow down the switch.

Fast-switched PBR supports most match and set commands. PBR must be enabled before you enable fast-switched PBR. Fast-switched PBR is disabled by default.

Packets that are generated by the switch, or local packets, are not normally policy-routed. When you globally enable local PBR on the switch, all packets that originate on the switch are subject to local PBR. Local PBR is disabled by default.

Note To enable PBR, the switch must be running the IP services image.

Beginning in privileged EX EC mode, follow these steps to configure PBR:

???

Use the no route-map map-tag global configuration command or the no match or no set

route-map configuration commands to delete an entry. Use the no ip policy route-map map-tag interface configuration command to disable PBR on an interface. Use the no ip route-cache policy

interface configuration command to disable fast-switching PBR. Use the no ip local policy route-map map-tag global configuration command to disable policy-based routing on packets originating on the switch.

华为_MSR路由器_教育网双出口NAT服务器的典型配置

华为 MSR路由器教育网双出口NAT服务器的典型配置 一、组网需求: MSR 的 G0/0 连接某学校内网, G5/0 连接电信出口, G5/1 连接教育网出口,路由配置:访问教育网地址通过 G5/1 出去,其余通过默认路由通过 G5/0 出去。电信网络访问教育网地址都是通过电信和教育网的专用连接互通的,因此电信主机访问该校 一、组网需求: MSR的G0/0连接某学校内网,G5/0连接电信出口,G5/1连接教育网出口,路由配置:访问教育网地址通过G5/1出去,其余通过默认路由通过G5/0出去。电信网络访问教育网地址都是通过电信和教育网的专用连接互通的,因此电信主机访问该校都是从G5/1进来,如果以教育网源地址(211.1.1.0/24)从G5/0访问电信网络,会被电信过滤。该校内网服务器192.168.34.55需要对外提供访问,其域名是https://www.sodocs.net/doc/3810254398.html,,对应DNS解析结果是211.1.1.4。先要求电信主机和校园网内部主机都可以通过域名或211.1.1.4正常访问,且要求校园网内部可以通过NAT任意访问电信网络或教育网络。 设备清单:MSR一台 二、组网图:

三、配置步骤: 适用设备和版本:MSR系列、Version 5.20, Release 1205P01后所有版本。

四、配置关键点: 1) 此案例所实现之功能只在MSR上验证过,不同设备由于内部处理机制差异不能保证能够实现; 2) 策略路由是保证内部服务器返回外网的流量从G5/1出去,如果不使用策略路由会按照普通路由转发从G5/0出去,这样转换后的源地址211.1.1.4会被电信给过滤掉,因此必须使用策略路由从G5/1出去; 3) 策略路由的拒绝节点的作用是只要匹配ACL就变成普通路由转发,而不被策

三层交换机与路由器的配置_实例(图解)

三层交换机与路由器的配置实例(图解) 目的:学会使用三层交换与路由器让处于不同网段的网络相互通信 实验步骤:一:二层交换机的配置: 在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口 二:三层交换机的配置: 1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC的网关。 2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport) 3:将路由器和下面的交换机进行单臂路由的配置 实验最终结果:拓扑图下各个PC均能相互通信

交换机的配置命令: SW 0: Switch> Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 2 Switch(config-if)#no shut Switch(config-if)#int f0/3 Switch(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exit Switch(config)# SW 1: Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if)#no shut Switch(config-if)#exit Switch(config)#int f0/3 Switch(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)# SW 2: Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]?

H3C S5800 三层交换机简要配置手册,源地址策略路由

H3C S5800简要配置手册 系统的配置 给交换机命名 system-view [H3C] sysname [NH001] 启用telnet服务 [NH001] telnet server enable 配置telnet登录名和密码 [NH001] local-user admin password cipher password authorization-attribute level 3 service-type telnet [NH001]user-interface vty 0 4 authentication-mode scheme VLAN的配置 在用户模式下使用命令vlan 来添加vlan ID 可使用description命令对VLAN进行描述与命名方便今后维护与管理。 [NH001] vlan 1 description "Manager" [NH001]vlan 10 description "VLAN 10" [NH001]vlan 11 description "VLAN 11" [NH001]vlan 12 description "VLAN 12" 在三层交换机上创建了vlan后还需要给它配置IP地址既我们所说的网关。在用户模视图模式下输入interface vlan-interface1进入VLAN1的三层接口视图中。使用ip address 命令给当前VLAN配置IP地址。

[NH001]interface Vlan-interface10 ip address 172.16.10.1 255.255.255.0 [NH001]interface Vlan-interface11 ip address 172.16.11.1 255.255.255.0 端口的配置 在端口的配置中,我们一般将端口分为以下几种类型; 1、access port 普通接口,此接口一般用于连接用户的PC 2、trunk port 封装了802.1Q协议的端口,此端口一般用于交换机与交换机互连,需 要透传多个VLAN时配置。 一般情况下使用这两种类型端口即可满足网络的建设,使用interface GigabitEthernet1/0/1命令进入一个端口,port link-type 命令来定义当前接口的类型,使用port access 命令来将端口添加到相应的vlan当中。使用port link-type trunk命令来讲当前的接口定义为trunk 端口。 [NH001]interface GigabitEthernet1/0/1 port access vlan 200 [NH001] interface GigabitEthernet1/0/47 port link-type trunk port trunk permit vlan all 路由的配置 静态路由的命令ip route-static [NH001]ip route-static 0.0.0.0 0.0.0.0 192.168.254.3 安全的配置 安全设置主要是通过ACL的方式来实现; 1、创建ACL 使用acl number 命令来创建一个acl的规则,高级ACL 序号取值范围3000~3999。高级ACL 可以使用数据包的源地址信息、目的地址信息、IP 承载的协议类型、针对协议的特性,例如TCP 或UDP 的源端口、目的端口,TCP 标记,ICMP 协议的类型、code 等内

联想网御Power V系列配置案例集11(静态、默认、策略、ISP路由配置案例)

11.1 静态路由配置 配置需求:访问目的网络2.2.2.0/24,下一跳为192.168.83.108。 (1)进入到【路由管理】-【基本路由】-【静态路由表】中,新建一条静态路由表。 (2)目的地址:需要访问的目标网络 掩码:目标网络的掩码 下一跳地址:防火墙流出网口的对端设备地址 Metric:优先级,metric值越小优先级越高 网络接口:防火墙的流出接口 (3)在进入到【状态监控】-【状态信息】-【网络测试】中选择【routeshow】,开始调试。 如果静态路由生效,如下图所示。

注意事项: (1)下一跳地址一定要输入正确,这个地址不是防火墙的出口地址。 (2)下一跳地址一定可达有效的地址,可以在【状态监控】-【状态信息】-【网络测试】测试下可达性。 11.2 默认路由配置 配置需求:经过防火墙的数据包全部转发给211.211.211.210. (1)进入到【路由管理】-【基本路由】-【默认路由】中,新建一条默认路由。 (2)默认网关:211.211.211.210; 权重值:多条默认路由时使用,权重越大负载分担时流经的数据包所占比重越高

(3)在进入到【状态监控】-【状态信息】-【网络测试】中选择【routeshow】,开始调试。 如果默认路由生效,如下图所示。 注意事项: (1) 配置多条默认路由时,一定勾选【启用基于状态回包功能】,权重值越大,分担的流量越多。 (2) 默认路由生效了,在【状态监控】-【状态信息】-【网络测速】中选择【ping】下网关地址,确保可达性。 11.3 策略路由配置

配置需求:内网192.168.1.0/24网段访问8.8.8.0/24通过eth0口路由出去。 (1)进入到【路由管理】-【基本路由】-【策略路由】中,新建一条高级路由表。 命名路由表名称和路由表ID 点击新建路由表后面的操作按钮,新建路由表内容

华为三层交换机配置实例分析

华为三层交换机配置实例一例 服务器1双网卡,内网IP:192.168.0.1,其它计算机通过其代理上网 PORT1属于VLAN1 PORT2属于VLAN2 PORT3属于VLAN3 VLAN1的机器可以正常上网 配置VLAN2的计算机的网关为:192.168.1.254 配置VLAN3的计算机的网关为:192.168.2.254 即可实现VLAN间互联 如果VLAN2和VLAN3的计算机要通过服务器1上网 则需在三层交换机上配置默认路由 系统视图下:ip route-static 0.0.0.0 0.0.0.0 192.168.0.1 然后再在服务器1上配置回程路由 进入命令提示符 route add 192.168.1.0 255.255.255.0 192.168.0.254 route add 192.168.2.0 255.255.255.0 192.168.0.254 这个时候vlan2和vlan3中的计算机就可以通过服务器1访问internet了~~ 华为路由器与CISCO路由器在配置上的差别" 华为路由器与同档次的CISCO路由器在功能特性与配置界面上完全一致,有些方面还根据国内用户的需求作了很好的改进。例如中英文可切换的配置与调试界面,使中文用户再也不用面对着一大堆的英文专业单词而无从下手了。另外它的软件升级,远程配置,备份中心,PPP回拨,路由器热备份等,对用户来说均是极有用的功能特性。 在配置方面,华为路由器以前的软件版本(VRP1.0-相当于CISCO的IOS)与CISCO有细微的差别,但目前的版本(VRP1.1)已和CISCO兼容,下面首先介绍VRP软件的升级方法,然后给出配置上的说明。 一、VRP软件升级操作 升级前用户应了解自己路由器的硬件配置以及相应的引导软件bootrom的版本,因为这关系到是否可以升级以及升级的方法,否则升级失败会导致路由器不能运行。在此我们以从VRP1.0升级到VRP1.1为例说明升级的方法。 1.路由器配置电缆一端与PC机的串口一端与路由器的console口连接 2.在win95/98下建立使用直连线的超级终端,参数如下: 波特率9600,数据位8,停止位1,无效验,无流控,VT100终端类型 3.超级终端连机后打开路由器电源,屏幕上会出现引导信息,在出现: Press Ctrl-B to enter Boot Menu. 时三秒内按下Ctrl+b,会提示输入密码 Please input Bootrom password: 默认密码为空,直接回车进入引导菜单Boot Menu,在该菜单下选1,即Download application program升级VRP软件,之后屏幕提示选择下载波特率,我们一般选择38400 bps,随即出现提示信息: Download speed is 38400 bps.Please change the terminal's speed to 38400 bps,and select XMODEM protocol.Press ENTER key when ready. 此时进入超级终端“属性”,修改波特率为38400,修改后应断开超级终端的连接,再进入连接状态,以使新属性起效,之后屏幕提示: Downloading…CCC 这表示路由器已进入等待接收文件的状态,我们可以选择超级终端的文件“发送”功能,选定相应的VRP软件文件名,通讯协议选Xmodem,之后超级终端自动发送文件到路由器中,整个传送过程大约耗时8分半钟。完成后有提示信息出现,系统会将收到的VRP软件写入Flash Memory覆盖原来的系统,此时整个升级过程完成,系统提示改回超级终端的波特率: Restore the terminal's speed to 9600 bps. Press ENTER key when ready. 修改完后记住进行超级终端的断开和连接操作使新属性起效,之后路由器软件开始启动,用show ver命令将看见

实验三通过配置路由器或三层交换机实现VLAN间的通信

实验三实现VLAN间的通信 一、通过路由器实现vlan间通信(单臂路由) 实验拓扑图 【准备知识】 在路由器与交换机的端口上配置子接口,每个子接口的IP地址是每个VLAN的网关地址(也可以理解为下一跳地址),并在子接口上封装802.1Q协议。也可以封装ISL协议(cisco专用协议,不兼容802.1Q)。 【实验步骤】 1、交换机配置如下: Switch>en Switch#conf t Switch(config)#vlan 2 Switch(config-vlan)#vlan 3 Switch(config-vlan)#exit Switch(config)#int fa0/2 Switch(config-if)#sw ac vlan 2 //switchport access vlan 2的简写,端口fa0/2划到vlan 2中Switch(config-if)#int fa0/3 Switch(config-if)#sw ac vlan 3 Switch(config-if)#exit Switch(config)#int fa0/1 Switch(config-if)#switchport mode trunk //设置f0/1端口为trunk模式 2、路由器配置如下:

Router>en Router#conf t Router(config)#int fa0/0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#int f0/0.1 Router(config-subif)#encapsulation dot1q 2 //封装协议802.1Q,2为vlan 2 Router(config-subif)#ip address 192.168.1.1 255.255.255.0 Router(config-subif)#exit Router(config)#int f0/0.2 Router(config-subif)#encapsulation dot1q 3 //封装协议802.1Q,3为vlan 3 Router(config-subif)#ip address 192.168.2.1 255.255.255.0 Router(config-subif)#exit Router(config)# 【检测实验结果】 VLAN 2中的pc1能ping 通VLAN 3中的pc2。 二、通过路由器实现跨交换机vlan间通信 实验拓扑图 【实验步骤】 1、交换机BJ上的配置如下: BJ>en BJ#conf t

CISCO 策略路由(PBR)配置实例

CISCO 策略路由(PBR)配置实例 时间:2010-02-17 22:56来源:未知作者:admin 点击:142次 策略路由选择可以选择修改下一跳地址以及标记数据包来提供不通的网络服务。PBR一般用于修改基于源地址的下一跳地址。推荐实现方式:PBR给于外发IP数据包标记IP优先位,这样方便了实施QoS策略。一般来说,PBR是通过路由映射来配置的。看个详细配置实例,你 策略路由选择可以选择修改下一跳地址以及标记数据包来提供不通的网络服务。PBR一般用于修改基于源地址的下一跳地址。推荐实现方式:PBR给于外发IP数据包标记IP优先位,这样方便了实施QoS策略。一般来说,PBR是通过路由映射来配置的。 看个详细配置实例,你会更加明白: 定义了两个访问列表:10和20,经过配置使来自网络192.168.1.0/24的数据包的下一跳地址改为192.168.100.1;使来自 192.168.2.0/24的数据包的下一跳地址改为192.168.100.2.其他源始发的数据包正常路由。 命令如下: My3377(config)#access-list 10 permit 192.168.1.0 //用访问控制列表先抓取路由 My3377(config)#access-list 20 permit 192.168.2.0 My3377(config)#route-map nexthop permit 10 //起个名字 My3377(config-route-map)#match ip address 10 //匹配一个列表 My3377(config-route-map)#set ip next-hop 192.168.100.1 //设置一个策略 My3377(config-route-map)#exit My3377(config)#route-map nexthop permit 20 My3377(config-route-map)#match ip address 20 My3377(config-route-map)#set ip next-hop 192.168.100.2 My3377(config-route-map)#exit My3377(config)#route-map nexthop permit 30 My3377(config)#int s2/1

三层交换机路由配置实例

三层交换机路由配置 一、三层交换机VLAN间路由建立 某公司有两个主要部门:技术部和销售部,分处于不同的办公室,为了安全和便于管理对两个部门的主机进行了VLAN划分,技术部和销售部分处于不同VLAN。现由于业务需要销售部和技术部的主机能够相互访问,获得相应资源,两个部门的交换机通过一台三层交换机进行连接。 在交换机上建立2个Vlan:Vlan10分配给技术部及Vlan20分配给销售部。为了实现两部门的主机能够相互访问,在三层交换机上开启路由功能,并在Vlan10中设置IP地址为192.168.10.1;在Vlan20中设置IP地址为192.168.20.1,查看三层交换机路由表,会发现在三层交换机路由表内有2条直连路由信息,实现在不同网络之间路由数据包,从而达到2个部门的主机可以相互访问,拓朴图如图所示。 第1步:开启三层交换机路由功能 Switch#configure terminal Switch(config)#hostname s3550

S3550(conifg)#ip routing 第2步:建立Vlan,并分配端口 S3550(conifg)#vlan 10 S3550(config-vlan)#name sales S3550(config-vlan)#exit S3550(conifg)#vlan 20 S3550(config-vlan)#name technical S3550(config-vlan)#exit S3550(conifg)# S3550(conifg)#interface fastethernet 0/10 S3550(conifg-if)#switchport mode access S3550(conifg-if)#switchport access vlan 10 S3550(conifg-if)#exit S3550(conifg)# interface fastethernet 0/20 S3550(conifg-if)#switchport mode access S3550(conifg-if)#switchport access vlan 20 S3550(config-vlan)#exit S3550(config)# 第3步:配置三层交换机端口的路由功能 S3550(config)#interface vlan 10 S3550(conifg-if)#ip address 192.168.10.1 255.255.255.0 S3550(conifg-if)#no shutdown

H3C交换机策略路由技术及其应用

H3C交换机策略路由技术及其应用 1 概述 Internet的高速发展,为用户提供了更多的接入方式的选择,例如现在的高校一般都可以用教育网和电信网两种方式接入internet。为了能够让不同的用户通过不同的方式访问internet资源,用户对三层交换机的路由功能提出了更高的要求。H3C公司的策略路由技术是一种通过识别不同的网络数据包从而按照预先设定好的策略进行转发的技术,它可以对网络数据包按不同的关键字段进行识别分类,以决定其转发策略。策略路由技术可以有效的控制网络用户数据包的流向和行为。 策略路由位于IP层,在做IP转发前,如果报文命中某个策略路由对应的规则,则要进行相应的策略路由的动作,动作包括重定向到指定下一跳,以及remark 标记(如TOS、IP优先级或DSCP),然后根据重定向的下一跳代替报文的目的IP 去查FIB表,做IP转发。 图1 策略路由在系统中的位置 2 术语 NEXTHOP 重定向下一跳:策略路由处理过程中,代替报文的目的ip来查找路由表以得到真正下一跳的一个ip地址。 ACL(Access Control List) 访问控制列表:包含一系列的规则。这些规则可以用来匹配报文以决定对报文做相应的策略路由动作。 FIB (Forwarding Information Base) 转发信息表:FIB是三层转发的核心数据,用于指导IP报文的转发。 PBR (Policy Based Routing)

策略路由:根据事先预定义的策略对报文进行路由转发。 TOS (Type of Service) 服务类型:在IP报文头中的标志,用来进行流量控制。 NP (Network Processor) 网络处理器:一种用于数据报文处理的可编程、高性能网络专用处理器。 3 策略路由功能特性 PBR使用关键字对数据包进行分类从而采用不同策略对数据包进行转发,所使用的关键字为数据包本身或相关的一些特征项: 源IP地址 目的IP地址 源端口号 目的端口号 IP协议类型 PBR能够根据这些关键字进行数据包分类,不同的类别使用不同的策略路由。策略路由是基于数据包的关键特征字的,可以按关键特征字进行任意组合,使策略路由的控制更为灵活。 3.1 入接口绑定策略路由 入接口是指内网侧的接口,通过在内网侧的VLAN接口上绑定策略路由配置可以把内网中进入该VLAN接口的所有报文按照一定的规则分类,并按照不同的策略进行路由转发。一个内网接口一般都对应了一个子网。一般对一个子网的路由转发策略是相同的,所以这种方式可以简化ACL规则的复杂度。通常情况下,由于芯片的限制,入接口上配置规则的数量是受限制的。 3.2 出接口绑定策略路由 出接口是指公网一侧的接口,一般连接到更大的局域网或者internet。通过 在公网侧的VLAN接口上绑定策略路由配置可以把内网中从该接口出去的所有报文按照一定的规则分类,并按照不同的策略进行路由转发。出接口策略路由配置通常不受芯片的限制,规则数量可以达到3000条。 3.3 重定向到下一跳以及Remark标记 重定向的下一跳可以是直连的设备也可以是网络中的路由可达的非直连设备。重定向的下一跳可以同时配置多个,系统按照优先级在不同的下一跳之间切换,先配置的下一跳具有较高的优先级。当高优先级的下一跳可达时,一定是重定向到高优先级的下一跳。Remark可以改变报文的TOS、IP优先级字段或DSCP 字段。 3.4 同时作策略路由和NAT 当策略路由下一跳的出口绑定了NAT时,转发的报文在重定向以后同时会 进行NAT转换,即报文源IP转换成地址池IP,然后再进行三层转发。 4 典型组网 例如,对于校园网来说,一般都有两个网络出口,如教育网出口和电信网出

H3C策略路由配置及实例

H3C策略路由配置及实例 2010-07-19 09:21 基于策略路由负载分担应用指导介绍 特性简介 目前网吧对网络的可靠性和稳定性要求越来越高,一般网吧与运营商都有两条线路保证一条线路出现故障时能够有另一条链路作为备份。当两条线路都正常时为了减少一条线路流量压力,将流量平均分配到另外一条线路,这样提高了网络速度。当一条链路出现故障接口DOWN掉时,系统自动将流量全部转到另一条线路转发,这样提高了网络的稳定性、可靠性。满足网吧对业务要求不能中断这种需求,确保承载的业务不受影响。 使用指南 使用场合 本特性可以用在双链路的组网环境内,两条链路分担流量。保证了网络的可靠性、稳定性。 配置指南 本指南以18-22-8产品为例,此产品有2个WAN接口。ethernet2/0、ethernet3/0互为备份。 可以通过以下几个配置步骤实现本特性: 1) 配置2个WAN接口是以太链路,本案例中以以太网直连连接方式为例; 2) 配置静态路由,并设置相同的优先级; 3) 配置策略路由将流量平均分配到2条链路上。 2 注意事项 两条路由的优先级相同。 配置策略路由地址为偶数走wan1,地址为奇数走wan2。 策略路由的优先级高于路由表中的优先级。只有策略路由所使用的接口出现down后,路由比表中配置的路由才起作用。 3 配置举例 组网需求 图1为2条链路负载分担的典型组网。 路由器以太网口ETH2/0连接到ISP1,网络地址为142.1.1.0/30,以太网口ETH3/0连接到ISP2,网络地址为162.1.1.0/30;以太网口ETH1/0连接到网吧局域网,私网IP网络地址为192.168.1.0/24。

cisco三层交换机vlan间路由配置实例

cisco三层交换机vlan间路由配置实例 下面以cisco3560实例说明如何在一个典型的快速以太局域网中实现VLAN。所谓典型局域网就是指由一台具备三层交换功能的核心交换机接几台分支交换机(不一定具备三层交换能力)。我们假设核心交换机名称为:COM;分支交换机分别为:PAR1、PAR2、PAR3,分别通过Port 1的光线模块与核心交换机相连;并且假设VLAN名称分别为COUNTER、MARKET、MANAGING…… 需要做的工作: 1、设置VTP DOMAIN(核心、分支交换机上都设置) 2、配置中继(核心、分支交换机上都设置) 3、创建VLAN(在server上设置) 4、将交换机端口划入VLAN 5、配置三层交换 1、设置VTP DOMAIN。 VTP DOMAIN 称为管理域。 交换VTP更新信息的所有交换机必须配置为相同的管理域。如果所有的交换机都以中继线相连,那么只要在核心交换机上设置一个管理域,网络上所有的交换机都加入该域,这样管理域里所有的交换机就能够了解彼此的VLAN列表。 COM#vlan database 进入VLAN配置模式 COM(vlan)#vtp domain COM 设置VTP管理域名称 COM COM(vlan)#vtp server 设置交换机为服务器模式 PAR1#vlan database 进入VLAN配置模式 PAR1(vlan)#vtp domain COM 设置VTP管理域名称COM PAR1(vlan)#vtp Client 设置交换机为客户端模式 PAR2#vlan database 进入VLAN配置模式 PAR2(vlan)#vtp domain COM 设置VTP管理域名称COM PAR2(vlan)#vtp Client 设置交换机为客户端模式 PAR3#vlan database 进入VLAN配置模式 PAR3(vlan)#vtp domain COM 设置VTP管理域名称COM PAR3(vlan)#vtp Client 设置交换机为客户端模式 注意:这里设置核心交换机为Server模式是指允许在该交换机上创建、修改、删除VLAN 及其他一些对整个VTP域的配置参数,同步本VTP域中其他交换机传递来的最新的VLAN 信息;Client模式是指本交换机不能创建、删除、修改VLAN配置,也不能在NVRAM中存储VLAN配置,但可同步由本 VTP域中其他交换机传递来的VLAN信息。 2、配置中继为了保证管理域能够覆盖所有的分支交换机,必须配置中继。Cisco交换机能够支持任何介质作为中继线,为了实现中继可使用其特有的ISL标签。ISL (Inter-Switch Link)是一个在交换机之间、交换机与路由器之间及交换机与服务器之间传递多个VLAN信息及VLAN数据流的协议,通过在交换机直接相连的端口配置 ISL封装,即可跨越交换机进行整个网络的VLAN分配和进行配置。 在核心交换机端配置如下: COM(config)#interface gigabitEthernet 2/1 COM(config-if)#switchport COM(config-if)#switchport trunk encapsulation isl 配置中继协议 COM(config-if)#switchport mode trunk COM(config)#interface gigabitEthernet 2/2 COM(config-if)#switchport COM(config-if)#switchport trunk encapsulation isl 配置中继协议 COM(config-if)#switchport mode trunk COM(config)#interface gigabitEthernet 2/3 COM(config-if)#switchport COM(config-if)#switchport trunk encapsulation isl 配置中继协议 COM(config-if)#switchport mode trunk 在分支交换机端配置如下: PAR1(config)#interface gigabitEthernet 0/1

网络设备模拟器PT教程-交换机路由基础

网络设备模拟器Packet Tracer教程第一章认识Packet Tracer软件 (1) 第二章交换机的基本配置与管理 (2) 第三章交换机的端口配置与管理 (3) 第四章交换机的Telnet远程登陆配置 (5) 第五章交换机的端口聚合配置 (7) 第六章交换机划分Vlan配置 (9) 第七章三层交换机基本配置 (12) 第八章利用三层交换机实现VLAN间路由 (13) 第九章快速生成树配置 (16) 第十章路由器的基本配置 (19) 第十一章路由器单臂路由配置 (21) 第一章认识Packet Tracer软件 Packet Tracher介绍 ●Packet Tracer是Cisco公司针对CCNA认证开发的一个用来设计、配置和故障排 除网络的模拟软件。 ●Packer Tracer模拟器软件比Boson功能强大,比Dynamips操作简单,非常适合 网络设备初学者使用。 学习任务 1、安装Packer Tracer; 2、利用一台型号为2960的交换机将2pc机互连组建一个小型局域网; 3、分别设置pc机的ip地址; 4、验证pc机间可以互通。 实验设备 Switch_2960 1台;PC 2台;直连线 PC1 IP:192.168.1.2 Submask:255.255.255.0 Gateway:192.168.1.1

PC2 IP:192.168.1.3 Submask:255.255.255.0 Gateway:192.168.1.1 PC1 ping PC2 Reply PC2 ping PC1 Reply PC2 ping Gateway Timeout 第二章交换机的基本配置与管理 实验目标 ●掌握交换机基本信息的配置管理。 实验背景 ●某公司新进一批交换机,在投入网络以后要进行初始配置与管理,你作为网络管理 员,对交换机进行基本的配置与管理。 技术原理 ●交换机的管理方式基本分为两种:带内管理和带外管理。 ●通过交换机的Console端口管理交换机属于带外管理;这种管理方式不占用交 换机的网络端口,第一次配置交换机必须利用Console端口进行配置。 ●通过Telnet、拨号等方式属于带内管理。 ●交换机的命令行操作模式主要包括: ●用户模式Switch> ●特权模式Switch# ●全局配置模式Switch(config)# ●端口模式Switch(config-if)# 实验步骤: ●新建Packet Tracer拓扑图 ●了解交换机命令行 ●进入特权模式(en) ●进入全局配置模式(conf t) ●进入交换机端口视图模式(int f0/1) ●返回到上级模式(exit) ●从全局以下模式返回到特权模式(end) ●帮助信息(如? 、co?、copy?) ●命令简写(如 conf t) ●命令自动补全(Tab) ●快捷键(ctrl+c中断测试,ctrl+z退回到特权视图) ●Reload重启。(在特权模式下) ●修改交换机名称(hostname X) 实验设备 Switch_2960 1台;PC 1台;配置线;

配置策略路由命令 锐捷

33.1配置相关命令 33.1.1ip policy route-map 要在一个接口启用策略路由,请使用接口配置命令ip policy route-map。 该命令的no形式关闭策略路由的应用。 ip policy route-map route-map no ip policy route-map 【参数说明】 【缺省情况】 缺省关闭策略路由。 【命令模式】 接口配置模式。 【使用指南】 策略路由必须在指定的接口上应用,该接口只对接收到的数据包进行策略 路由,该接口发送的数据包路由将正常按照路由表进行转发。 应用策略路由,必须要指定策略路由使用的路由图,并且要创建路由图。 一个路由图由很多条策略组成,每个策略都定义了1个或多个的匹配规 则和对应操作。一个接口应用策略路由后,将对该接口接收到的所有包进 行检查,不符合路由图任何策略的数据包将按照通常的路由转发进行处理, 符合路由图中某个策略的数据包就按照该策略中定义的操作进行处理。 注意: 我司产品一个接口最多只能配置一个路由图,在同一个接口上多次配置路 由图,后的路由图会覆盖先前配置的路由图。 【举例】

以下的配置例子中,当快速以太网接口FE0接收到数据报,如果数据报 源地址为10.0.0.1,则设置下一跳为196.168.4.6,如果源地址为20.0.0.1 则设置下一跳为196.168.5.6,否则进行普通转发。 access-list 1 permit 10.0.0.1 access-list 2 permit 20.0.0.1 route-map lab1 permit 10 match ip address 1 set ip next-hop 196.168.4.6 exit route-map lab1 permit 20 match ip address 2 set ip next-hop 196.168.5.6 exit interface GigabitEthernet 0/0 ip policy route-map lab1 exit 【相关命令】 注:route-map配置的相关命令请参考《协议无关命令参考》 ip local policy route-map 要对本地发送的报文启用策略路由,请使用命令ip local policy route-map。该命令的no形式关闭策略路由的应用。 ip local policy route-map route-map no ip local policy route-map

华为策略路由配置实例

华为策略路由配置实例 1、组网需求 ?????????????????图1?策略路由组网示例图 ????公司希望上送外部网络的报文中,IP优先级为4、5、6、7的报文通过高速链路传输,而IP优先级为0、1、2、3的报文则通过低速链路传输。 2、配置思路 1、创建VLAN并配置各接口,实现公司和外部网络设备互连。 2、配置ACL规则,分别匹配IP优先级4、5、6、7,以及IP优先级0、1、2、3。 3、配置流分类,匹配规则为上述ACL规则,使设备可以对报文进行区分。 5、配置流策略,绑定上述流分类和流行为,并应用到接口GE2/0/1的入方向上,实现策略路由。 3、操作步骤 3.1、创建VLAN并配置各接口 #?在Switch上创建VLAN100和VLAN200。 ?system-view [HUAWEI]?sysnameSwitch [Switch]?vlanbatch100200 #?配置Switch上接口GE1/0/1、GE1/0/2和GE2/0/1的接口类型为Trunk,并加入VLAN100和VLAN200。 [Switch]?interfacegigabitethernet1/0/1 [Switch-GigabitEthernet1/0/1]?portlink-typetrunk [Switch-GigabitEthernet1/0/1]?porttrunkallow-passvlan100200 [Switch-GigabitEthernet1/0/1]?quit

[Switch]?interfacegigabitethernet1/0/2 [Switch-GigabitEthernet1/0/2]?portlink-typetrunk [Switch-GigabitEthernet1/0/2]?porttrunkallow-passvlan100200 [Switch-GigabitEthernet1/0/2]?quit [Switch]?interfacegigabitethernet2/0/1 [Switch-GigabitEthernet2/0/1]?portlink-typetrunk [Switch-GigabitEthernet2/0/1]?porttrunkallow-passvlan100200 [Switch-GigabitEthernet2/0/1]?quit 配置LSW与Switch对接的接口为Trunk类型接口,并加入VLAN100和VLAN200。#?创建VLANIF100和VLANIF200,并配置各虚拟接口IP地址。 [Switch]?interfacevlanif100 [Switch-Vlanif100]?ipaddress24 [Switch-Vlanif100]?quit [Switch]?interfacevlanif200 [Switch-Vlanif200]?ipaddress24 [Switch-Vlanif200]?quit 3.2、配置ACL规则 #?在Switch上创建编码为3001、3002的高级ACL,规则分别为允许IP优先级0、1、2、3和允许IP优先级4、5、6、7的报文通过。 [Switch]?acl3001 [Switch-acl-adv-3001]?rulepermitipprecedence0 [Switch-acl-adv-3001]?rulepermitipprecedence1 [Switch-acl-adv-3001]?rulepermitipprecedence2

三层交换机配置ACL(访问控制列表)

三层交换机配置ACL(访问控制列表) 说明:书本上讲述的ACL主要是应用在路由器上,但现在三层交换机在大中型企业中的应用越来越广泛,三层交换机因拥有路由器的功能而逐渐代替路由器。ACL 访问控制列表是构建安全规范的网络不可缺少的,但在三层交换机上配置ACL 却不为一些刚进企业的初级网络管理维护人员所知。在这里我介绍一下在三层交换机上配置ACL的试验过程。 试验拓扑介绍: 三层交换机上配置本地Vlan 实现下层接入层交换机不同Vlan互通。 PC1 VLAN VLAN VLAN VLAN (开启路由功能)路由器上配置 F0/0 PC5 试验步骤: 1、在二层交换机上把相应的PC加入VLAN 查看交换机Switch0 Switch0(config)#show run ! interface FastEthernet0/1 switchport access vlan 2 ! interface FastEthernet0/2 switchport access vlan 3 !

查看交换机Switch1 Switch1#show run ! interface FastEthernet0/3 switchport access vlan 4 ! interface FastEthernet0/4 switchport access vlan 5 ! 2、在三层交换机上配置相应的本地VALN Switch(config)#inter vl 2 Switch(config-if)#ip add shut Switch(config)#inter vl 3 Switch(config-if)#ip add shut Switch(config)#inter vl 4 Switch(config-if)#ip add shut Switch(config)#inter vl 5 Switch(config-if)#ip add shut Switch(config-if)#exi 在接口itnerface f0/1上开启路由接口 Switch(config)#inter f0/1 Switch(config-if)#no switchport 3、在二层交换机和三层交换机之间开启中继链路 4、在路由器和三层交换机上配置动态路由协议RIP Router(config)#router rip Router(config)#network (config)# network 三层交换机上配置Switch(config)#router rip Switch(config-router)#ne Switch(config-router)#network 、验证各PC互通 PC>ping with 32 bytes of data: Request timed out. Reply from bytes=32 time=110ms TTL=126 Reply from bytes=32 time=110ms TTL=126 Reply from bytes=32 time=125ms TTL=126 Ping statistics for Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), Approximate round trip times in milli-seconds: Minimum = 110ms, Maximum = 125ms, Average = 115ms PC>ping with 32 bytes of data: Reply from bytes=32 time=94ms TTL=126 Reply from bytes=32 time=125ms TTL=126 Reply from bytes=32 time=125ms TTL=126 Reply from bytes=32 time=109ms TTL=126 Ping statistics for Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 94ms, Maximum = 125ms, Average = 113ms 6、在三层交换机上配置ACL

相关主题