<?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>.dch IT</title>
	<atom:link href="http://dch-it.com/feed" rel="self" type="application/rss+xml" />
	<link>http://dch-it.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Apr 2010 14:10:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Get to Work &#8211; March 2010</title>
		<link>http://dch-it.com/gcj/get-to-work-march-2010</link>
		<comments>http://dch-it.com/gcj/get-to-work-march-2010#comments</comments>
		<pubDate>Mon, 26 Apr 2010 14:10:19 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Google Code Jam]]></category>
		<category><![CDATA[get to work]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=135</guid>
		<description><![CDATA[Google Code Jam &#8211; Get to Work The problem: For anyone looking at this problem, here&#8217;s something that you should know about this problem. Although it&#8217;s not explicitly stated that I saw, the sample data implies that if an employee is in the office hometown, that person does not need to commute via a vehicle [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/codejam/contest/dashboard?c=438101#s=p1">Google Code Jam &#8211; Get to Work</a></p>
<p><strong>The problem:</strong><br />
For anyone looking at this problem, here&#8217;s something that you should know about this problem.  Although it&#8217;s not explicitly stated that I saw, the sample data implies that if an employee is in the office hometown, that person does not need to commute via a vehicle and can be excluded.</p>
<p>Other than that, it&#8217;s relatively simple.  Create a list of employees with their hometown and commuter capacity, then just iterate through that list (sorted by commuter capacity) for each hometown.  You should be able to either determine that minimum number of cars needed or that it&#8217;s impossible relatively quickly.<br />
<span id="more-135"></span></p>
<p>Here’s the C# code that I used to solve the problem.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li><span style="color: #0600FF;">namespace</span> get_to_work</li><li><span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">class</span> Program</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> path <span style="color: #008000;">=</span> args<span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>	&nbsp;&nbsp;&nbsp;&nbsp;StreamReader reader <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamReader<span style="color: #000000;">&#40;</span>path<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;StreamWriter writer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamWriter<span style="color: #000000;">&#40;</span>path <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.out&quot;</span>, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> numTestCases <span style="color: #008000;">=</span> <span style="color: #FF0000;">int</span>.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> currNum <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> numTowns <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> officeTown <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> numEmployees <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> commute <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> officeInfo <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">bool</span> impossible <span style="color: #008000;">=</span> false<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List<span style="color: #008000;">&lt;</span>Employee<span style="color: #008000;">&gt;</span> employees <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>reader.<span style="color: #0000FF;">EndOfStream</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;officeInfo <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #FF0000;">char</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span> <span style="color: #666666;">' '</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;impossible <span style="color: #008000;">=</span> false<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currNum<span style="color: #008000;">++;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Case #&quot;</span> <span style="color: #008000;">+</span> currNum <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;: &quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;officeTown <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>officeInfo<span style="color: #000000;">&#91;</span>1<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numTowns <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>officeInfo<span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numEmployees <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;employees <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span>Employee<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;commute <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> numEmployees<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> employee <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #FF0000;">char</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span> <span style="color: #666666;">' '</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> town <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>employee<span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> capacity <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>employee<span style="color: #000000;">&#91;</span>1<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;employees.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> Employee<span style="color: #000000;">&#40;</span>town, capacity<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var towns <span style="color: #008000;">=</span> employees.<span style="color: #0000FF;">Select</span><span style="color: #000000;">&#40;</span>r <span style="color: #008000;">=&gt;</span> r.<span style="color: #0000FF;">hometown</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Distinct</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;=</span> numTowns<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var employees_in_town <span style="color: #008000;">=</span> employees.<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>e <span style="color: #008000;">=&gt;</span> e.<span style="color: #0000FF;">hometown</span> <span style="color: #008000;">==</span> i<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>employees_in_town.<span style="color: #0000FF;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">==</span> 0 <span style="color: #008000;">||</span> i <span style="color: #008000;">==</span> officeTown<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;commute <span style="color: #008000;">=</span> commute <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;0 &quot;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">else</span> <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>employees_in_town.<span style="color: #0000FF;">Sum</span><span style="color: #000000;">&#40;</span>e <span style="color: #008000;">=&gt;</span> e.<span style="color: #0000FF;">passengers</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&lt;</span> employees_in_town.<span style="color: #0000FF;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;impossible <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">else</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;commute <span style="color: #008000;">=</span> commute <span style="color: #008000;">+</span> computeVehicles<span style="color: #000000;">&#40;</span>employees_in_town<span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; &quot;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>commute.<span style="color: #0000FF;">EndsWith</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;commute <span style="color: #008000;">=</span> commute.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span>0, commute.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> 1<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>impossible<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;IMPOSSIBLE&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">else</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>commute<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.<span style="color: #0000FF;">Flush</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">static</span> <span style="color: #FF0000;">int</span> computeVehicles<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span>Employee<span style="color: #008000;">&gt;</span> employees<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> totalVehicles <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> totalCommuters <span style="color: #008000;">=</span> employees.<span style="color: #0000FF;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>Employee employee <span style="color: #0600FF;">in</span> employees.<span style="color: #0000FF;">OrderByDescending</span><span style="color: #000000;">&#40;</span>e <span style="color: #008000;">=&gt;</span> e.<span style="color: #0000FF;">passengers</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;totalCommuters <span style="color: #008000;">=</span> totalCommuters <span style="color: #008000;">-</span> employee.<span style="color: #0000FF;">passengers</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;totalVehicles<span style="color: #008000;">++;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>totalCommuters <span style="color: #008000;">&lt;=</span> 0<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">return</span> totalVehicles<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">struct</span> Employee</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> hometown<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> passengers<span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">public</span> Employee<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> h, <span style="color: #FF0000;">int</span> p<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hometown <span style="color: #008000;">=</span> h<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;passengers <span style="color: #008000;">=</span> p<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li><span style="color: #000000;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/gcj/get-to-work-march-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Odd Man Out &#8211; March 2010</title>
		<link>http://dch-it.com/gcj/odd-man-out-march-2010</link>
		<comments>http://dch-it.com/gcj/odd-man-out-march-2010#comments</comments>
		<pubDate>Mon, 26 Apr 2010 00:58:36 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Google Code Jam]]></category>
		<category><![CDATA[odd man out]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=127</guid>
		<description><![CDATA[Google Code Jam &#8211; Odd Man Out The problem: This problem is pretty easy. Basically, we have N number of integers with one of them being unique. It&#8217;s easy enough to simply search through a list of the provided integers until you run across one that has only 1 match in the list &#8211; that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/codejam/contest/dashboard?c=438101#s=p0">Google Code Jam &#8211; Odd Man Out</a></p>
<p><strong>The problem:</strong><br />
This problem is pretty easy.  Basically, we have N number of integers with one of them being unique.  It&#8217;s easy enough to simply search through a list of the provided integers until you run across one that has only 1 match in the list &#8211; that&#8217;s your answer.</p>
<p>And yes, I know I can break the loop after I&#8217;ve found the lone integer &#8211; since this is so quick running and it&#8217;s nothing important, I didn&#8217;t bother going back to fix that.<br />
<span id="more-127"></span></p>
<p>Here’s the C# code that I used to solve the problem.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li><span style="color: #0600FF;">namespace</span> odd_man_out</li><li><span style="color: #000000;">&#123;</span></li><li>	<span style="color: #FF0000;">class</span> Program</li><li>	<span style="color: #000000;">&#123;</span></li><li>		<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span></li><li>		<span style="color: #000000;">&#123;</span></li><li>			<span style="color: #FF0000;">string</span> path <span style="color: #008000;">=</span> args<span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>			StreamReader reader <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamReader<span style="color: #000000;">&#40;</span>path<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>			StreamWriter writer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamWriter<span style="color: #000000;">&#40;</span>path <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.out&quot;</span>, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>			<span style="color: #FF0000;">int</span> numTestCases <span style="color: #008000;">=</span> <span style="color: #FF0000;">int</span>.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>			<span style="color: #FF0000;">int</span> currNum <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>			List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> guests <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>			<span style="color: #FF0000;">int</span> numGuests <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>			<span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>reader.<span style="color: #0000FF;">EndOfStream</span><span style="color: #000000;">&#41;</span></li><li>			<span style="color: #000000;">&#123;</span></li><li>				currNum<span style="color: #008000;">++;</span></li><li>				guests <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>				numGuests <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>				<span style="color: #FF0000;">string</span> input <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>				guests.<span style="color: #0000FF;">AddRange</span><span style="color: #000000;">&#40;</span>input.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #FF0000;">char</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span> <span style="color: #666666;">' '</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>				writer.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Case #&quot;</span> <span style="color: #008000;">+</span> currNum <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;: &quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>				<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> guest <span style="color: #0600FF;">in</span> guests<span style="color: #000000;">&#41;</span></li><li>				<span style="color: #000000;">&#123;</span></li><li>					<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>guests.<span style="color: #0000FF;">FindAll</span><span style="color: #000000;">&#40;</span></li><li>						<span style="color: #FF0000;">delegate</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> s<span style="color: #000000;">&#41;</span></li><li>						<span style="color: #000000;">&#123;</span></li><li>							<span style="color: #0600FF;">return</span> s <span style="color: #008000;">==</span> guest<span style="color: #008000;">;</span></li><li>						<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">==</span> 1<span style="color: #000000;">&#41;</span></li><li>					<span style="color: #000000;">&#123;</span></li><li>					writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>guest<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>					writer.<span style="color: #0000FF;">Flush</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>					<span style="color: #000000;">&#125;</span></li><li>				<span style="color: #000000;">&#125;</span></li><li>			<span style="color: #000000;">&#125;</span></li><li>		<span style="color: #000000;">&#125;</span></li><li>	<span style="color: #000000;">&#125;</span></li><li><span style="color: #000000;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/gcj/odd-man-out-march-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EIGRPv6/OSPFv3 Redistribution</title>
		<link>http://dch-it.com/cisco/eigrpv6ospfv3-redistribution</link>
		<comments>http://dch-it.com/cisco/eigrpv6ospfv3-redistribution#comments</comments>
		<pubDate>Sat, 27 Mar 2010 03:33:51 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[eigrp]]></category>
		<category><![CDATA[eigrpv6]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ospf]]></category>
		<category><![CDATA[ospfv3]]></category>
		<category><![CDATA[redistribution]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=66</guid>
		<description><![CDATA[Challenge Lab #2 – EIGRPv6/OSPFv3 Redistribution . Overview: Coke and Pepsi are finally merging after so many decades once people realized that the separation in drinks was stupid, they taste exactly the same. Anyway, Coke utilizes an EIGRP based IPv6 network while Pepsi chose to go with IPv6 and OSPF because well, the coin landed [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Challenge Lab #2 – EIGRPv6/OSPFv3 Redistribution</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Overview:</strong></p>
<p>Coke and Pepsi are finally merging after so many decades once people realized that the separation in drinks was stupid, they taste exactly the same.  Anyway, Coke utilizes an EIGRP based IPv6 network while Pepsi chose to go with IPv6 and OSPF because well, the coin landed on tails.  You have been tasked with establishing connectivity between these two corporations.  Luckily, we found a router in a janitor’s closet that randomly happened to be connecting the two companies, so that made it easy.<br />
<span id="more-66"></span> </p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Technologies:</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>EIGRPv6:</strong></p>
<p>EIGRPv6 is the IPv6 flavor of EIGRP that Cisco has developed.  It is remarkably similar to EIGRP for IPv4, the only difference is in how it is enabled on a per interface basis.  Be sure to remember that you do need to specify a seed metric when redistributing.  You must define a value for the five metrics that EIGRP uses which are bandwidth, delay, reliability, load, and MTU.  Also, there is no more “network” command.  Instead, you would type “ipv6 eigrp 1” in the interface configuration mode in order to enable EIGRP in AS 1.  The other important thing to note is that there is a shutdown command in the router configuration mode for EIGRP in this version, so be sure to do a no shutdown to enable the routing protocol.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>OSPFv3:</strong></p>
<p>OSPFv3 is the open standard IPv6 version of OSPF.  Like EIGRP, it is quite similar to the prior version of OSPF.  It still utilizes the same metric, which is “cost”.  The command to enable OSPF on a per interface basis is “ipv6 ospf 1 area 0” in the interface configuration mode in order to enable OSPF process number 1 in area 0 for example.  You will also have to manually define the router-id since it still uses the old IPv4 format rather than the new IPv6 address format.  If you turn on debugging for R1, you will see it receiving the type 5 LSAs which is the external LSA type.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Redistribution:</strong></p>
<p>Redistribution is also very similar to IPv4, however there is one very important and notable difference.  The implicit connected interfaces in each routing protocol are no longer redistributed; that means that the interfaces and networks that you physically have configured for routing on the router will not be redistributed by default anymore.  In order to accomplish this you have to use “redistribute connected”, possibly with a route-map if you don’t want all of the connected interfaces to be redistributed.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Tasks:</strong></p>
<p>**You may need to create two VLANs and some trunks depending on how you have your environment physically cabled**</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1:</strong></p>
<ul>
<li>Enable IPv6 unicast routing</li>
<li>Configure OSPFv3 process 1 with a router-id of 1.1.1.1</li>
<li>Configure both FastEthernet0/0 and Loopback0 and enable OSPF on them for area 0</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<ul>
<li>Enable IPv6 unicast routing</li>
<li>Configure OSPFv3 with a router-id of 2.2.2.2</li>
<li>Configure EIGRP with a router-id of 2.2.2.2</li>
<li>Configure FastEthernet0/0 and enable OSPFv3 on it in area 0</li>
<li>Configure FastEthernet0/1 and enable EIGRPv6 on it in AS 1</li>
<li>In OSPFv3 process 1 configuration mode enable redistribution for EIGRP AS 1 and enable redistribution for connected interfaces.</li>
<li>In EIGRPv6 configuration mode enable redistribution for OSPF process 1 and connected routes.  Be sure to define the metric property for each of them otherwise they will not be entered into the IPv6 routing tables.  Issue a “no shutdown” command to enable the protocol.</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<ul>
<li>Enable IPv6 unicast routing</li>
<li>Configure EIGRPv6 AS 1 with a router-id of 3.3.3.3 and issue a “no shutdown” command</li>
<li>Configure both FastEthernet0/1 and Loopback0, then enable EIGRP on each of them in AS 1.</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Logical Topology</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p> <a href="http://dch-it.com/wp-content/uploads/2010/03/redistribution_lab.jpg"><img src="http://dch-it.com/wp-content/uploads/2010/03/redistribution_lab.jpg" alt="" title="redistribution_lab" width="703" height="223" class="alignnone size-full wp-image-76" /></a></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Walkthrough</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Before we can do anything, we need to enable IPv6 routing on the router.  By default, IPv6 routing is disabled.  This command will enable unicast routing for IPv6.  You should note that there is an entirely different command for routing multicast packets, which is “ipv6 multicast-routing”.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 unicast-routing</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Next, we will set the router id that OSPF will use on this router.  It must be manually set because it still uses a 32bit notation, so it will not automatically take one of the set IPv6 addresses.  If you have an IPv4 interface configured, it will still pull that address and use it as its router id.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 router ospf 1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 1.1.1.1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s start configuring the interfaces.  We’ll begin with FastEthernet0/0 which will be in OSPF Area 0. Then, we will also put Loopback0 into Area 0.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>  <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 router ospf 1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 router ospf 1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>That’s all we need on R1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Again, we first need to enable IPv6 routing on the router</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 unicast-routing</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Next, let’s configure the two FastEthernet interfaces.  We’ll start with FastEthernet0/0 which is in OSPF Area 0.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 ospf 1 area 0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Next, FastEthernet0/1 which is in EIGRP AS 1</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span>ipv6 eigrp <span style="color: #FF0000;">1</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s configure the router id of OSPF and redistribute EIGRP and connected routes.  In IPv6, there is no implicit redistribution of connected routes in a different protocol unlike in IPv4.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 router ospf 1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 2.2.2.2</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#redistributed eigrp 1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#redistribute connected</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will do the same for EIGRP AS 1.  Remember that a seed metric must be defined for redistributed routes, otherwise they will not be put in as active EIGRP routes.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 eigrp 1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span>router<span style="color: #008000;">-</span>id 2.2.2.2</li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span>redistribute ospf <span style="color: #FF0000;">1</span> metric <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">10</span> <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">1</span> <span style="color: #FF0000;">1500</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span>redistribute connected metric <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">10</span> <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">1</span> <span style="color: #FF0000;">1500</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>This next step is new to IPv6 routing protocols.  There is now a shutdown command, just like in interface configuration mode.  OSPF defaults to being “no shutdown” but the same doesn’t hold true for EIGRP, so we must enable it.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>     <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no shutdown</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we’re done with R2.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Again, we must first enable IPv6 routing.</p>
<p>     <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 unicast-routing</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s set up the EIGRP router id and enable the protocol.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 router eigrp 1</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 3.3.3.3</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no shutdown</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Finally, let’s put FastEthernet0/1 and Loopback0 into EIGRP AS 1</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/1</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 eigrp 1</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 eigrp 1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>And we’re done!</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Testing and Debugging</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 route</strong></p>
<p>Show the IPv6 routing table</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show ipv6 route</span></li><li>&nbsp;</li><li>IPv6 Routing Table <span style="color: #008000;">-</span> 6 entries</li><li>&nbsp;</li><li>Codes<span style="color: #008000;">:</span> C <span style="color: #008000;">-</span> Connected, L <span style="color: #008000;">-</span> Local, S <span style="color: #008000;">-</span> <span style="color: #0600FF;">Static</span>, R <span style="color: #008000;">-</span> RIP, B <span style="color: #008000;">-</span> BGP</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U <span style="color: #008000;">-</span> Per<span style="color: #008000;">-</span>user <span style="color: #0600FF;">Static</span> route, M <span style="color: #008000;">-</span> MIPv6</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I1 <span style="color: #008000;">-</span> ISIS L1, I2 <span style="color: #008000;">-</span> ISIS L2, IA <span style="color: #008000;">-</span> ISIS interarea, <span style="color: #008000;">IS</span> <span style="color: #008000;">-</span> ISIS summary</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; O <span style="color: #008000;">-</span> OSPF intra, OI <span style="color: #008000;">-</span> OSPF inter, OE1 <span style="color: #008000;">-</span> OSPF ext 1, OE2 <span style="color: #008000;">-</span> OSPF ext 2</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON1 <span style="color: #008000;">-</span> OSPF NSSA ext 1, ON2 <span style="color: #008000;">-</span> OSPF NSSA ext 2</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D <span style="color: #008000;">-</span> EIGRP, EX <span style="color: #008000;">-</span> EIGRP external</li><li>&nbsp;</li><li>OE2&nbsp;&nbsp;E567<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128 <span style="color: #000000;">&#91;</span>110<span style="color: #008000;">/</span>20<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via FE80<span style="color: #008000;">::</span>207<span style="color: #008000;">:</span>EFF<span style="color: #008000;">:</span>FE1F<span style="color: #008000;">:</span>6FA8, FastEthernet0<span style="color: #008000;">/</span>0</li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span>Here’s an example of an External Type 2 OSPF route.&nbsp;&nbsp;<span style="color: #0000FF;">That</span> means that it <span style="color: #008000;">is</span> a redistributed route.&nbsp;&nbsp;<span style="color: #0000FF;">Type</span> 2 routes generally only reflect the cost from <span style="color: #0600FF;">THIS</span> router to the destination whereas Type <span style="color: #FF0000;">1</span> routes would reflect the cost of the full path.<span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>LC&nbsp;&nbsp;F564<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">128</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Loopback0</li><li>&nbsp;</li><li>C&nbsp;&nbsp; FEC0<span style="color: #008000;">::/</span><span style="color: #FF0000;">126</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span></li><li>&nbsp;</li><li>L&nbsp;&nbsp; FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">128</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span></li><li>&nbsp;</li><li>OE2&nbsp;&nbsp;FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">4</span><span style="color: #008000;">/</span><span style="color: #FF0000;">126</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">110</span><span style="color: #008000;">/</span><span style="color: #FF0000;">20</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via FE80<span style="color: #008000;">::</span><span style="color: #FF0000;">207</span><span style="color: #008000;">:</span>EFF<span style="color: #008000;">:</span>FE1F<span style="color: #008000;">:</span>6FA8, FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span></li><li>&nbsp;</li><li>L&nbsp;&nbsp; FF00<span style="color: #008000;">::/</span><span style="color: #FF0000;">8</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Null0</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 interface brief</strong></p>
<p>Show information whenever an IPv6 packet is sent or received</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show ipv6 interface brief</span></li><li>&nbsp;</li><li>FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>up<span style="color: #008000;">/</span>up<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;FE80<span style="color: #008000;">::</span><span style="color: #FF0000;">214</span><span style="color: #008000;">:</span>F2FF<span style="color: #008000;">:</span>FE01<span style="color: #008000;">:</span><span style="color: #FF0000;">6438</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span></li><li>&nbsp;</li><li>FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>administratively down<span style="color: #008000;">/</span>down<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>Serial0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>administratively down<span style="color: #008000;">/</span>down<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>Serial0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">1</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>administratively down<span style="color: #008000;">/</span>down<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>Loopback0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>up<span style="color: #008000;">/</span>up<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;FE80<span style="color: #008000;">::</span><span style="color: #FF0000;">214</span><span style="color: #008000;">:</span>F2FF<span style="color: #008000;">:</span>FE01<span style="color: #008000;">:</span><span style="color: #FF0000;">6438</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;F564<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 ospf</strong></p>
<p>Show information for the defined OSPF process</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show ipv6 ospf 1</span></li><li>&nbsp;</li><li> Routing Process <span style="color: #666666;">&quot;ospfv3 1&quot;</span> with ID 1.1.1.1</li><li>&nbsp;</li><li> SPF schedule delay 5 secs, Hold time between two SPFs 10 secs</li><li>&nbsp;</li><li> Minimum LSA interval 5 secs. <span style="color: #0000FF;">Minimum</span> LSA arrival 1 secs</li><li>&nbsp;</li><li> LSA group pacing timer 240 secs</li><li>&nbsp;</li><li> <span style="color: #FF0000;">Interface</span> flood pacing timer 33 msecs</li><li>&nbsp;</li><li> Retransmission pacing timer 66 msecs</li><li>&nbsp;</li><li> Number of external LSA 2. <span style="color: #0000FF;">Checksum</span> Sum 0x01497B</li><li>&nbsp;</li><li> Number of areas <span style="color: #0600FF;">in</span> <span style="color: #0600FF;">this</span> router <span style="color: #008000;">is</span> 1. 1 normal 0 stub 0 nssa</li><li>&nbsp;</li><li> Reference bandwidth unit <span style="color: #008000;">is</span> 100 mbps</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Area BACKBONE<span style="color: #000000;">&#40;</span>0<span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of interfaces <span style="color: #0600FF;">in</span> <span style="color: #0600FF;">this</span> area <span style="color: #008000;">is</span> <span style="color: #FF0000;">2</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SPF algorithm executed <span style="color: #FF0000;">4</span> times</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of LSA 7. <span style="color: #0000FF;">Checksum</span> Sum 0x02B045</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of DCbitless LSA <span style="color: #FF0000;">0</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of indication LSA <span style="color: #FF0000;">0</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of DoNotAge LSA <span style="color: #FF0000;">0</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flood list length <span style="color: #FF0000;">0</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 eigrp topology</strong></p>
<p>Show the IPv6 EIGRP topology table</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #008080;">#show ipv6 eigrp topology</span></li><li>&nbsp;</li><li>IPv6<span style="color: #008000;">-</span>EIGRP Topology Table <span style="color: #0600FF;">for</span> <span style="color: #0600FF;">AS</span><span style="color: #000000;">&#40;</span>1<span style="color: #000000;">&#41;</span><span style="color: #008000;">/</span>ID<span style="color: #000000;">&#40;</span>3.3.3.3<span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>Codes<span style="color: #008000;">:</span> P <span style="color: #008000;">-</span> Passive, A <span style="color: #008000;">-</span> Active, U <span style="color: #008000;">-</span> Update, Q <span style="color: #008000;">-</span> Query, R <span style="color: #008000;">-</span> Reply,</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r <span style="color: #008000;">-</span> reply Status, s <span style="color: #008000;">-</span> sia Status</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>P F564<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128, 1 successors, FD <span style="color: #008000;">is</span> 25605120</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via FE80<span style="color: #008000;">::</span>207<span style="color: #008000;">:</span>EFF<span style="color: #008000;">:</span>FE1F<span style="color: #008000;">:</span>6FA9 <span style="color: #000000;">&#40;</span>25605120<span style="color: #008000;">/</span>25602560<span style="color: #000000;">&#41;</span>, FastEthernet0<span style="color: #008000;">/</span>1</li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span>Here <span style="color: #008000;">is</span> the route to the Loopback <span style="color: #FF0000;">interface</span> on R1.&nbsp;&nbsp;<span style="color: #0000FF;">The</span> advertised distance will change with the metrics that we specified <span style="color: #0600FF;">in</span> the redistribution.<span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>P E567<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128, 1 successors, FD <span style="color: #008000;">is</span> 128256</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via Connected, Loopback0</li><li>&nbsp;</li><li>P FEC0<span style="color: #008000;">::/</span>126, 1 successors, FD <span style="color: #008000;">is</span> 25605120</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via FE80<span style="color: #008000;">::</span>207<span style="color: #008000;">:</span>EFF<span style="color: #008000;">:</span>FE1F<span style="color: #008000;">:</span>6FA9 <span style="color: #000000;">&#40;</span>25605120<span style="color: #008000;">/</span>25602560<span style="color: #000000;">&#41;</span>, FastEthernet0<span style="color: #008000;">/</span>1</li><li>&nbsp;</li><li>P FEC0<span style="color: #008000;">::</span>4<span style="color: #008000;">/</span>126, 1 successors, FD <span style="color: #008000;">is</span> <span style="color: #FF0000;">28160</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via Connected, FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>ping ipv6</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Ping the defined IPv6 address</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#ping ipv6 E567::1</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>Type escape sequence to abort.</li><li>&nbsp;</li><li><span style="color: #0000FF;">Sending</span> 5, 100<span style="color: #008000;">-</span><span style="color: #FF0000;">byte</span> ICMP Echos to E567<span style="color: #008000;">::</span>1, timeout <span style="color: #008000;">is</span> 2 seconds<span style="color: #008000;">:</span></li><li>&nbsp;</li><li><span style="color: #008000;">!!!!!</span></li><li>&nbsp;</li><li>Success rate <span style="color: #008000;">is</span> <span style="color: #FF0000;">100</span> percent <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">5</span><span style="color: #008000;">/</span><span style="color: #FF0000;">5</span><span style="color: #000000;">&#41;</span>, round<span style="color: #008000;">-</span>trip min<span style="color: #008000;">/</span>avg<span style="color: #008000;">/</span>max <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">4</span> ms</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Basically you can take almost any debug or show command from IPv4, change “ip” to “ipv6” and it will show you the IPv6 related information.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Solutions</strong></p>
<p><strong>R1</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R1</li><li><span style="color: #008000;">!</span></li><li>ipv6 unicast<span style="color: #008000;">-</span>routing</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback0</li><li> no ip address</li><li> ipv6 address F564<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128</li><li> ipv6 ospf 1 area 0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li> no ip address</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li> ipv6 address FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">126</span></li><li> ipv6 ospf <span style="color: #FF0000;">1</span> area <span style="color: #FF0000;">0</span></li><li><span style="color: #008000;">!</span></li><li>ipv6 router ospf <span style="color: #FF0000;">1</span></li><li> router<span style="color: #008000;">-</span>id 1.1.1.1</li><li> log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R2</li><li><span style="color: #008000;">!</span></li><li>ipv6 unicast<span style="color: #008000;">-</span>routing</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li> no ip address</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li> ipv6 address FEC0<span style="color: #008000;">::</span>2<span style="color: #008000;">/</span>126</li><li> ipv6 ospf 1 area </li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>1</li><li> no ip address</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li> ipv6 address FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">5</span><span style="color: #008000;">/</span><span style="color: #FF0000;">126</span></li><li> ipv6 eigrp <span style="color: #FF0000;">1</span></li><li><span style="color: #008000;">!</span></li><li>ipv6 router eigrp <span style="color: #FF0000;">1</span></li><li> router<span style="color: #008000;">-</span>id 2.2.2.2</li><li> no shutdown</li><li> redistribute connected metric <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">10</span> <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">1</span> <span style="color: #FF0000;">1500</span></li><li> redistribute ospf <span style="color: #FF0000;">1</span> metric <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">10</span> <span style="color: #FF0000;">100</span> <span style="color: #FF0000;">1</span> <span style="color: #FF0000;">1500</span></li><li><span style="color: #008000;">!</span></li><li>ipv6 router ospf <span style="color: #FF0000;">1</span></li><li> router<span style="color: #008000;">-</span>id 2.2.2.2</li><li> log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li> redistribute connected</li><li> redistribute eigrp <span style="color: #FF0000;">1</span></li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R3</li><li><span style="color: #008000;">!</span></li><li>ipv6 unicast<span style="color: #008000;">-</span>routing</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback0</li><li> no ip address</li><li> ipv6 address E567<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128</li><li> ipv6 eigrp 1</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>1</li><li> no ip address</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li> ipv6 address FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">6</span><span style="color: #008000;">/</span><span style="color: #FF0000;">126</span></li><li> ipv6 eigrp <span style="color: #FF0000;">1</span></li><li><span style="color: #008000;">!</span></li><li>ipv6 router eigrp <span style="color: #FF0000;">1</span></li><li> router<span style="color: #008000;">-</span>id 3.3.3.3</li><li> no shutdown</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/cisco/eigrpv6ospfv3-redistribution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alien Numbers &#8211; April 2008</title>
		<link>http://dch-it.com/gcj/alien-numbers-april-2008</link>
		<comments>http://dch-it.com/gcj/alien-numbers-april-2008#comments</comments>
		<pubDate>Sun, 14 Feb 2010 01:27:56 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Google Code Jam]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code jam]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=5</guid>
		<description><![CDATA[Google Code Jam &#8211; Alien Numbers The problem: This problem is basically asking us to do conversions from base-X to base-Y. To do that, we&#8217;re going to do 2 conversions: one from base-X to base-10, then one from base-10 to base Y. The conversion for base-10 is pretty simple. If we have a number in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/codejam/contest/dashboard?c=32003#s=p0">Google Code Jam &#8211; Alien Numbers</a></p>
<p><strong>The problem:</strong><br />
This problem is basically asking us to do conversions from base-X to base-Y.  To do that, we&#8217;re going to do 2 conversions:  one from base-X to base-10, then one from base-10 to base Y.</p>
<p>The conversion for base-10 is pretty simple.  If we have a number in base-3 such as 201, then that can be represented in base-10 by the following:  (2 * 3^2) + (0 * 3^1) + (1 * 3^0) = 19.</p>
<p>To convert to base-Y, we&#8217;re going to use the following method (using base-5 for our conversion and 19 (base-10) as our example).<br />
19 / 5 = 3 R 4<br />
 3 / 5 = 0 R 3</p>
<p>We then take those remainders and write them down in reverse, so 19 (base-10) = 34 (base 5).  Converting the numbers to the &#8220;Alien&#8221; numbers is a simple process of matching up the digits with their corresponding index in the given alien numbers.</p>
<p><span id="more-5"></span></p>
<p>Here&#8217;s the C# code that I used to solve the problem.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span></li><li><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li><span style="color: #0600FF;">namespace</span> Alien_Numbers</li><li><span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">class</span> Program</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> path <span style="color: #008000;">=</span> args<span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">int</span> numTestCases <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ArrayList input <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ArrayList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamReader reader <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamReader<span style="color: #000000;">&#40;</span>path<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamWriter writer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamWriter<span style="color: #000000;">&#40;</span>path <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.out&quot;</span>, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numTestCases <span style="color: #008000;">=</span> Int32.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>reader.<span style="color: #0000FF;">EndOfStream</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> alien_number <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> source_language <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> target_language <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> line<span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> s <span style="color: #0600FF;">in</span> input<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line <span style="color: #008000;">=</span> s.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #FF0000;">char</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span><span style="color: #666666;">' '</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alien_number <span style="color: #008000;">=</span> line<span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;source_language <span style="color: #008000;">=</span> line<span style="color: #000000;">&#91;</span>1<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target_language <span style="color: #008000;">=</span> line<span style="color: #000000;">&#91;</span>2<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Case #&quot;</span> <span style="color: #008000;">+</span> <span style="color: #000000;">&#40;</span>input.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;: &quot;</span> <span style="color: #008000;">+</span> ConvertToAlienLanguage<span style="color: #000000;">&#40;</span>source_language, alien_number, target_language<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.<span style="color: #0000FF;">Flush</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span>&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> ConvertToAlienLanguage<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> source_language, <span style="color: #FF0000;">string</span> source_number, <span style="color: #FF0000;">string</span> target_language<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">long</span> srcbase <span style="color: #008000;">=</span> source_language.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">long</span> trgbase <span style="color: #008000;">=</span> target_language.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">long</span> srcnum_base10 <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #FF0000;">string</span> strConvertedNum <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008080; font-style: italic;">// --------- Convert the source number to base 10 ------------</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> source_number.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srcnum_base10 <span style="color: #008000;">+=</span> source_language.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span>source_number<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">long</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span>Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>srcbase, <span style="color: #000000;">&#40;</span>source_number.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> 1<span style="color: #000000;">&#41;</span> <span style="color: #008000;">-</span> i<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008080; font-style: italic;">// --------- Convert our Base 10 number into the target base and &quot;Alien&quot; numbers</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strConvertedNum <span style="color: #008000;">=</span> strConvertedNum.<span style="color: #0000FF;">Insert</span><span style="color: #000000;">&#40;</span>0, <span style="color: #000000;">&#40;</span>target_language<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span>srcnum_base10 <span style="color: #008000;">%</span> trgbase<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>srcnum_base10 <span style="color: #008000;">/</span> trgbase <span style="color: #008000;">==</span> 0<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<span style="color: #008000;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srcnum_base10 <span style="color: #008000;">=</span> srcnum_base10 <span style="color: #008000;">/</span> trgbase<span style="color: #008000;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0600FF;">return</span> strConvertedNum<span style="color: #008000;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#125;</span></li><li><span style="color: #000000;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/gcj/alien-numbers-april-2008/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 to IPv6 – Tunneling through IPv4</title>
		<link>http://dch-it.com/cisco/ipv6-to-ipv6-%e2%80%93-tunneling-through-ipv4</link>
		<comments>http://dch-it.com/cisco/ipv6-to-ipv6-%e2%80%93-tunneling-through-ipv4#comments</comments>
		<pubDate>Sun, 15 Mar 2009 09:16:16 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipv4]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=25</guid>
		<description><![CDATA[Challenge Lab #3 – IPv6 to IPv6 – Tunneling through IPv4 (Note: Please complete Challenge Lab #2 &#8211; EIGRPv6 / OSPFv3 Redistribution prior to this if you are not already familiar with IPv6 terms and concepts.) Overview: A small business owner in your local town has contacted your consulting company request someone to change them [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Challenge Lab #3 – IPv6 to IPv6 – Tunneling through IPv4</strong></p>
<p>(Note: Please complete Challenge Lab #2 &#8211; EIGRPv6 / OSPFv3 Redistribution prior to this if you are not already familiar with IPv6 terms and concepts.)</p>
<p><strong>Overview:</strong></p>
<p>A small business owner in your local town has contacted your consulting company request someone to change them to an entirely IPv6 network.  Although you know that it is kind of pointless for a small shop to be spending money on the transition at this time, you are more than willing to let them write you as many checks as they want.  One of the issues you will be facing is how to maintain connectivity between their two locations when you only have access to the IPv4 internet.<br />
<span id="more-25"></span><br />
<strong>Technologies:</p>
<p>GRE:</strong></p>
<p>GRE, or Generic Routing Encapsulation, is a technology developed by Cisco that creates a logical point-to-point link over already accessible networks.  This technology is useful in order to run different kind of protocol stacks.  For example, you can run IPSec/GRE tunnel between two sites in order to provide security.  Another example which we will be utilizing here is the ability to connect two sites via IPv4 but pass IPv6 information through it.</p>
<p> <strong>IPv6 to IPv6 Tunnel Methods:</strong></p>
<p>There are five different methods of tunneling IPv6 through an IPv4 backbone, and they are divided into two majors groups which are automatic and manual.  The automatic tunnels still need IPv4 information, however it is generally pulled from another already configured address such as a BGP peer.  ISPs may also run an overlay service that allows customers to connect and configure themselves which may provide ease of management in larger deployments.  For this example, we will be using a manually configured IPv6 tunnel since this is for a small business and there will be very minimal management required.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Tasks:</strong></p>
<p>**You may need to create two VLANs and some trunks depending on how you have your environment physically cabled**</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1:</strong></p>
<ul>
<li> Enable IPv6 unicast routing</li>
<li>  Configure a default IPv4 static route via R2</li>
<li> Configure Tun0 with a mode of ipv6ip, a source of F0/0, and the destination address of the Tun0 on R3</li>
<li>Configure IPv6 OSPF Area 0 on Lo0 and Tun0</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<ul>
<li>Configure the two interfaces with basic IP addressing</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<ul>
<li>Enable IPv6 unicast routing</li>
<li>Configure a default IPv4 static route via R2</li>
<li>Configure Tun0 with a mode of ipv6ip, a source of F0/1, and the destination address of the Tun0 on R1</li>
<li> Configure IPv6 OSPF Area 0 on Lo0 and Tun0</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong style="padding-top:1.4em;">Logical Topology</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p> <a href="http://dch-it.com/wp-content/uploads/2010/02/ipv6_to_ipv6.jpg"><img src="http://dch-it.com/wp-content/uploads/2010/02/ipv6_to_ipv6.jpg" alt="" title="ipv6_to_ipv6" width="686" height="231" class="alignnone size-full wp-image-34" style="margin-top:12px;margin-bottom:12px;" /></a></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Walkthrough Below!</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Walkthrough</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Since we will be running an IPv6 routing protocol, we need to enable IPv6 unicast routing.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 unicast-routing</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s configure a default static route via R2 so that we will have full IPv4 connectivity.  You can run a routing protocol instead if you wish.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip route 0.0.0.0 0.0.0.0 201.2.3.2</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s create Interface Tunnel0 that we will use to tunnel IPv6 over the IPv4 backbone and set the IPv6 address.  A tunnel interface is a logical interface that communicates with another tunnel interface via connected physical interfaces.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Tunnel0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 address FED0::1/126</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s change the tunnel mode to IPv6 using IPv4 encapsulation.  What this command is doing is basically stating that the inner packet contains IPv6 data, and that inner packet is encapsulated within a packet utilizing IPv4 data.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#tunnel mode ipv6ip</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We are going to be using the source address from F0/0 since that is our connection to the internet, then we will use the public address of R3 as the tunnel destination.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#tunnel source FastEthernet 0/0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#tunnel destination 202.3.2.1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s just run IPv6 OSPF on our two IPv6 interfaces to showcase running a routing protocol over our new tunnel.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#int Tunnel0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 ospf 1 area 0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#int Lo0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 ospf 1 area 0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>That’s all we need on R1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>All we need to do on R2 is configure the two FastEthernet interfaces with IPv4 addresses to get basic connectivity, we don’t need to do anything else.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip address 201.2.3.2 255.255.255.252</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip address 202.3.4.2 255.255.255.252</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we’re done with R2.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Since we will be running an IPv6 routing protocol, we need to enable IPv6 unicast routing.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 unicast-routing</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s configure a default static route via R2 so that we will have full IPv4 connectivity.  You can run a routing protocol instead of you wish.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip route 0.0.0.0 0.0.0.0 202.3.2.1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s create Interface Tunnel0 that we will use to tunnel IPv6 over the IPv4 backbone and set the IPv6 address.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Tunnel0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 address FED0::2/126</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s change the tunnel mode to IPv6 using IPv4 encapsulation</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#tunnel mode ipv6ip</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We are going to be using the source address from F0/1 since that is our connection to the internet, then we will use the public address of R1 as the tunnel destination.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>   <!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#tunnel source FastEthernet 0/1</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#tunnel destination 201.2.3.1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s just run IPv6 OSPF on our two IPv6 interfaces to showcase running a routing protocol over our new tunnel.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#int Tunnel0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 ospf 1 area 0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#int Lo0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ipv6 ospf 1 area 0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>That’s all we need on R3.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Testing and Debugging</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 route</strong></p>
<p>Show the IPv6 routing table</p>
<p>Example:</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show ipv6 route</span></li><li>&nbsp;</li><li>IPv6 Routing Table <span style="color: #008000;">-</span> 6 entries</li><li>&nbsp;</li><li>Codes<span style="color: #008000;">:</span> C <span style="color: #008000;">-</span> Connected, L <span style="color: #008000;">-</span> Local, S <span style="color: #008000;">-</span> <span style="color: #0600FF;">Static</span>, R <span style="color: #008000;">-</span> RIP, B <span style="color: #008000;">-</span> BGP</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U <span style="color: #008000;">-</span> Per<span style="color: #008000;">-</span>user <span style="color: #0600FF;">Static</span> route, M <span style="color: #008000;">-</span> MIPv6</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I1 <span style="color: #008000;">-</span> ISIS L1, I2 <span style="color: #008000;">-</span> ISIS L2, IA <span style="color: #008000;">-</span> ISIS interarea, <span style="color: #008000;">IS</span> <span style="color: #008000;">-</span> ISIS summary</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; O <span style="color: #008000;">-</span> OSPF intra, OI <span style="color: #008000;">-</span> OSPF inter, OE1 <span style="color: #008000;">-</span> OSPF ext 1, OE2 <span style="color: #008000;">-</span> OSPF ext 2</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON1 <span style="color: #008000;">-</span> OSPF NSSA ext 1, ON2 <span style="color: #008000;">-</span> OSPF NSSA ext 2</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D <span style="color: #008000;">-</span> EIGRP, EX <span style="color: #008000;">-</span> EIGRP external</li><li>C&nbsp;&nbsp; FEC0<span style="color: #008000;">::/</span>65 <span style="color: #000000;">&#91;</span>0<span style="color: #008000;">/</span>0<span style="color: #000000;">&#93;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Loopback0</li><li>L&nbsp;&nbsp; FEC0<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128 <span style="color: #000000;">&#91;</span>0<span style="color: #008000;">/</span>0<span style="color: #000000;">&#93;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Loopback0</li><li>O&nbsp;&nbsp; FEC0<span style="color: #008000;">:</span>F000<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>128 <span style="color: #000000;">&#91;</span>110<span style="color: #008000;">/</span>11111<span style="color: #000000;">&#93;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; via FE80<span style="color: #008000;">::</span><span style="color: #0000FF;">CA03</span><span style="color: #008000;">:</span>402, Tunnel0</li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span>Notice how <span style="color: #0600FF;">this</span> OSPF route <span style="color: #008000;">is</span> received via Tunnel0.&nbsp;&nbsp;<span style="color: #0000FF;">Success</span><span style="color: #008000;">!</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>C&nbsp;&nbsp; FED0<span style="color: #008000;">::/</span><span style="color: #FF0000;">126</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Tunnel0</li><li>L&nbsp;&nbsp; FED0<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">128</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Tunnel0</li><li>L&nbsp;&nbsp; FF00<span style="color: #008000;">::/</span><span style="color: #FF0000;">8</span> <span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; via <span style="color: #008000;">::</span>, Null0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 interface brief</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Show information whenever an IPv6 packet is sent or received</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show ipv6 interface brief</span></li><li>&nbsp;</li><li>FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>up<span style="color: #008000;">/</span>up<span style="color: #000000;">&#93;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;FE80<span style="color: #008000;">::</span><span style="color: #FF0000;">214</span><span style="color: #008000;">:</span>F2FF<span style="color: #008000;">:</span>FE01<span style="color: #008000;">:</span><span style="color: #FF0000;">6438</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;FEC0<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span></li><li>FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>administratively down<span style="color: #008000;">/</span>down<span style="color: #000000;">&#93;</span></li><li>Serial0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>administratively down<span style="color: #008000;">/</span>down<span style="color: #000000;">&#93;</span></li><li>Serial0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">1</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>administratively down<span style="color: #008000;">/</span>down<span style="color: #000000;">&#93;</span></li><li>Loopback0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;">&#91;</span>up<span style="color: #008000;">/</span>up<span style="color: #000000;">&#93;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;FE80<span style="color: #008000;">::</span><span style="color: #FF0000;">214</span><span style="color: #008000;">:</span>F2FF<span style="color: #008000;">:</span>FE01<span style="color: #008000;">:</span><span style="color: #FF0000;">6438</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;F564<span style="color: #008000;">::</span><span style="color: #FF0000;">1</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ipv6 tunnel</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Show tunnels that are configured for IPv6</p>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show ipv6 tunnel</span></li><li>&nbsp;</li><li>Tun Route&nbsp;&nbsp;LastInp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Packets Description</li><li>&nbsp;&nbsp;0&nbsp;&nbsp; <span style="color: #008000;">-</span>&nbsp;&nbsp; 00<span style="color: #008000;">:</span>00<span style="color: #008000;">:</span>01&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;212</li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span>You can see the number of the tunnel of the <span style="color: #FF0000;">interface</span> here, how many packets it has sent, and the last time it was used<span style="color: #008000;">!</span><span style="color: #000000;">&#41;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>ping ipv6</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Send an ICMP request to the specified address</p>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#ping FEC0:F000::1</span></li><li>&nbsp;</li><li>Type escape sequence to abort.</li><li>&nbsp;</li><li><span style="color: #0000FF;">Sending</span> 5, 100<span style="color: #008000;">-</span><span style="color: #FF0000;">byte</span> ICMP Echos to FEC0<span style="color: #008000;">:</span>F000<span style="color: #008000;">::</span>1, timeout <span style="color: #008000;">is</span> 2 seconds<span style="color: #008000;">:</span></li><li><span style="color: #008000;">!!!!!</span></li><li>Success rate <span style="color: #008000;">is</span> <span style="color: #FF0000;">100</span> percent <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">5</span><span style="color: #008000;">/</span><span style="color: #FF0000;">5</span><span style="color: #000000;">&#41;</span>, round<span style="color: #008000;">-</span>trip min<span style="color: #008000;">/</span>avg<span style="color: #008000;">/</span>max <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">/</span><span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">4</span> ms</li></ol></div></pre><!--END_DEVFMTCODE--> </p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show interface tunnel</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Show information relating to the specified tunnel</p>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #008080;">#show interface tunnel 0</span></li><li>&nbsp;</li><li>Tunnel0 <span style="color: #008000;">is</span> up, line protocol <span style="color: #008000;">is</span> up</li><li>&nbsp;&nbsp;Hardware <span style="color: #008000;">is</span> Tunnel</li><li>&nbsp;&nbsp;MTU <span style="color: #FF0000;">1514</span> bytes, BW <span style="color: #FF0000;">9</span> Kbit, DLY <span style="color: #FF0000;">500000</span> usec,</li><li>&nbsp;&nbsp;&nbsp;&nbsp; reliability <span style="color: #FF0000;">255</span><span style="color: #008000;">/</span><span style="color: #FF0000;">255</span>, txload <span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">255</span>, rxload <span style="color: #FF0000;">1</span><span style="color: #008000;">/</span><span style="color: #FF0000;">255</span></li><li>&nbsp;&nbsp;Encapsulation TUNNEL, loopback not set</li><li>&nbsp;&nbsp;Keepalive not set</li><li>&nbsp;&nbsp;Tunnel source 201.2.3.1 <span style="color: #000000;">&#40;</span>FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>, destination 202.3.4.2</li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span>You can see our source and destinations are completely IPv4 based here<span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;Tunnel protocol<span style="color: #008000;">/</span>transport IPv6<span style="color: #008000;">/</span>IP</li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span>You can see that we specified that we will be encapsulating our IPv6 packets within IPv4 Packets here<span style="color: #008000;">!</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;Tunnel TTL <span style="color: #FF0000;">255</span></li><li>&nbsp;&nbsp;Fast tunneling enabled</li><li>&nbsp;&nbsp;Tunnel transmit bandwidth <span style="color: #FF0000;">8000</span> <span style="color: #000000;">&#40;</span>kbps<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;Tunnel receive bandwidth <span style="color: #FF0000;">8000</span> <span style="color: #000000;">&#40;</span>kbps<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;Last input 00<span style="color: #008000;">:</span>00<span style="color: #008000;">:</span>05, output 00<span style="color: #008000;">:</span>00<span style="color: #008000;">:</span>09, output hang never</li><li>&nbsp;&nbsp;Last clearing of <span style="color: #666666;">&quot;show interface&quot;</span> counters never</li><li>&nbsp;&nbsp;Input queue<span style="color: #008000;">:</span> 0<span style="color: #008000;">/</span>75<span style="color: #008000;">/</span>0<span style="color: #008000;">/</span>0 <span style="color: #000000;">&#40;</span>size<span style="color: #008000;">/</span>max<span style="color: #008000;">/</span>drops<span style="color: #008000;">/</span>flushes<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> Total output drops<span style="color: #008000;">:</span> 20</li><li>&nbsp;&nbsp;Queueing strategy<span style="color: #008000;">:</span> fifo</li><li>&nbsp;&nbsp;Output queue<span style="color: #008000;">:</span> 0<span style="color: #008000;">/</span>0 <span style="color: #000000;">&#40;</span>size<span style="color: #008000;">/</span>max<span style="color: #000000;">&#41;</span></li><li>&nbsp;&nbsp;5 minute input rate 0 bits<span style="color: #008000;">/</span>sec, 0 packets<span style="color: #008000;">/</span>sec</li><li>&nbsp;&nbsp;5 minute output rate 0 bits<span style="color: #008000;">/</span>sec, 0 packets<span style="color: #008000;">/</span>sec</li><li>&nbsp;&nbsp;&nbsp;&nbsp; 203 packets input, 24672 bytes, 0 no buffer</li><li>&nbsp;&nbsp;&nbsp;&nbsp; Received 0 broadcasts, 0 runts, 0 giants, 0 throttles</li><li>&nbsp;&nbsp;&nbsp;&nbsp; 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort</li><li>&nbsp;&nbsp;&nbsp;&nbsp; 210 packets output, 21388 bytes, 0 underruns</li><li>&nbsp;&nbsp;&nbsp;&nbsp; 0 output errors, 0 collisions, 0 <span style="color: #FF0000;">interface</span> resets</li><li>&nbsp;&nbsp;&nbsp;&nbsp; 0 output buffer failures, 0 output buffers swapped <span style="color: #0600FF;">out</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong><br />
Solutions</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R1</li><li><span style="color: #008000;">!</span></li><li>ipv6 unicast<span style="color: #008000;">-</span>routing</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback0</li><li> no ip address</li><li> ipv6 address FEC0<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>65</li><li> ipv6 ospf 1 area 0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Tunnel0</li><li> no ip address</li><li> ipv6 address FED0<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>126</li><li> ipv6 ospf 1 area 0</li><li> tunnel source FastEthernet0<span style="color: #008000;">/</span>0</li><li> tunnel destination 202.3.4.2</li><li> tunnel mode ipv6ip</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li> ip address 201.2.3.1 255.255.255.252</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li><span style="color: #008000;">!</span></li><li>ip route 0.0.0.0 0.0.0.0 201.2.3.2</li><li><span style="color: #008000;">!</span></li><li>ipv6 router ospf <span style="color: #FF0000;">1</span></li><li> router<span style="color: #008000;">-</span>id 1.1.1.1</li><li> log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--><br />
<strong>R2</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R2</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li> ip address 201.2.3.2 255.255.255.252</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>1</li><li> ip address 202.3.4.1 255.255.255.252</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R3</li><li><span style="color: #008000;">!</span></li><li>ipv6 unicast<span style="color: #008000;">-</span>routing</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback0</li><li> no ip address</li><li> ipv6 address FEC0<span style="color: #008000;">:</span>F000<span style="color: #008000;">::</span>1<span style="color: #008000;">/</span>65</li><li> ipv6 ospf 1 area 0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Tunnel0</li><li> no ip address</li><li> ipv6 address FED0<span style="color: #008000;">::</span>2<span style="color: #008000;">/</span>126</li><li> ipv6 ospf 1 area 0</li><li> tunnel source FastEthernet0<span style="color: #008000;">/</span>1</li><li> tunnel destination 201.2.3.1</li><li> tunnel mode ipv6ip</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>1</li><li> ip address 202.3.4.2 255.255.255.252</li><li> duplex <span style="color: #0600FF;">auto</span></li><li> speed <span style="color: #0600FF;">auto</span></li><li><span style="color: #008000;">!</span></li><li>ip route 0.0.0.0 0.0.0.0 202.3.4.1</li><li><span style="color: #008000;">!</span></li><li>ipv6 router ospf <span style="color: #FF0000;">1</span></li><li> router<span style="color: #008000;">-</span>id 3.3.3.3</li><li> log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Copyright © 2008 dch-it.com. All Rights Reserved.</p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/cisco/ipv6-to-ipv6-%e2%80%93-tunneling-through-ipv4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>md5 SSL Certificates&#8230;not so secure?</title>
		<link>http://dch-it.com/security/md5-ssl-certificates-not-so-secure</link>
		<comments>http://dch-it.com/security/md5-ssl-certificates-not-so-secure#comments</comments>
		<pubDate>Wed, 31 Dec 2008 06:28:42 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=96</guid>
		<description><![CDATA[At a recent conference, it was announced that a group of researchers have been successful in creating bogus SSL certificates that will look legitimate to your browser. They did this through something known as md5 collisions. When SSL certificates are made, part of the process is creating an md5 hash associated with that certificate. Then, [...]]]></description>
			<content:encoded><![CDATA[<p>At a recent conference, it was announced that a group of researchers have been successful in creating bogus SSL certificates that will look legitimate to your browser.  They did this through something known as md5 collisions.  When SSL certificates are made, part of the process is creating an md5 hash associated with that certificate.  Then, when you visit say amazon.com, your browser (the client) can check a locally generated hash against the certificate to confirm validity.</p>
<p>The problem with that is these hashes are NOT unique.  There are &#8220;collisions&#8221; that can occur; two completely different files or strings or in this case certificates can have identical hashes.  Through some massive computing power, researchers were able to create certificates that mimic the valid hash of certain websites which to say the least is dangerous for anyone visiting a compromised website.  You could be redirected to a phishing website for your local bank and it would still look completely legitimate, SSL certificate and all.</p>
<p>People, this is why we have advancements in security.  MD5 is a very old technology, and though still a good technology, it has been replaced by newer and better hash functions such as SHA-1 and SHA-2 to name a couple.  Using MD5 to me is like saying that DES-56 encryption is good enough when you have AES-256 available to you.  It is insanity for the websites that are dealing with the very security of our personal and financial information to not be using the latest and greatest technology.</p>
<p> To check out the presentation given at this conference, go <a href="http://events.ccc.de/congress/2008/Fahrplan/attachments/1251_md5-collisions-1.0.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/security/md5-ssl-certificates-not-so-secure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Disks on a Laptop</title>
		<link>http://dch-it.com/microsoft/dynamic-disks-on-a-laptop</link>
		<comments>http://dch-it.com/microsoft/dynamic-disks-on-a-laptop#comments</comments>
		<pubDate>Tue, 30 Dec 2008 06:09:57 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows Server 2003]]></category>
		<category><![CDATA[dynamic disk]]></category>
		<category><![CDATA[server 2003]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=83</guid>
		<description><![CDATA[So a couple of months ago, the company I work for was interested in using a domain controller at a fairly large and important event that we conduct yearly. The idea was that rather than having to do last minute changes on about 120 laptops to accommodate various groups or needs, we could just push [...]]]></description>
			<content:encoded><![CDATA[<p>So a couple of months ago, the company I work for was interested in using a domain controller at a fairly large and important event that we conduct yearly.  The idea was that rather than having to do last minute changes on about 120 laptops to accommodate various groups or needs, we could just push out any changes needed via group policy and save oodles of time.  To keep things nice and mobile, we decided that a ThinkPad T61 would make an awfully nice mobile domain controller.  We even threw in a second SATA drive into a removable tray so that we could have RAID-1 on our mobile DC.  And that is when we hit the first snag.</p>
<p>Apparently, Microsoft deems it dangerous to be able to create dynamic disks and/or RAID arrays on laptops due to the &#8220;removable&#8221; nature of the media.  In all fairness, I don&#8217;t really blame them &#8211; who in their right mind would set up a RAID array using a removable drive on a laptop?  Well, that&#8217;s exactly what we needed to do.  <span id="more-83"></span>Here&#8217;s how we did it:</p>
<p>If you search Microsoft&#8217;s website for a few minutes (hint: laptop dynamic disk) you will get a bunch of results, none exactly telling you what you need.  If you look a bit closer, you&#8217;ll notice <a href="http://support.microsoft.com/kb/234308">this</a> article entitled &#8220;Laptop May Incorrectly have Option to Upgrade Basic Disks to Dynamic&#8221;.  Whoa, wait a second here.  The wheels turned in my head for about 5 seconds and then I thought to myself &#8220;why not just do the opposite of what this kbase says and purposely break my laptop to get what I want?&#8221;.  Sure enough the clouds parted and I was able to have my mobile RAID array.  It is fully functional and completely reliable &#8211; I tested every possible variation of purposefully corrupting data or accidentally ripping out the drive, but the worst that happened was needing to rebuild the array from the surviving disk as intended.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Here&#8217;s the resolution text from Microsoft&#8217;s website to save you a few seconds.  Just do the opposite of what it says to do.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.</p>
<p>To disable the &#8220;Upgrade to Dynamic Disk&#8221; command, use the following steps.</p>
<p>NOTE: If you have already created any Dynamic disks, delete any volumes on the Dynamic disks and revert them to Basic disks before continuing.</p>
<p>   1. Start Registry Editor (Regedt32.exe).<br />
   2. Locate the Start value under the following key:<br />
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmload<br />
   3. On the Edit menu, click Modify.<br />
   4. Change the data value from 0&#215;0 (boot) to 0&#215;4 (disabled), and then click OK.<br />
   5. Quit Registry Editor, and then restart the computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/microsoft/dynamic-disks-on-a-laptop/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi Protocol Label Switching (MPLS) VPN</title>
		<link>http://dch-it.com/cisco/mpls-vpn</link>
		<comments>http://dch-it.com/cisco/mpls-vpn#comments</comments>
		<pubDate>Tue, 30 Dec 2008 05:54:49 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[bgp]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[mpls]]></category>
		<category><![CDATA[mpls vpn]]></category>
		<category><![CDATA[vrf]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=103</guid>
		<description><![CDATA[Challenge Lab #1 &#8211; MPLS VPN . Overview: . A customer at XYZ corporation has just asked you, an engineer at HyperGlobalMegaCorp Regional ISP, to set him up a tunneled VPN connection between two of their sites. The problem is that somehow both XYZ and ABC corporations use the same exact IP addressing scheme, so [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Challenge Lab #1</strong> &#8211; MPLS VPN</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Overview:</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>A customer at XYZ corporation has just asked you, an engineer at HyperGlobalMegaCorp Regional ISP, to set him up a tunneled VPN connection between two of their sites. The problem is that somehow both XYZ and ABC corporations use the same exact IP addressing scheme, so they need to somehow accommodate that. You&#8217;ve been tasked with researching and implementing MPLS VPNs and VRF in order to accommodate both their security and IP addressing needs.<br />
<span id="more-103"></span></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Technologies:</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>VRF:</strong></p>
<p>Virtual Routing and Forwarding is a virtualization technology that is used to segment one physical router into two or more logical routers. This is very similar to running software such as VMWare or Microsoft Virtual PC, but on a router. The routing and IP tables contained in each of these logical routers do not communicate with other logical routers. This means that a router can route the same IP address space in completely different ways; this is useful with RFC1918 for example. In order to accomplish this, VRF uses a Route Distinguisher that is configured by the administrator. This will allow for similar routes to become unique. This will become clearer as you progress through the lab. You may also set route-target exports/imports which will send or receive information with the specified BGP extended community. This will come into play when we set up BGP for communication. You may have multiple import and export rules.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>MPLS:</strong></p>
<p>MPLS, or Multi Protocol Label Switching, is a recent type of transport technology that is eventually intended to replace both ATM and Frame Relay due to it&#8217;s enhanced capabilities for simplicity, efficiency, and to still be able to handle the Quality of Service (QoS) need of companies in order to keep time and bandwidth sensitive applications running properly. By applying a label to each route and pre-generating where each label is sent to, speed and efficiency is greatly increased. These labels can either be statically defined or dynamically generated.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Tasks:</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Feel free to skip around. It may be logically easier for you to configure BGP after everything else is set up for example.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>**You may need to create VLANs or trunks depending on your physical connections in order to create this logical topology.**</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1</strong></p>
<ul>
<li>Enable Cisco Express Forwarding. This is required for MPLS to function because the MPLS tags are actually based on the information in the CEF FIB Table, not the routing table itself.</li>
<li>Configure VRF ABC. Utilize a route distinguisher of 100:1. Configure a route target import of 100:1, and a route target export of 100:4. These values are arbitrary, but it makes sense to give them a context. Company 100, router 4 for example.</li>
<li>Configure VRF XYZ. Utilize a route distinguisher of 200:1. Configure a route target import of 200:1, and a route target export of 200:4.</li>
<li>Configure all of the interfaces. Be sure to enable MPLS on F0/0, and put Lo0 and Lo1 in their corresponding VRFs.</li>
<li>Enable OSPF Area 0 on Lo2 and F0/0. These two interfaces are part of the Provider network, so we need to run an IGP to have internal connectivity.</li>
<li>Configure BGP AS 1. Disable normal BGP IPv4 unicast connectivity. Create a neighbor relationship with R4 utilizing the 4.4.4.4 address, and be sure to source the updates from Lo2. Enter the configuration mode for the VPNv4 address family. Activate the 4.4.4.4 neighbor, and also send the extended community information to it. Enter the configuration mode for the IPv4 VRF XYZ. Disable synchronization, and redistribute the connected interfaces. This will only enter Lo0 into BGP since it is the only interface configured for VRF XYZ. Repeat these steps for VRF ABC.</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2/R3</strong></p>
<ul>
<li>Enable Cisco Express Forwarding. This is required for MPLS to function.</li>
<li>Configure the two FastEthernet Interfaces, and enable MPLS on them.</li>
<li>Enable OSPF Area 0 on both interfaces.</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R4</strong></p>
<ul>
<li>Enable Cisco Express Forwarding. This is required for MPLS to function.</li>
<li>Configure VRF ABC. Utilize a route distinguisher of 100:1. Configure a route target import of 100:4, and a route target export of 100:1.</li>
<li>Configure VRF XYZ. Utilize a route distinguisher of 200:1. Configure a route target import of 200:4, and a route target export of 200:1.</li>
<li>Configure all of the interfaces. Be sure to enable MPLS on F0/0, and put Lo0 and Lo1 in their corresponding VRFs.</li>
<li>Enable OSPF Area 0 on Lo2 and F0/0. These two interfaces are part of the Provider network, so we need to run an IGP to have internal connectivity.</li>
<li>Configure BGP AS 1. Disable normal BGP IPv4 unicast connectivity. Create a neighbor relationship with R1 utilizing the 1.1.1.1 address, and be sure to source the updates from Lo2. Enter the configuration mode for the VPNv4 address family. Activate the 1.1.1.1 neighbor, and also send the extended community information to it. Enter the configuration mode for the IPv4 VRF XYZ. Disable synchronization, and redistribute the connected interfaces. This will only enter Lo0 into BGP since it is the only interface configured for VRF XYZ. Repeat these steps for VRF ABC.10</li>
</ul>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Logical Topology</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><a href="http://dch-it.com/wp-content/uploads/2010/04/mpls_vpn_lab.jpg"><img src="http://dch-it.com/wp-content/uploads/2010/04/mpls_vpn_lab.jpg" alt="MPLS VPN Lab Logical Topology" title="mpls_vpn_lab" width="655" height="372" class="alignnone size-full wp-image-105" /></a></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Walkthrough</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>One of the prerequisites for MPLS to be able to function is to have CEF (Cisco Express Forwarding) enabled on the router, so we will do this before taking any further steps. This is because CEF provides the fast performance of fast switching caches and yet provides resilience because it relies on information pulled directly from the IP Routing tables via the CEF FIB, rather than cached information.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip cef</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now, let’s create a new VRF for one of our companies, ABC. We’ll call the VRF “ABC” to keep it simple.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf ABC</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we’ll define the route distinguisher which is what is prepended to the 32bit IPv4 addresses of the VRF to create truly unique addresses, even when the same RFC1918 addresses are in use on other VRFs.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;"># rd 100:1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s define the extended import and export communities that we will be using with BGP. Although not shown in this example, this would be used if we wanted to attach other information to the traffic such as QoS or different local preferences. Again we are defining this for ABC which we assigned as company 200, and we are defining that we want to import the community designated for R1, and export the community designated for R4.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target import 100:1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target export 100:4</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s repeat these steps again to create the VRF for company XYZ</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf XYZ</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#rd 200:1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target import 200:1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target export 200:4</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s configure the interfaces that are part of the provider network now. Both Loopback2 and FastEthernet0/0 are a part of this, so each will be added to OSPF Area 0. We will also define the router-id for R1 as 1.1.1.1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback2</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router ospf 1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 1.1.1.1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will enable MPLS connectivity on FastEthernet0/0 which is where we want the MPLS connectivity to begin.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#mpls ip</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now that we have the provider interfaces configured, we need to set up the two Loopback interfaces that will represent our customers. Lets start with customer ABC which will utilize Loopback0.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Notice that we have to define the VRF before applying an IP address. If we define an IP address before the VRF, then it will be deleted when the VRF is applied.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf forwarding ABC</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip address 192.168.10.1 255.255.255.0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will repeat these steps for company XYZ. We are allowed to have duplicate IP addresses because the two “companies” utilize different VRFs.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback1</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf forwarding XYZ</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip address 192.168.10.1 255.255.255.0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Our VRFs are all completely set up now. Let’s configure our BGP instance so that we will be able to pass routing information between the edge routers for our customers. We will utilize BGP AS 1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router bgp 1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>The first thing we will do is disable normal BGP IPv4 unicast connectivity. We aren’t going to configure it for normal connectivity, and we don’t even want this type of traffic to flow between the routers, so it is best to explicitly disable it.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no bgp default ipv4-unicast</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We are going to be peering with R4 using it’s Loopback2 address of 4.4.4.4 in AS 1</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 4.4.4.4 remote-as 1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We are also going to define that our updates will be sourced from our own Loopback2. This will make it so that the next hop is defined as our Loopback2, rather than the physical interface that the packet is actually sent out.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 4.4.4.4 update-source Loopback2</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now, we are going to define the VPNv4 family, which is what will facilitate communication internally in our MPLS VPNs.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#address-family vpnv4</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s enable the exchange of information for the neighbor adjacency for this address-family and send our configured communities to them.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 4.4.4.4 activate</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 4.4.4.4 send-community both</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Finally, let’s configure what we want to send to our neighbor routers in each VRF. Let’s start with VRF ABC.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#address-family ipv4 vrf ABC</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We will disable synchronization so that the routes we are advertising in our iBGP setup don’t need to be in an IGP routing table to be exchanged</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no synchronization</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will redistribute our connected interfaces. We can either do this or define a network statement, either will have the same effect in this example. When we redistribute connected interfaces, it will only affect Lo0 since it is the only interface in VRF ABC.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#redistributed connected</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s repeat these steps for VRF XYZ.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#address-family ipv4 vrf XYZ</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no synchronization</span></li><li>R1<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#redistribute connected</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>And we’re done on R1!</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>R2 is simply an internal router of the ISP, so it does not need to have any knowledge of the customer’s networks or BGP. All it needs to do is help provide end to end IP and MPLS connectivity.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>As before, we need to first enable CEF as a prerequisite to running MPLS.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip cef</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s put both FastEthernet interfaces into OSPF Area 0 and enable MPLS on both interfaces</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#mpls ip</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#mpls ip</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Finally, let’s define the router id for R2 as 2.2.2.2</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router ospf 1</span></li><li>R2<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 2.2.2.2</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>That’s it for R2!</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong><br />
R3</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>R3 is simply an internal router of the ISP, so it does not need to have any knowledge of the customer’s networks or BGP. All it needs to do is help provide end to end IP and MPLS connectivity.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>As before, we need to first enable CEF as a prerequisite to running MPLS.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip cef</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s put both FastEthernet interfaces into OSPF Area 0 and enable MPLS on both interfaces</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#mpls ip</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/1</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#mpls ip</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Finally, let’s define the router id for R3 as 3.3.3.3</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router ospf 1</span></li><li>R3<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 3.3.3.3</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>That’s it for R3!</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R4</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>First, we have to again enable CEF on the router before enabling MPLS.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip cef</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now, let’s create a new VRF for company ABC.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf ABC</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we’ll define the route distinguisher used for ABC, just as we did on R1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;"># rd 200:1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s define the extended import and export communities that we will be using with BGP. Notice that this time we are reversing what we are importing and exporting. This is so that we import the information targeted for R4, and export information for R1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target import 100:4</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target export 100:1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s repeat these steps again to create the VRF for company XYZ</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf XYZ</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#rd 200:1</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target import 200:4</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>vrf<span style="color: #000000;">&#41;</span><span style="color: #008080;">#route-target export 200:1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s configure the interfaces that are part of the provider network now. Both Loopback2 and FastEthernet0/0 are a part of this, so each will be added to OSPF Area 0. We will also define the router-id for R4 as 4.4.4.4</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback2</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip ospf 1 area 0</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router ospf 1</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router-id 4.4.4.4</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will enable MPLS connectivity on FastEthernet0/0 which is where we want the MPLS connectivity to begin.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface FastEthernet0/0</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#mpls ip</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now that we have the provider interfaces configured, we need to set up the two Loopback interfaces that will represent our customers. Lets start with customer ABC which will utilize Loopback0.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Notice that we have to define the VRF before applying an IP address. If we define an IP address before the VRF, then it will be deleted when the VRF is applied.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf forwarding ABC</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip address 192.168.10.1 255.255.255.0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will repeat these steps for company XYZ. We are allowed to have duplicate IP addresses because the two “companies” utilize different VRFs.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#interface Loopback1</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip vrf forwarding XYZ</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span><span style="color: #0600FF;">if</span><span style="color: #000000;">&#41;</span><span style="color: #008080;">#ip address 192.168.10.1 255.255.255.0</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Our VRFs are all completely set up now. Let’s configure our BGP instance so that we will be able to pass routing information between the edge routers for our customers. We will utilize BGP AS 1.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #000000;">&#41;</span><span style="color: #008080;">#router bgp 1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>The first thing we will do is disable normal BGP IPv4 unicast connectivity. We aren’t going to configure it for normal connectivity, and we don’t even want this type of traffic to flow between the routers, so it is best to explicitly disable it.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no bgp default ipv4-unicast</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We are going to be peering with R1 using it’s Loopback2 address of 1.1.1.1 in AS 1</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 1.1.1.1 remote-as 1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We are also going to define that our updates will be sourced from our own Loopback2. This will make it so that the next hop is defined as our Loopback2, rather than the physical interface that the packet is actually sent out.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 1.1.1.1 update-source Loopback2</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now, we are going to define the VPNv4 family, which is what will facilitate communication internally in our MPLS VPNs.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#address-family vpnv4</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Let’s enable the exchange of information for the neighbor adjacency for this address-family and send our configured communities to them.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 1.1.1.1 activate</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#neighbor 1.1.1.1 send-community both</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Finally, let’s configure what we want to send to our neighbor routers in each VRF. Let’s star with VRF ABC.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#address-family ipv4 vrf ABC</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>We will disable synchronization so that the routes we are advertising in our iBGP setup don’t need to be in an IGP routing table to be exchanged</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no synchronization</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now we will redistribute our connected interfaces. We can either do this or define a network statement, either will have the same effect in this example. When we redistribute connected interfaces, it will only affect Lo0 since it is the only interface in VRF ABC.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#redistributed connected</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Now let’s repeat these steps for VRF XYZ.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #000000;">&#41;</span><span style="color: #008080;">#address-family ipv4 vrf XYZ</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#no synchronization</span></li><li>R4<span style="color: #000000;">&#40;</span>config<span style="color: #008000;">-</span>router<span style="color: #008000;">-</span>af<span style="color: #000000;">&#41;</span><span style="color: #008080;">#redistribute connected</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>And that’s it!</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Testing and Debug Commands</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show ip route vrf</strong></p>
<p>Show the routing table for a specific VRF</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #008080;">#show ip route vrf XYZ</span></li><li>Routing Table<span style="color: #008000;">:</span> XYZ</li><li><span style="color: #000000;">&#40;</span>Notice how it <span style="color: #008000;">is</span> displaying only the routing table <span style="color: #0600FF;">for</span> VRF XYZ<span style="color: #000000;">&#41;</span></li><li>Codes<span style="color: #008000;">:</span> C <span style="color: #008000;">-</span> connected, S <span style="color: #008000;">-</span> <span style="color: #0600FF;">static</span>, R <span style="color: #008000;">-</span> RIP, M <span style="color: #008000;">-</span> mobile, B <span style="color: #008000;">-</span> BGP</li><li>D <span style="color: #008000;">-</span> EIGRP, EX <span style="color: #008000;">-</span> EIGRP external, O <span style="color: #008000;">-</span> OSPF, IA <span style="color: #008000;">-</span> OSPF inter area</li><li>N1 <span style="color: #008000;">-</span> OSPF NSSA external type 1, N2 <span style="color: #008000;">-</span> OSPF NSSA external type 2</li><li>E1 <span style="color: #008000;">-</span> OSPF external type 1, E2 <span style="color: #008000;">-</span> OSPF external type 2</li><li>i <span style="color: #008000;">-</span> IS<span style="color: #008000;">-</span><span style="color: #008000;">IS</span>, su <span style="color: #008000;">-</span> IS<span style="color: #008000;">-</span><span style="color: #008000;">IS</span> summary, L1 <span style="color: #008000;">-</span> IS<span style="color: #008000;">-</span><span style="color: #008000;">IS</span> level<span style="color: #008000;">-</span>1, L2 <span style="color: #008000;">-</span> IS<span style="color: #008000;">-</span><span style="color: #008000;">IS</span> level<span style="color: #008000;">-</span>2</li><li>ia <span style="color: #008000;">-</span> IS<span style="color: #008000;">-</span><span style="color: #008000;">IS</span> inter area, <span style="color: #008000;">*</span> <span style="color: #008000;">-</span> candidate <span style="color: #0600FF;">default</span>, U <span style="color: #008000;">-</span> per<span style="color: #008000;">-</span>user <span style="color: #0600FF;">static</span> route</li><li>o <span style="color: #008000;">-</span> ODR, P <span style="color: #008000;">-</span> periodic downloaded <span style="color: #0600FF;">static</span> route</li><li>&nbsp;</li><li>Gateway of last resort <span style="color: #008000;">is</span> not set</li><li>&nbsp;</li><li>B 192.168.10.0<span style="color: #008000;">/</span>24 <span style="color: #000000;">&#91;</span>200<span style="color: #008000;">/</span>0<span style="color: #000000;">&#93;</span> via 1.1.1.1, 00<span style="color: #008000;">:</span>00<span style="color: #008000;">:</span>23</li><li>C 192.168.1.0<span style="color: #008000;">/</span>24 <span style="color: #008000;">is</span> directly connected, Loopback1</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>ping vrf</strong></p>
<p>Ping an IP address in a specific VRF</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #008080;">#ping vrf ABC 192.168.10.1</span></li><li>&nbsp;</li><li>Type escape sequence to abort.</li><li><span style="color: #0000FF;">Sending</span> 5, 100<span style="color: #008000;">-</span><span style="color: #FF0000;">byte</span> ICMP Echos to 192.168.10.1, timeout <span style="color: #008000;">is</span> 2 seconds<span style="color: #008000;">:</span></li><li><span style="color: #008000;">!!!!!</span></li><li>Success rate <span style="color: #008000;">is</span> <span style="color: #FF0000;">100</span> percent <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">5</span><span style="color: #008000;">/</span><span style="color: #FF0000;">5</span><span style="color: #000000;">&#41;</span>, round<span style="color: #008000;">-</span>trip min<span style="color: #008000;">/</span>avg<span style="color: #008000;">/</span>max <span style="color: #008000;">=</span> <span style="color: #FF0000;">4</span><span style="color: #008000;">/</span><span style="color: #FF0000;">4</span><span style="color: #008000;">/</span><span style="color: #FF0000;">4</span> ms</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show mpls forwarding-table</strong></p>
<p>Show the MPLS forwarding table. See the different types of tags and the labels. Be sure to note how when the packet reaches the directly connected interface, the final label is popped off.</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #008080;">#show mpls forwarding-table</span></li><li>Local Outgoing Prefix Bytes tag Outgoing Next Hop</li><li>tag tag or VC or Tunnel Id switched <span style="color: #FF0000;">interface</span></li><li><span style="color: #FF0000;">16</span> Aggregate 192.168.1.0<span style="color: #008000;">/</span><span style="color: #FF0000;">24</span><span style="color: #000000;">&#91;</span>V<span style="color: #000000;">&#93;</span> <span style="color: #FF0000;">1560</span></li><li><span style="color: #FF0000;">17</span> Aggregate 192.168.1.0<span style="color: #008000;">/</span><span style="color: #FF0000;">24</span><span style="color: #000000;">&#91;</span>V<span style="color: #000000;">&#93;</span> <span style="color: #FF0000;">1248</span></li><li><span style="color: #000000;">&#40;</span>Even though the two VRF networks are the “same”, they are assigned different tags<span style="color: #008000;">!</span><span style="color: #000000;">&#41;</span></li><li><span style="color: #FF0000;">18</span> Pop tag 10.0.0.4<span style="color: #008000;">/</span><span style="color: #FF0000;">30</span> <span style="color: #FF0000;">0</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span> 10.0.0.9</li><li><span style="color: #FF0000;">19</span> <span style="color: #FF0000;">17</span> 1.1.1.1<span style="color: #008000;">/</span><span style="color: #FF0000;">32</span> <span style="color: #FF0000;">0</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span> 10.0.0.9</li><li><span style="color: #FF0000;">20</span> <span style="color: #FF0000;">18</span> 10.0.0.0<span style="color: #008000;">/</span><span style="color: #FF0000;">30</span> <span style="color: #FF0000;">0</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span> 10.0.0.9</li></ol></div></pre><!--END_DEVFMTCODE-->
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show mpls ldp bindings</strong></p>
<p>Show the LDP bindings for each of the known addresses</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #008080;">#show mpls ldp bindings</span></li><li>tib entry<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">/</span>32, rev 8</li><li>local binding<span style="color: #008000;">:</span> tag<span style="color: #008000;">:</span> 19</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.2<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 16</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.9<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 17</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>tib entry<span style="color: #008000;">:</span> 4.4.4.4<span style="color: #008000;">/</span>32, rev 2</li><li>local binding<span style="color: #008000;">:</span> tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.9<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 16</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.2<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 17</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 20</li><li>tib entry<span style="color: #008000;">:</span> 10.0.0.0<span style="color: #008000;">/</span>30, rev 10</li><li>local binding<span style="color: #008000;">:</span> tag<span style="color: #008000;">:</span> 20</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.2<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.9<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 18</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>tib entry<span style="color: #008000;">:</span> 10.0.0.4<span style="color: #008000;">/</span>30, rev 6</li><li>local binding<span style="color: #008000;">:</span> tag<span style="color: #008000;">:</span> 18</li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.9<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.2<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> 16</li><li>tib entry<span style="color: #008000;">:</span> 10.0.0.8<span style="color: #008000;">/</span>30, rev 4</li><li>local binding<span style="color: #008000;">:</span> tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.9<span style="color: #008000;">:</span>0, tag<span style="color: #008000;">:</span> imp<span style="color: #008000;">-</span><span style="color: #0600FF;">null</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 10.0.0.2<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span>, tag<span style="color: #008000;">:</span> <span style="color: #FF0000;">18</span></li><li>remote binding<span style="color: #008000;">:</span> tsr<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span>, tag<span style="color: #008000;">:</span> <span style="color: #FF0000;">21</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>show mpls ldp neighbor</strong></p>
<p>Show the LDP neighbors</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #008080;">#show mpls ldp neighbor</span></li><li>Peer LDP Ident<span style="color: #008000;">:</span> 10.0.0.9<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> Local LDP Ident 4.4.4.4<span style="color: #008000;">:</span>0</li><li>TCP connection<span style="color: #008000;">:</span> 10.0.0.9.14725 <span style="color: #008000;">-</span> 4.4.4.4.646</li><li>State<span style="color: #008000;">:</span> Oper<span style="color: #008000;">;</span> Msgs sent<span style="color: #008000;">/</span>rcvd<span style="color: #008000;">:</span> 36<span style="color: #008000;">/</span><span style="color: #FF0000;">37</span><span style="color: #008000;">;</span> Downstream</li><li>Up time<span style="color: #008000;">:</span> 00<span style="color: #008000;">:</span>25<span style="color: #008000;">:</span>14</li><li>LDP discovery sources<span style="color: #008000;">:</span></li><li>FastEthernet0<span style="color: #008000;">/</span>0, Src IP addr<span style="color: #008000;">:</span> 10.0.0.9</li><li>FastEthernet0<span style="color: #008000;">/</span>0, Src IP addr<span style="color: #008000;">:</span> 10.0.0.6</li><li>Addresses bound to peer LDP Ident<span style="color: #008000;">:</span></li><li>10.0.0.9 10.0.0.6</li><li>Peer LDP Ident<span style="color: #008000;">:</span> 10.0.0.2<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> Local LDP Ident 4.4.4.4<span style="color: #008000;">:</span>0</li><li>TCP connection<span style="color: #008000;">:</span> 10.0.0.2.38070 <span style="color: #008000;">-</span> 4.4.4.4.646</li><li>State<span style="color: #008000;">:</span> Oper<span style="color: #008000;">;</span> Msgs sent<span style="color: #008000;">/</span>rcvd<span style="color: #008000;">:</span> 32<span style="color: #008000;">/</span><span style="color: #FF0000;">31</span><span style="color: #008000;">;</span> Downstream</li><li>Up time<span style="color: #008000;">:</span> 00<span style="color: #008000;">:</span>20<span style="color: #008000;">:</span>32</li><li>LDP discovery sources<span style="color: #008000;">:</span></li><li>FastEthernet0<span style="color: #008000;">/</span>0, Src IP addr<span style="color: #008000;">:</span> 10.0.0.5</li><li>FastEthernet0<span style="color: #008000;">/</span>0, Src IP addr<span style="color: #008000;">:</span> 10.0.0.2</li><li>Addresses bound to peer LDP Ident<span style="color: #008000;">:</span></li><li>10.0.0.2 10.0.0.5</li><li>Peer LDP Ident<span style="color: #008000;">:</span> 1.1.1.1<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> Local LDP Ident 4.4.4.4<span style="color: #008000;">:</span>0</li><li>TCP connection<span style="color: #008000;">:</span> 1.1.1.1.646 <span style="color: #008000;">-</span> 4.4.4.4.59004</li><li>State<span style="color: #008000;">:</span> Oper<span style="color: #008000;">;</span> Msgs sent<span style="color: #008000;">/</span>rcvd<span style="color: #008000;">:</span> 30<span style="color: #008000;">/</span><span style="color: #FF0000;">31</span><span style="color: #008000;">;</span> Downstream</li><li>Up time<span style="color: #008000;">:</span> 00<span style="color: #008000;">:</span><span style="color: #FF0000;">20</span><span style="color: #008000;">:</span><span style="color: #FF0000;">28</span></li><li>LDP discovery sources<span style="color: #008000;">:</span></li><li>FastEthernet0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span>, Src IP addr<span style="color: #008000;">:</span> 10.0.0.1</li><li>Addresses bound to peer LDP Ident<span style="color: #008000;">:</span></li><li>10.0.0.1 1.1.1.1</li></ol></div></pre><!--END_DEVFMTCODE-->
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>debug mpls packets</strong></p>
<p>Enable debugging of MPLS packets. Enable this on either R2 or R3, then ping from one end of a company to the other. See how it recognizes the labels are received and how it resends it back out. If it is destined for a directly connected interface, the last label is popped off and you will see an xmit: (no label)</p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p>Example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>R4<span style="color: #008080;">#debug mpls packets</span></li><li><span style="color: #008000;">*</span>Apr 17 19<span style="color: #008000;">:</span>54<span style="color: #008000;">:</span>43.643<span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span>0<span style="color: #008000;">:</span> recvd<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span>6, TTL<span style="color: #008000;">=</span>255, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span>18</li><li><span style="color: #008000;">*</span>Apr 17 19<span style="color: #008000;">:</span>54<span style="color: #008000;">:</span>43.643<span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span>1<span style="color: #008000;">:</span> xmit<span style="color: #008000;">:</span> <span style="color: #000000;">&#40;</span>no label<span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">This</span> was generated by an ICMP echo from R1. <span style="color: #0000FF;">Notice</span> how the incoming Label <span style="color: #008000;">is</span> 18 </li><li>which we know <span style="color: #008000;">is</span> the “pop” label. <span style="color: #0000FF;">It</span> <span style="color: #008000;">is</span> then sent <span style="color: #0600FF;">out</span> the other <span style="color: #FF0000;">interface</span> with no label </li><li>at all to its final destination<span style="color: #008000;">!</span><span style="color: #000000;">&#41;</span></li><li>&nbsp;</li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">19</span><span style="color: #008000;">:</span><span style="color: #FF0000;">54</span><span style="color: #008000;">:</span><span style="color: #FF0000;">43.843</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span><span style="color: #008000;">:</span> recvd<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span><span style="color: #FF0000;">6</span>, TTL<span style="color: #008000;">=</span><span style="color: #FF0000;">255</span>, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span><span style="color: #FF0000;">16</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">19</span><span style="color: #008000;">:</span><span style="color: #FF0000;">54</span><span style="color: #008000;">:</span><span style="color: #FF0000;">43.843</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">:</span> xmit<span style="color: #008000;">:</span> <span style="color: #000000;">&#40;</span>no label<span style="color: #000000;">&#41;</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">19</span><span style="color: #008000;">:</span><span style="color: #FF0000;">54</span><span style="color: #008000;">:</span><span style="color: #FF0000;">44.999</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span><span style="color: #008000;">:</span> recvd<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span><span style="color: #FF0000;">6</span>, TTL<span style="color: #008000;">=</span><span style="color: #FF0000;">255</span>, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span><span style="color: #FF0000;">16</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">19</span><span style="color: #008000;">:</span><span style="color: #FF0000;">54</span><span style="color: #008000;">:</span><span style="color: #FF0000;">44.999</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">:</span> xmit<span style="color: #008000;">:</span> <span style="color: #000000;">&#40;</span>no label<span style="color: #000000;">&#41;</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">19</span><span style="color: #008000;">:</span><span style="color: #FF0000;">54</span><span style="color: #008000;">:</span><span style="color: #FF0000;">44.999</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">:</span> recvd<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span><span style="color: #FF0000;">6</span>, TTL<span style="color: #008000;">=</span><span style="color: #FF0000;">255</span>, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span><span style="color: #FF0000;">18</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">19</span><span style="color: #008000;">:</span><span style="color: #FF0000;">54</span><span style="color: #008000;">:</span><span style="color: #FF0000;">44.999</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span><span style="color: #008000;">:</span> xmit<span style="color: #008000;">:</span> <span style="color: #000000;">&#40;</span>no label<span style="color: #000000;">&#41;</span><span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">:</span> xmit<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span><span style="color: #FF0000;">0</span>, TTL<span style="color: #008000;">=</span><span style="color: #FF0000;">253</span>, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span><span style="color: #FF0000;">18</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">20</span><span style="color: #008000;">:</span>04<span style="color: #008000;">:</span><span style="color: #FF0000;">06.223</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">0</span><span style="color: #008000;">:</span> recvd<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span><span style="color: #FF0000;">0</span>, TTL<span style="color: #008000;">=</span><span style="color: #FF0000;">255</span>, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span><span style="color: #FF0000;">17</span><span style="color: #008000;">/</span><span style="color: #FF0000;">16</span></li><li><span style="color: #008000;">*</span>Apr <span style="color: #FF0000;">17</span> <span style="color: #FF0000;">20</span><span style="color: #008000;">:</span>04<span style="color: #008000;">:</span><span style="color: #FF0000;">06.223</span><span style="color: #008000;">:</span> MPLS<span style="color: #008000;">:</span> Fa0<span style="color: #008000;">/</span><span style="color: #FF0000;">1</span><span style="color: #008000;">:</span> xmit<span style="color: #008000;">:</span> CoS<span style="color: #008000;">=</span><span style="color: #FF0000;">0</span>, TTL<span style="color: #008000;">=</span><span style="color: #FF0000;">254</span>, Label<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #008000;">=</span><span style="color: #FF0000;">16</span><span style="color: #008000;">/</span><span style="color: #FF0000;">16</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>Solutions</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R1</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R1</li><li><span style="color: #008000;">!</span></li><li>ip cef</li><li><span style="color: #008000;">!</span></li><li>ip vrf ABC</li><li>rd 100<span style="color: #008000;">:</span>1</li><li>route<span style="color: #008000;">-</span>target export 100<span style="color: #008000;">:</span>4</li><li>route<span style="color: #008000;">-</span>target import 100<span style="color: #008000;">:</span>1</li><li><span style="color: #008000;">!</span></li><li>ip vrf XYZ</li><li>rd 200<span style="color: #008000;">:</span>1</li><li>route<span style="color: #008000;">-</span>target export 200<span style="color: #008000;">:</span>4</li><li>route<span style="color: #008000;">-</span>target import 200<span style="color: #008000;">:</span>1</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback0</li><li>ip vrf forwarding ABC</li><li>ip address 192.168.10.1 255.255.255.0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback1</li><li>ip vrf forwarding XYZ</li><li>ip address 192.168.10.1 255.255.255.0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback2</li><li>ip address 1.1.1.1 255.255.255.255</li><li>ip ospf 1 area 0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li>ip address 10.0.0.1 255.255.255.252</li><li>ip ospf 1 area 0</li><li>duplex <span style="color: #0600FF;">auto</span></li><li>speed <span style="color: #0600FF;">auto</span></li><li>mpls ip</li><li><span style="color: #008000;">!</span></li><li>router ospf 1</li><li>router<span style="color: #008000;">-</span>id 1.1.1.1</li><li>log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>router bgp 1</li><li>no bgp <span style="color: #0600FF;">default</span> ipv4<span style="color: #008000;">-</span>unicast</li><li>bgp log<span style="color: #008000;">-</span>neighbor<span style="color: #008000;">-</span>changes</li><li>neighbor 4.4.4.4 remote<span style="color: #008000;">-</span><span style="color: #0600FF;">as</span> <span style="color: #FF0000;">1</span></li><li>neighbor 4.4.4.4 update<span style="color: #008000;">-</span>source Loopback2</li><li><span style="color: #008000;">!</span></li><li>address<span style="color: #008000;">-</span>family vpnv4</li><li>neighbor 4.4.4.4 activate</li><li>neighbor 4.4.4.4 send<span style="color: #008000;">-</span>community both</li><li>exit<span style="color: #008000;">-</span>address<span style="color: #008000;">-</span>family</li><li><span style="color: #008000;">!</span></li><li>address<span style="color: #008000;">-</span>family ipv4 vrf XYZ</li><li>redistribute connected</li><li>no synchronization</li><li>exit<span style="color: #008000;">-</span>address<span style="color: #008000;">-</span>family</li><li><span style="color: #008000;">!</span></li><li>address<span style="color: #008000;">-</span>family ipv4 vrf ABC</li><li>redistribute connected</li><li>no synchronization</li><li>exit<span style="color: #008000;">-</span>address<span style="color: #008000;">-</span>family</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R2</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R2</li><li><span style="color: #008000;">!</span></li><li>ip cef</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li>ip address 10.0.0.2 255.255.255.252</li><li>ip ospf 1 area 0</li><li>duplex <span style="color: #0600FF;">auto</span></li><li>speed <span style="color: #0600FF;">auto</span></li><li>mpls ip</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>1</li><li>ip address 10.0.0.5 255.255.255.252</li><li>ip ospf 1 area 0</li><li>duplex <span style="color: #0600FF;">auto</span></li><li>speed <span style="color: #0600FF;">auto</span></li><li>mpls ip</li><li><span style="color: #008000;">!</span></li><li>router ospf <span style="color: #FF0000;">1</span></li><li>router<span style="color: #008000;">-</span>id 2.2.2.2</li><li>log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R3</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R3</li><li><span style="color: #008000;">!</span></li><li>ip cef</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li>ip address 10.0.0.9 255.255.255.252</li><li>ip ospf 1 area 0</li><li>duplex <span style="color: #0600FF;">auto</span></li><li>speed <span style="color: #0600FF;">auto</span></li><li>mpls ip</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>1</li><li>ip address 10.0.0.6 255.255.255.252</li><li>ip ospf 1 area 0</li><li>duplex <span style="color: #0600FF;">auto</span></li><li>speed <span style="color: #0600FF;">auto</span></li><li>mpls ip</li><li><span style="color: #008000;">!</span></li><li>router ospf <span style="color: #FF0000;">1</span></li><li>router<span style="color: #008000;">-</span>id 3.3.3.3</li><li>log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><strong>R4</strong></p>
<div style="height:1.4em;visibility:hidden;">.</div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="C#"><div class="devcodeoverflow"><ol><li>hostname R4</li><li><span style="color: #008000;">!</span></li><li>ip cef</li><li><span style="color: #008000;">!</span></li><li>ip vrf ABC</li><li>rd 100<span style="color: #008000;">:</span>1</li><li>route<span style="color: #008000;">-</span>target export 100<span style="color: #008000;">:</span>1</li><li>route<span style="color: #008000;">-</span>target import 100<span style="color: #008000;">:</span>4</li><li><span style="color: #008000;">!</span></li><li>ip vrf XYZ</li><li>rd 200<span style="color: #008000;">:</span>1</li><li>route<span style="color: #008000;">-</span>target export 200<span style="color: #008000;">:</span>1</li><li>route<span style="color: #008000;">-</span>target import 200<span style="color: #008000;">:</span>4</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback0</li><li>ip vrf forwarding ABC</li><li>ip address 192.168.1.1 255.255.255.0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback1</li><li>ip vrf forwarding XYZ</li><li>ip address 192.168.1.1 255.255.255.0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> Loopback2</li><li>ip address 4.4.4.4 255.255.255.255</li><li>ip ospf 1 area 0</li><li><span style="color: #008000;">!</span></li><li><span style="color: #FF0000;">interface</span> FastEthernet0<span style="color: #008000;">/</span>0</li><li>ip address 10.0.0.10 255.255.255.252</li><li>ip ospf 1 area 0</li><li>duplex <span style="color: #0600FF;">auto</span></li><li>speed <span style="color: #0600FF;">auto</span></li><li>mpls ip</li><li><span style="color: #008000;">!</span></li><li>router ospf 1</li><li>router<span style="color: #008000;">-</span>id 4.4.4.4</li><li>log<span style="color: #008000;">-</span>adjacency<span style="color: #008000;">-</span>changes</li><li><span style="color: #008000;">!</span></li><li>router bgp 1</li><li>no bgp <span style="color: #0600FF;">default</span> ipv4<span style="color: #008000;">-</span>unicast</li><li>bgp log<span style="color: #008000;">-</span>neighbor<span style="color: #008000;">-</span>changes</li><li>neighbor 1.1.1.1 remote<span style="color: #008000;">-</span><span style="color: #0600FF;">as</span> <span style="color: #FF0000;">1</span></li><li>neighbor 1.1.1.1 update<span style="color: #008000;">-</span>source Loopback2</li><li><span style="color: #008000;">!</span></li><li>address<span style="color: #008000;">-</span>family vpnv4</li><li>neighbor 1.1.1.1 activate</li><li>neighbor 1.1.1.1 send<span style="color: #008000;">-</span>community extended</li><li>exit<span style="color: #008000;">-</span>address<span style="color: #008000;">-</span>family</li><li><span style="color: #008000;">!</span></li><li>address<span style="color: #008000;">-</span>family ipv4 vrf XYZ</li><li>redistribute connected</li><li>no synchronization</li><li>exit<span style="color: #008000;">-</span>address<span style="color: #008000;">-</span>family</li><li><span style="color: #008000;">!</span></li><li>address<span style="color: #008000;">-</span>family ipv4 vrf ABC</li><li>redistribute connected</li><li>no synchronization</li><li>exit<span style="color: #008000;">-</span>address<span style="color: #008000;">-</span>family</li><li><span style="color: #008000;">!</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/cisco/mpls-vpn/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS SRV Entries</title>
		<link>http://dch-it.com/dns/dns-srv-entries</link>
		<comments>http://dch-it.com/dns/dns-srv-entries#comments</comments>
		<pubDate>Mon, 29 Dec 2008 06:26:04 +0000</pubDate>
		<dc:creator>Daniel Herman</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[srv]]></category>

		<guid isPermaLink="false">http://dch-it.com/?p=93</guid>
		<description><![CDATA[So over the past few days, I&#8217;ve been trying to hack together a setup at my home for this website using an old Thinkpad T41 on my cable modem connection (yea&#8230;I didn&#8217;t think I&#8217;d need a ton of bandwidth&#8230;yet!). Of course port 80 and 443 are blocked by default since Optimum Online doesn&#8217;t want us [...]]]></description>
			<content:encoded><![CDATA[<p>So over the past few days, I&#8217;ve been trying to hack together a setup at my home for this website using an old Thinkpad T41 on my cable modem connection (yea&#8230;I didn&#8217;t think I&#8217;d need a ton of bandwidth&#8230;yet!).  Of course port 80 and 443 are blocked by default since Optimum Online doesn&#8217;t want us hosting servers on a non-business account, so I was running this on port 85 and 886 for HTTP and HTTPS respectively.  Simple right?  Yes, up until you try to make DNS work all nice and pretty (a.k.a. no port numbers needed in the address).</p>
<p>An absolutely perfect solution to this dilemma would have been DNS SRV entries.  Or they would have been if any browser in existence supported them.  I can&#8217;t really fathom why they aren&#8217;t supported either.<br />
<span id="more-93"></span><br />
DNS SRV entries are basically entries that map a service to a destination host and port, which is an elegant solution to a problem presented by an outdated paradigm.  Our old method of connectivity revolves around sockets which are a combination of an IP Address and a port.  In this day, who really cares what port a service like HTTP is running on?  If we can recognize that they&#8217;re looking for HTTP, then we can simply do a DNS SRV lookup to find that for the domain dch-it.com, an HTTP server exists over at randomdns.com at port 87 or whatever I had set it up as.  The user will never know that though, all he/she will see is http://dch-it.com as it should be.</p>
<p>It&#8217;s also a very cost efficient (read: FREE) way of load balancing servers.  You can set a priority and weight for each individual SRV entry.  Let&#8217;s ignore priority for the moment since I&#8217;m sure you can figure what that does (if you can&#8217;t, please reference dictionary.com).  Let&#8217;s say we have two HTTP SRV entries with equal priority, and we set one of their weights to be 70 and the other 30.  That means that 70% of DNS queries will be directed to server A, and 30% to server B.  Now isn&#8217;t that much easier than setting up any kind of funky Load Balancing Hardware or a software based solution?  The only downside is that it doesn&#8217;t take the current load of the server into consideration, however most small companies really don&#8217;t have to worry about things like that unless they are heavy into the web business.</p>
<p> So how about it Microsoft or Mozilla?  Who&#8217;s going to be the big man and step up first? </p>
]]></content:encoded>
			<wfw:commentRss>http://dch-it.com/dns/dns-srv-entries/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
