Services
A FortiGate unit configured as a WCCP server or client can include multiple server or client configurations. Each of these configurations is called a WCCP service group. A service group consists of one or more WCCP servers (or routers) and one or more WCCP clients working together to cache a specific type of traffic. The service group configuration includes information about the type of traffic to be cached, the addresses of the WCCP clients and servers and other information about the service.
A service group is identified with a numeric WCCP service ID (or service number) in the range 0 to 255. All of the servers and clients in the same WCCP service group must have service group configurations with the same WCCP service ID.
The value of the service ID provides some information about the type of traffic to be cached by the service group. Service IDs in the range 0 to 50 are reserved for well known services. A well known service is any service that is defined by the WCCP standard as being well known. Since the service is well known, just the service ID is required to identify the traffic to be cached.
Even though the well known service ID range is 0 to 50, at this time only one well known service has been defined. Its service ID 0, which is used for caching HTTP (web) traffic.
So to configure WCCP to cache HTTP sessions you can add a service group to the WCCP router and WCCP clients with a service ID of 0. No other information about the type of traffic to cache needs to be added to the service group.
Since service IDs 1 to 50 are reserved for well know services and since these services are not defined yet, you should not add service groups with IDs in the range 1 to 50.
FortiOS does allow you to add service groups with IDs between 1 and 50. Since these service groups have not been assigned well known services, however, they will not cache any sessions. Service groups with IDs 51 to 255 allow you to set the port numbers and protocol number of the traffic to be cached. So you can use service groups with IDs 51 to 255 to cache different kinds of traffic based on port numbers and protocol number of the traffic. Service groups 1 to 50; however, do not allow you to set port numbers or protocol numbers so cannot be used to cache any traffic. |
To cache traffic other than HTTP traffic you must add service groups with IDs in the range 51 to 255. These service group configurations must include the port numbers and protocol number of the traffic to be cached. It is the port and protocol number configuration in the service group that determines what traffic will be cached by WCCP.
Example WCCP server and client configuration for caching HTTP sessions (service ID = 0)
Enter the following command to add a WCCP service group to a WCCP server that caches HTTP sessions. The IP address of the server is 10.31.101.100 and the WCCP clients are on the 10.31.101.0 subnet. The service
ID of this service group is 0.
config system wccp
edit 0
set router-id 10.31.101.100
set server-list 10.31.101.0 255.255.255.0
end
Enter the following commands to configure a FortiGate unit to operate as a WCCP client and add a service group that configures the client to cache HTTP sessions. The IP address of the server is 10.31.101.100 and IP address of this WCCP clients is 10.31.101.1 subnet. The service ID of this service group is 0.
config system settings
set wccp-cache-engine enable
end
config system wccp
edit 0
set cache-id 10.31.101.1
set router-list 10.31.101.100
end
You cannot enter the wccp-cache-engine enable command if you have already added a WCCP service group. When you enter this command an interface named w.<vdom_name> is added to the FortiGate configuration (for example w.root). All traffic redirected from a WCCP router is considered to be received at this interface of the FortiGate unit operating as a WCCP client. A default route to this interface with lowest priority is added. |
Example WCCP server and client configuration for caching HTTPS sessions
Enter the following command to add a service group to a WCCP server that caches HTTPS content on port 443 and protocol 6. The IP address of the server is 10.31.101.100 and the WCCP clients are on the 10.31.101.0 subnet. The service ID of this service group is 80.
config system settings
set wccp-cache-engine enable
end
config system wccp
edit 80
set router-id 10.31.101.100
set server-list 10.31.101.0 255.255.255.0
set ports 443
set protocol 6
end
Enter the following commands to configure a FortiGate unit to operate as a WCCP client and add a service group that configures client to cache HTTPS sessions on port 443 and protocol 6. The IP address of the server is 10.31.101.100 and IP address of this WCCP clients is 10.31.101.1 subnet. The service ID of this service group must be 80 to match the service ID added to the server.
config system settings
set wccp-cache-engine enable
end
config system wccp
edit 80
set cache-id 10.31.101.1
set router-list 10.31.101.100
set ports 443
set protocol 6
end
Example WCCP server and client configuration for caching HTTP and HTTPS sessions
You could do this by configuring two WCCP service groups as described in the previous examples. Or you could use the following commands to configure one service group for both types of traffic. The example also caches HTTP sessions on port 8080.
Enter the following command to add a service group to a WCCP server that caches HTTP sessions on ports 80 and 8080 and HTTPS sessions on port 443. Both of these protocols use protocol number 6. The IP address of the server is 10.31.101.100 and the WCCP clients are on the 10.31.101.0 subnet. The service ID of this service group is 90.
config system wccp
edit 90
set router-id 10.31.101.100
set server-list 10.31.101.0 255.255.255.0
set ports 443 80 8080
set protocol 6
end
Enter the following commands to configure a FortiGate unit to operate as a WCCP client and add a service group that configures client to cache HTTP sessions on port 80 and 8080 and HTTPS sessions on port 443. The IP address of the server is 10.31.101.100 and IP address of this WCCP clients is 10.31.101.1 subnet. The service ID of this service group must be 90 to match the service ID added to the server.
config system settings
set wccp-cache-engine enable
end
config system wccp
edit 90
set cache-id 10.31.101.1
set router-list 10.31.101.100
set ports 443 80 8080
set protocol 6
end
Other WCCP service group options
In addition to using WCCP service groups to define the types of traffic to be cached by WCCP the following options are available for servers and clients.
Server configuration options
The server configuration must include the router-id
, which is the WCCP server IP address. This is the IP address of the interface that the server uses to communicate with WCCP clients.
The group-address
is used for multicast WCCP configurations to specify the multicast addresses of the clients.
The server-list
defines the IP addresses of the WCCP clients that the server can connect to. Often the server list can be the address of the subnet that contains the WCCP clients.
The authentication
option enables or disables authentication for the WCCP service group. Authentication must be enabled on all servers and clients in a service group and members of the group must have the same password
.
The forward-method
option specifies the protocol used for communication between the server and clients. The default forwarding method is GRE encapsulation. If required by your network you can also select to use unencapsulated layer-2 packets instead of GRE or select any to allow both. The return-method
allows you to specify the communication method from the client to the server. Both GRE and layer-2 are supported.
The assignment-method
determines how the server load balances sessions to the clients if there are multiple clients. Load balancing can be done using hashing or masking.
Client configuration options
The client configuration includes the cache-id
which is the IP address of the FortiGate interface of the client that communicates with WCCP server. The router-list
option is the list of IP addresses of the WCCP servers in the WCCP service group.
The ports
option lists the port numbers of the sessions to be cached by the client and the protocol
sets the protocol number of the sessions to be cached. For TCP sessions the protocol is 6.
The service-type
option can be auto, dynamic or standard. Usually you would not change this setting.
The client configuration also includes options to influence load balancing including the primary-hash
, priority
, assignment-weight
and assignment‑bucket‑format
.