配置路由器

设备自动协商 WCCP-GRE 或 WCCP-L2。主要选择是 单播操作 (其中设备配置了每个路由器的 IP 地址)或 多播操作 (其中设备和路由器都配置了多播地址)。

正常(单播)操作— 对于正常操作,过程是声明 WCCP 版本 2 和路由器的 WCCP 组 ID 作为一个整体,然后在每个 WAN 接口上启用重定向。以下是思科 IOS 示例:

``` pre codeblock config term ip wccp version 2 ! We will configure the appliance to use group 51 for TCP and 52 for UDP. ip wccp 51 ip wccp 52

! Repeat the following three lines for each WAN interface ! you wish to accelerate: interface your_wan_interface ! If Reverse Path Forwarding is enabled (with an ip verify unicast ! source reachable” statement), delete or comment out the statement: ! ip verify unicast source reachable-via any ! Repeat on all ports.

ip wccp 51 redirect out ip wccp 51 redirect in ip wccp 52 redirect out ip wccp 52 redirect in

! If the appliance is inline with one of the router interfaces ! (NOT SUPPORTED), add the following line for that interface ! to prevent loops: ip wccp redirect exclude in ^Z


如果多个路由器要使用同一个设备,则每个路由器的配置如上所示,使用相同的服务组或不同的服务组。

**多播操作**— 为设备和每个路由器提供多播地址时,配置与正常操作略有不同。以下是思科 IOS 示例:

``` pre codeblock
config term
ip wccp version 2
ip wccp 51 group-address 225.0.0.1

! Repeat the following three lines for each WAN interface
! you wish to accelerate:
interface your_wan_interface
! If Reverse Path Forwarding is enabled (with an ip verify unicast
! source reachable” statement), delete or comment out the statement:
! ip verify unicast source reachable-via any

ip wccp 51 redirect out
ip wccp 51 redirect in
!
! The following line is needed only on the interface facing the other router,
! if there is another router participating in this service group.
ip wccp 51 group-listen

!If the appliance is inline with one of the router interfaces,
!(which is supported but not recommended), add
!the following line for that interface to prevent loops:
ip wccp redirect exclude in
^Z

配置路由器