Online Book Reader

Home Category

Squid_ The Definitive Guide - Duane Wessels [76]

By Root 1917 0

The configuration in the following example comes from a ServerIron XL, running software version 07.0.07T12. As before, clients are on port 1, the Internet link is on port 2, and Squid is on port 3. However, that matters less for this particular configuration because you can enable HTTP interception globally. Foundry's name for interception caching is Transparent Cache Switching (TCS). Refer back to Figure 9-4 for this example.

The first step is to give the switch an IP address so it can perform health checks:

ip address 172.16.102.1 255.255.255.0

Foundry allows you to enable or disable TCS on particular ports. However, for the sake of simplicity, let's enable it globally:

ip policy 1 cache tcp http global

In this line, cache is a keyword that corresponds to the TCS feature. The next line defines a web cache. I've given it the name squid1 and told the switch its IP address:

server cache-name squid1 172.16.102.66

The final step is to add the web cache to a cache group:

server cache-group 1

cache-name squid1

If you're having problems getting the Foundry switch to divert connections, have a look at the show cache-group output:

ServerIron#show cache-group

Cache-group 1 has 1 members Admin-status = Enabled Active = 0

Hash_info: Dest_mask = 255.255.255.0 Src_mask = 0.0.0.0

Cache Server Name Admin-status Hash-distribution

squid1 6 3

HTTP Traffic From <-> to Web-Caches

Name: squid1 IP: 172.16.102.66 State: 6 Groups = 1

Host->Web-cache Web-cache->Host

State CurConn TotConn Packets Octets Packets Octets

Client active 441 12390 188871 15976623 156962 154750098

Web-Server active 193 11664 150722 151828731 175796 15853612

Total 634 24054 339593 167805354 332758 170603710

Some of this output is cryptic, but you can tell interception is working by repeating the command and watching the counters increase.

The show server real command provides almost the same information:

ServerIron#show server real squid1

Real Servers Info

Name : squid1 Mac-addr: 00c0.4f23.d705

IP:172.16.102.66 Range:1 State:Active Wt:1 Max-conn:1000000

Src-nat (cfg:op):(off:off) Dest-nat (cfg:op):(off:off)

squid1 is a TRANSPARENT CACHE in groups 1

Remote server : No Dynamic : No Server-resets:0

Mem:server: 02009eae Mem:mac: 045a3714

Port State Ms CurConn TotConn Rx-pkts Tx-pkts Rx-octet Tx-octet Reas

---- ----- -- ------- ------- ------- ------- -------- -------- ----

http active 0 855 29557 379793 471713 373508204 39425322 0

default active 0 627 28335 425106 366016 38408994 368496301 0

Server Total 1482 57892 804899 837729 411917198 407921623 0

Finally, you can use the show logging command to see if the switch believes Squid is up or down:

ServerIron#show logging

...

00d00h11m51s:N:L4 server 172.16.102.66 squid1 port 80 is up

00d00h11m49s:N:L4 server 172.16.102.66 squid1 port 80 is down

00d00h10m21s:N:L4 server 172.16.102.66 squid1 port 80 is up

00d00h10m21s:N:L4 server 172.16.102.66 squid1 is up

Note that the ServerIron thinks the server is running on port 80. As you'll see later, my examples have Squid running on port 3128. The packet filtering rules actually change the packet's destination port from 80 to 3128. This has some interesting consequences for health checks, which I address later in Section 9.3.2.5.

Extreme Networks

In this example, the hardware is a Summit1i, and the software is Version 6.1.3b11. Once again, the clients are on port 1, the Internet link is on port 2, and Squid is on port 3. The network configuration is shown in Figure 9-5.

Figure 9-5. Sample network for intercepting with a router, for the Extreme and Cisco policy routing examples

The Extreme switch can intercept HTTP connections only for packets that it routes between subnets. In other words, if you use the Extreme switch in layer two mode (with a single VLAN), you can't divert traffic to Squid. To make HTTP interception work, you must configure separate VLANs for users, Squid, and the Internet:

configure Default delete port 1-8

create vlan Users

configure Users ip 172.16.102.1 255.255.255.192

configure Users add port

Return Main Page Previous Page Next Page

®Online Book Reader