<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Steve Glendinning &#187; Cisco</title>
	<atom:link href="http://www.steveglendinning.com/tag/cisco/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.steveglendinning.com</link>
	<description></description>
	<lastBuildDate>Fri, 06 Nov 2009 10:26:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WCCP with Cisco 877 and Squid</title>
		<link>http://www.steveglendinning.com/2009/03/17/wccp-with-cisco-877-and-squid/</link>
		<comments>http://www.steveglendinning.com/2009/03/17/wccp-with-cisco-877-and-squid/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 11:23:06 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.steveglendinning.com/?p=67</guid>
		<description><![CDATA[I just upgraded my Cisco 877 to the latest 12.4(24)T IOS, so I thought I&#8217;d have another go at getting WCCP to work.  Good news: it works!
Here&#8217;s my working configuration on the Cisco 877:
ip cef
ip wccp web-cache
interface Vlan1
ip wccp web-cache redirect in
This tells the router that web traffic coming into the Vlan1 interface is a [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded my Cisco 877 to the latest 12.4(24)T IOS, so I thought I&#8217;d have another go at <a title="transparent webcaching using policy caching" href="http://www.steveglendinning.com/2007/10/28/transparent-webcaching-on-a-cisco-877">getting WCCP to work</a>.  Good news: it works!</p>
<p>Here&#8217;s my working configuration on the Cisco 877:</p>
<blockquote><p>ip cef<br />
ip wccp web-cache</p>
<p>interface Vlan1<br />
ip wccp web-cache redirect in</p></blockquote>
<p>This tells the router that web traffic coming into the Vlan1 interface is a candidate for caching.  With WCCP, web-caches register themselves with the router, then the router forwards requests to them.  This means that if the cache disappears, the router will forward web requests directly to the internet.</p>
<p>I&#8217;m using Debian, so I added this to /etc/network/interfaces (replace 1.2.3.4 with the router identifier shown on the cisco by &#8220;show ip wccp&#8221;.  In my case this is the external internet-facing IP address):</p>
<blockquote><p>auto gre1<br />
iface gre1 inet static<br />
address 127.0.0.2<br />
netmask 255.255.255.255<br />
pre-up ip tunnel add gre1 mode gre remote 1.2.3.4 local 10.0.20.1 dev eth1<br />
post-down ip tunnel del gre1</p></blockquote>
<p>And I added this line to my firewall script.  You could add it to rc.local if you don&#8217;t have anywhere else to put it:</p>
<blockquote><p>iptables -t nat -A PREROUTING -i gre1 -d 0/0 -p tcp &#8211;dport 80 -j DNAT &#8211;to-destination 10.0.20.1:3128</p></blockquote>
<p>The only thing left now is the squid configuration.  I specified the internal address of the cisco 877 here (10.0.20.254):</p>
<blockquote><p>wccp2_router 10.0.20.254<br />
wccp2_rebuild_wait on<br />
wccp2_forwarding_method 1<br />
wccp2_return_method 1<br />
wccp2_assignment_method 1<br />
wccp2_service standard 0<br />
wccp2_address 10.0.20.1</p></blockquote>
<p>Useful links:</p>
<ul>
<li><a href="http://www.usenet-forums.com/squid-users/247645-wccp-gre-redirect-target-failed-solution.html">http://www.usenet-forums.com/squid-users/247645-wccp-gre-redirect-target-failed-solution.html</a></li>
<li><a href="http://wiki.squid-cache.org/SquidFaq/InterceptionProxy">http://wiki.squid-cache.org/SquidFaq/InterceptionProxy</a></li>
<li><a href="http://www.cisco.com/public/news_training/itsnews/tech/chalktalk/200806.html">http://www.cisco.com/public/news_training/itsnews/tech/chalktalk/200806.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.steveglendinning.com/2009/03/17/wccp-with-cisco-877-and-squid/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Transparent webcaching on a Cisco 877</title>
		<link>http://www.steveglendinning.com/2007/10/28/transparent-webcaching-on-a-cisco-877/</link>
		<comments>http://www.steveglendinning.com/2007/10/28/transparent-webcaching-on-a-cisco-877/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 15:37:47 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.steveglendinning.com/2007/10/28/transparent-webcaching-on-a-cisco-877/</guid>
		<description><![CDATA[After hours fighting with WCCP, i&#8217;ve given up and implemented the simpler solution: policy-based routing.
WCCP is a cisco protocol for managing web caches.  It&#8217;s really quite slick, as it only forwards requests to the cache(s) when they are alive (and sending &#8220;i am here&#8221; messages to the router).  If the cache service fails, [...]]]></description>
			<content:encoded><![CDATA[<p>After hours fighting with <a href="http://wiki.squid-cache.org/SquidFaq/InterceptionProxy#head-3a8820922b612e5efaf516ef043ea4c05e2e4799" title="Transparent squid caching using WCCP">WCCP</a>, i&#8217;ve given up and implemented the simpler solution: <a href="http://wiki.squid-cache.org/SquidFaq/InterceptionProxy#head-f6616eef3ce759dfa57f86bec19c112278d3a5d4" title="Transparent squid caching using policy-based routing">policy-based routing</a>.</p>
<p>WCCP is a cisco protocol for managing web caches.  It&#8217;s really quite slick, as it only forwards requests to the cache(s) when they are alive (and sending &#8220;i am here&#8221; messages to the router).  If the cache service fails, the router passes web requests directly through.  WCCP also automatically handles some of the fiddlier configuration, such as not mangling requests from the cache itself.  Unfortunately I couldn&#8217;t get it to work.</p>
<p>My Cisco 877 is currently running the latest 12.4T IOS (12.4(15)T1).  Some of the web guides I found suggested &#8220;known working&#8221; versions of 12.3 or 12.4 mainline IOS, but only 12.4T versions of IOS are available for the 877.  This leaves a lot of variables, I might open a TAC case and get Cisco on the job.</p>
<p>Policy-based routing works, but it doesn&#8217;t gracefully handle cache failure like WCCP.  On the Cisco 877:</p>
<blockquote><p>no ip cef</p>
<p>access-list 101 deny   tcp host 10.0.20.1 any eq www<br />
access-list 101 permit tcp any any eq www</p>
<p>route-map proxy-redir permit 10<br />
match ip address 101<br />
set ip next-hop 10.0.20.1</p>
<p>interface Vlan1<br />
ip policy route-map proxy-redir<br />
ip route-cache policy</p></blockquote>
<p>Where 10.0.20.1 is the IP address of the squid webcache.</p>
<p>This only works when I turn off CEF (no ip cef).  When CEF is enabled, the first packet of the TCP connection (SYN) is forwarded from router to webcache, the webcache replies directly to the client (SYN|ACK), but the third packet from client  (ACK) does not get forwarded by the router to the webcache.  All connections time out.</p>
<p>When the policy-based routing is process switched the forwarding works as expected.  All packets arrive at the webcache and the caching is transparent as expected.  Fast-switched policy-based routing (ip route-cache policy) also works, which is an improvement on process-based, but the optimal solution would be CEF-based.  I have a Cisco TAC case open to investigate this.</p>
<p>On the Linux 2.6 (debian Etch) squid server:</p>
<blockquote><p># Disable rp_filters<br />
echo 0 &gt; /proc/sys/net/ipv4/conf/default/rp_filter<br />
echo 0 &gt; /proc/sys/net/ipv4/conf/all/rp_filter<br />
echo 0 &gt; /proc/sys/net/ipv4/conf/lo/rp_filter<br />
echo 0 &gt; /proc/sys/net/ipv4/conf/eth0/rp_filter</p>
<p># transparent webcaching<br />
iptables -t nat -A PREROUTING -s 10.0.20.0/24 -d ! 10.0.20.0/24 -p tcp &#8211;dport 80 -j DNAT &#8211;to-destination 10.0.20.1:3128</p></blockquote>
<p>10.0.20.0/24 is the subnet to cache, and 10.0.20.1 is the IP address of the webcache.</p>
<p>That&#8217;s it. HTTP requests are transparently forwarded to the squid server and cached.</p>
<p>I found these resources helpful when trying to get WCCP working:</p>
<ul>
<li><a href="http://www.reub.net/node/3" title="Squid and WCCP (November 2005)">Squid and WCCP (November 2005)</a></li>
<li><a href="http://wiki.squid-cache.org/SquidFaq/InterceptionProxy#head-3a8820922b612e5efaf516ef043ea4c05e2e4799" title="Squid FAQ entry on WCCP">Squid FAQ entry on WCCP</a></li>
<li><a href="http://www.sublime.com.au/squid-wccp/" title="Squid Cache Transparency and WCCP (September 2001)">Squid Cache Transparency and WCCP (September 2001)</a></li>
<li><a href="http://www.squid-cache.org/mail-archive/squid-users/200609/0047.html" title="WCCPv2 GRE with 2.6 on Linux">WCCPv2 GRE with 2.6 on Linux</a></li>
</ul>
<p>And these were useful for policy based routing:</p>
<ul>
<li><a href="http://wiki.squid-cache.org/SquidFaq/InterceptionProxy#head-f6616eef3ce759dfa57f86bec19c112278d3a5d4" title="Interception Caching packet redirection with Cisco routers using policy routing (NON WCCP)">Squid FAQ entry on Interception Caching packet redirection with Cisco routers using policy routing (NON WCCP)</a></li>
<li><a href="http://wiki.squid-cache.org/SquidFaq/InterceptionProxy#head-9046f6b1479748be48c1e4e11ccdc6159e9c26ac" title="Linux 2.0.33 and Cisco policy-routing">Squid FAQ entry on Linux 2.0.33 and Cisco policy-routing</a></li>
<li><a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/fqos_c/fqcprt1/qcfpbr.htm" title="Cisco guide to configuring policy-based routing">Cisco guide to configuring policy-based routing</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.steveglendinning.com/2007/10/28/transparent-webcaching-on-a-cisco-877/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
