Search squid archive

ISP-style Transparent Proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,

We're working to attempt to get a completely transparent proxy up and running. By completely transparent I mean:

1) The web server should see the clients' actual IP (not the proxy)
2) The client should see the response coming back from the IP of the web server.

We're trying to implement this with WCCPv2 Interception on a 7204vxr/NPE-G1 with IOS 12.3.15a.

The configuration guide has been explicitly followed at:
  http://wiki.squid-cache.org/Features/Tproxy4

The machine is running CentOS 6. I've tried with the stock kernel, and with 3.6.5 installed from elrepo.org. selinux is disabled. Using the non-tproxy port in squid by explicitly configuring the proxy, successfully proxies & caches traffic (proxy server ip reported by web server).

Squid version is 3.1.10-9.el6_3 from CentOS6 repository.

All commands successfully complete, but the proxy isn't working.

I've observed that:

1) The Cisco router sees the web cache as reported by "sh ip wccp" (see attached sh_ip_wccp.txt).
2) tcpdump -i tun0 reports packets arriving from the Cisco router.
3) tcpdump -i eth2 reports packets leaving the cache server bound for the destination web server
4) The destination web server shows no hits in the access_log file
5) tcpdump on the web server shows packets arriving from the client IP address on port 80.
6) tcpdump on the web server shows packets leaving bound for the client IP
7) The client browser times out, receiving an HTML error from Squid reporting "Connection to <server ip> failed." 8) When the timeout occurs, the squid access log reports "TCP_MISS/504 4123 GET http://myip.valnet.net/ - DIRECT/64.254.32.23 text/html"

I've attached numerous files containing statuses of various things that need to be set, such as rp_filter sysctl values, output of "show ip wccp", the squid.conf file, the cisco configuration, and the contents of iptables.

Any advice appreciated.

Thanks,

--
-----------------------------------------------
-  Nick Bright                                -
-  Vice President of Technology               -
-  Valnet -=- We Connect You -=-              -
-  Tel 888-332-1616 x 315 / Fax 620-331-0789  -
-  Web http://www.valnet.net/                 -
-----------------------------------------------
- Are your files safe?                        -
- Valnet Vault - Secure Cloud Backup          -
- More information & 30 day free trial at     -
- http://www.valnet.net/services/valnet-vault -
-----------------------------------------------

Using 1599 out of 522232 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname test-router
!
boot-start-marker
boot-end-marker
!
no aaa new-model
ip subnet-zero
ip wccp web-cache redirect-list 120
!
ip name-server 64.254.32.10
!
ip cef
!
interface GigabitEthernet0/1
 description Link to Internet
 ip address 64.254.32.5 255.255.255.0
 duplex auto
 speed auto
 media-type rj45
 negotiation auto
!
interface GigabitEthernet0/2
 description LAN to provide Caching for
 ip address 64.254.49.1 255.255.255.192
 ip wccp 80 redirect in
 ip wccp 90 redirect out
 duplex auto
 speed auto
 media-type rj45
 negotiation auto
!
interface GigabitEthernet0/3
 description Dedicated port to Cache server
 ip address 64.254.33.1 255.255.255.252
 ip wccp redirect exclude in
 duplex auto
 speed auto
 media-type rj45
 negotiation auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 64.254.32.1
no ip http server
!
!         
access-list 10 remark proxy server ip
access-list 10 permit 64.254.33.2
access-list 120 remark ACL for WCCP proxy access
access-list 120 remark Squid proxies bypass WCCP
access-list 120 deny   ip host 64.254.33.2 any
access-list 120 remark LAN clients proxy port 80 only
access-list 120 permit tcp 64.254.49.0 0.0.0.255 any eq www
access-list 120 remark all others bypass WCCP
access-list 120 deny   ip any any
!
!
gatekeeper
 shutdown
!
!
line con 0
 stopbits 1
line aux 0
line vty 0 4
!
end
[root@cache ~]# iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
DIVERT     tcp  --  anywhere             anywhere            socket 
TPROXY     tcp  --  anywhere             anywhere            tcp dpt:http TPROXY redirect 0.0.0.0:3128 mark 0x1/0x1

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain DIVERT (1 references)
target     prot opt source               destination         
MARK       all  --  anywhere             anywhere            MARK set 0x1 
ACCEPT     all  --  anywhere             anywhere            
[root@cache ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
[root@cache ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     gre  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination   
test-router>sh ip wccp
Global WCCP information:
    Router information:
        Router Identifier:                   64.254.49.1
        Protocol Version:                    2.0

    Service Identifier: web-cache
        Number of Cache Engines:             0
        Number of routers:                   0
        Total Packets Redirected:            0
        Redirect access-list:                120
        Total Packets Denied Redirect:       0
        Total Packets Unassigned:            0
        Group access-list:                   -none-
        Total Messages Denied to Group:      0
        Total Authentication failures:       0

    Service Identifier: 80
        Number of Cache Engines:             1
        Number of routers:                   1
        Total Packets Redirected:            680
        Redirect access-list:                120
        Total Packets Denied Redirect:       0
        Total Packets Unassigned:            4
        Group access-list:                   -none-
        Total Messages Denied to Group:      0
        Total Authentication failures:       0

    Service Identifier: 90
        Number of Cache Engines:             1
        Number of routers:                   1
        Total Packets Redirected:            0
        Redirect access-list:                120
        Total Packets Denied Redirect:       2619
        Total Packets Unassigned:            4
        Group access-list:                   -none-
        Total Messages Denied to Group:      0
        Total Authentication failures:       0
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow CONNECT !SSL_ports

acl publicnet src 64.254.49.0/26 # Testing Subnet

http_access allow localnet
http_access allow localhost
http_access allow publicnet

http_access deny all

http_port 3127
http_port 3128 tproxy

hierarchy_stoplist cgi-bin ?

cache_dir ufs /var/cache/squid 150000 16 256 
coredump_dir /var/spool/squid
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
visible_hostname cache.valnet.net
store_avg_object_size 10 MB

wccp2_router 64.254.33.1
wccp2_forwarding_method gre
wccp2_return_method gre
wccp2_service dynamic 80
wccp2_service_info 80 protocol=tcp flags=src_ip_hash priority=240 ports=80
wccp2_service dynamic 90
wccp2_service_info 90 protocol=tcp flags=dst_ip_hash,ports_source priority=240 ports=80
[root@cache ~]# cat /proc/sys/net/ipv4/conf/tun0/rp_filter
0
[root@cache ~]# cat /proc/sys/net/ipv4/conf/eth2/rp_filter 
0
[root@cache ~]# cat /proc/sys/net/ipv4/ip_forward 
1

<<attachment: smime.p7s>>


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux