Задача стоит следующим образом:
К киске 881 необходимо подвязать кальмара с использованием протокола WCCPv2.
Конфигурация киски:
Код: Выделить всё
ip wccp web-cache redirect-list wccp
no ipv6 cef
interface FastEthernet0
switchport access vlan 10
no ip address
!
interface FastEthernet1
switchport access vlan 11
no ip address
!
interface FastEthernet2
no ip address
!
interface FastEthernet3
no ip address
!
interface FastEthernet4
ip address хх.ххх.ххх.ххх 255.255.255.248
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
interface Vlan1
!
interface Vlan10
ip address 192.168.0.254 255.255.255.0
ip wccp web-cache redirect in
ip nat inside
ip virtual-reassembly in
!
interface Vlan11
ip address 192.168.253.1 255.255.255.0
ip wccp web-cache redirect in
ip nat inside
ip virtual-reassembly in
ip nat inside source list NAT interface FastEthernet4 overload
ip route 0.0.0.0 0.0.0.0 хх.ххх.ххх.ххх
ip access-list extended NAT
permit ip 192.168.0.0 0.0.0.255 any
permit ip 192.168.253.0 0.0.0.255 any
ip access-list extended wccp
permit ip 192.168.0.0 0.0.0.255 any
permit tcp 192.168.0.0 0.0.0.255 any eq www
permit tcp 192.168.253.0 0.0.0.255 any eq www

Код: Выделить всё
acl localhost src 127.0.0.1/32
acl localnet src 192.168.0.0/24
acl wccp_net src 192.168.253.0/24
http_access allow all
http_access allow localnet
http_access allow localhost
http_access allow wccp_net
http_port 3128 transparent
wccp2_router 192.168.253.1
wccp_version 2
wccp2_rebuild_wait on
wccp2_forwarding_method 1
wccp2_return_method 1
wccp2_service standard 0
wccp2_service dynamic 80
wccp2_service dynamic 90
hierarchy_stoplist cgi-bin ?
coredump_dir /usr/local/squid/var/cache
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
Код: Выделить всё
iptunnel add gre1 mode gre remote 94.153.146.198 local 192.168.253.2 dev eth1
ifconfig gre1 192.168.253.3 up
Код: Выделить всё
iptables -t nat -A PREROUTING -i gre1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128-3128
Вывод роутера:
Код: Выделить всё
br4#show ip wccp web-cache detail
WCCP Client information:
WCCP Client ID: 192.168.253.2
Protocol Version: 2.00
State: Usable
Redirection: GRE
Packet Return: GRE
Assignment: HASH
Connect Time: 00:49:36
Redirected Packets:
Process: 0
CEF: 447
GRE Bypassed Packets:
Process: 0
CEF: 0
Hash Allotment: 256 of 256 (100.00%)
Initial Hash Info: 00000000000000000000000000000000
00000000000000000000000000000000
Assigned Hash Info: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Код: Выделить всё
show wccp
IPv4 Global WCCP information:
Router information:
Router Identifier: 192.168.253.1
Service Identifier: web-cache
Protocol Version: 2.00
Number of Service Group Clients: 1
Number of Service Group Routers: 1
Total Packets Redirected: 2502
Process: 0
CEF: 2502
Service mode: Open
Service Access-list: -none-
Total Packets Dropped Closed: 0
Redirect access-list: wccp
Total Packets Denied Redirect: 0
Total Packets Unassigned: 147
Group access-list: -none-
Total Messages Denied to Group: 0
Total Authentication failures: 0
Total GRE Bypassed Packets Received: 0
Process: 0
CEF: 0
GRE tunnel interface: Tunnel0
Код: Выделить всё
2013/10/03 10:00:40| Reconfiguring Squid Cache (version 3.1.20)...
2013/10/03 10:00:40| FD 14 Closing HTTP connection
2013/10/03 10:00:40| FD 15 Closing WCCPv2 socket
2013/10/03 10:00:40| Processing Configuration File: /etc/squid3/squid.conf (depth 0)
2013/10/03 10:00:40| Starting Authentication on port [::]:3128
2013/10/03 10:00:40| Disabling Authentication on port [::]:3128 (interception enabled)
2013/10/03 10:00:40| Disabling IPv6 on port [::]:3128 (interception enabled)
2013/10/03 10:00:40| Squid plugin modules loaded: 0
2013/10/03 10:00:40| Adaptation support is off.
2013/10/03 10:00:40| Store logging disabled
2013/10/03 10:00:40| DNS Socket created at [::], FD 8
2013/10/03 10:00:40| DNS Socket created at 0.0.0.0, FD 9
2013/10/03 10:00:40| Adding domain from /etc/resolv.conf
2013/10/03 10:00:40| Adding domain from /etc/resolv.conf
2013/10/03 10:00:40| Adding nameserver 192.168.0.23 from /etc/resolv.conf
2013/10/03 10:00:40| Adding nameserver 192.168.0.6 from /etc/resolv.conf
2013/10/03 10:00:40| Accepting intercepted HTTP connections at 0.0.0.0:3128, FD 11.
2013/10/03 10:00:40| HTCP Disabled.
2013/10/03 10:00:40| Accepting WCCPv2 messages on port 2048, FD 12.
2013/10/03 10:00:40| Initialising all WCCPv2 lists
2013/10/03 10:00:40| Loaded Icons.
2013/10/03 10:00:40| Ready to serve requests.
2013/10/03 10:00:41| Unknown capability type in WCCPv2 Packet (4).
2013/10/03 10:00:41| Unknown capability type in WCCPv2 Packet (5).
2013/10/03 10:00:51| Unknown capability type in WCCPv2 Packet (4).
2013/10/03 10:00:51| Unknown capability type in WCCPv2 Packet (5).
