<?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>CiscoZine &#187; Advanced configuration</title>
	<atom:link href="http://www.ciscozine.com/tag/advanced-configuration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ciscozine.com</link>
	<description>Daily reporting on Cisco technology</description>
	<lastBuildDate>Mon, 08 Mar 2010 09:06:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use archive command to save configuration</title>
		<link>http://www.ciscozine.com/2010/01/08/how-to-use-archive-command-to-save-configuration/</link>
		<comments>http://www.ciscozine.com/2010/01/08/how-to-use-archive-command-to-save-configuration/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 07:20:45 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Archive]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=755</guid>
		<description><![CDATA[In a large/critical network, it is fundamental backup the Cisco configuration for two reasons:

Rollback configuration
Restore configuration in case of a broken router

There are two ways to backup: manually (using write command each time that you would save running configuration) or automatically (using software like Ciscoworks, HP OpenView, &#8230; ).
In this tutorial, I would explain a different [...]]]></description>
			<content:encoded><![CDATA[<p>In a large/critical network, it is <strong>fundamental backup</strong> the Cisco configuration for two reasons:</p>
<ul>
<li>Rollback configuration</li>
<li>Restore configuration in case of a broken router</li>
</ul>
<p>There are two ways to backup: manually (using write command each time that you would save running configuration) or automatically (using software like Ciscoworks, HP OpenView, &#8230; ).</p>
<p>In this tutorial, I would explain a different method to backup configuration: the archive command.</p>
<p>Introduced into Cisco IOS Release 12.3(4)T, the archive command permits to <strong>save a copy of the current running</strong> configuration to different path: ftp, http, https, rcp, scp, tftp servers. Moreover the archive command has other features, but in this article I would use only two of these:</p>
<ul>
<li>time-period: it sets the time increment for automatically saving an archive file of the current running configuration in the Cisco IOS configuration archive.</li>
<li>write-memory: it enable automatic backup generation during write memory; for instance, when I use the &#8216;write&#8217; command the archive command will be invoked automatically.</li>
</ul>
<p><span id="more-755"></span><strong> </strong></p>
<p><strong>Example: Implement and test archive command</strong></p>
<p>Suppose to have a network (192.168.217.0/24) with an FTP-Server (.1). It is required to save the running configuration to the FTP-Server each day (1440 minutes). The FTP-Server has an FTP account with username: cisco and password: lab.</p>
<p style="text-align: center;"><a href="http://www.ciscozine.com/wp-content/uploads/Archive.png" target="_blank"><img class="size-full wp-image-756 aligncenter" title="Archive" src="http://www.ciscozine.com/wp-content/uploads/Archive.png" alt="Archive" width="391" height="180" /></a></p>
<p> </p>
<p>First of all, it is required access to the archive configuration mode:</p>
<pre><code>Ciscozine(config)#archive</code></pre>
<p>Now it is possible define the destination path. In this example, I use the FTP protocol to send the running configuration; the name &#8216;$h&#8217; instructs the system to use the router hostname when naming the archived configuration (in this case $h is equal to Ciscozine).</p>
<pre><code>Ciscozine(config-archive)#path ftp://cisco:lab@192.168.217.1/$h</code></pre>
<p>To instruct the router to save the configuration each day (1440 minutes) and to enable automatic backup generation when write memory command is typed, use:</p>
<pre><code>Ciscozine(config-archive)#time-period 1440
Ciscozine(config-archive)#write-memory</code></pre>
<p> </p>
<p>To see how many configurations are been saved use the command &#8217;show archive&#8217;:</p>
<pre><code>Ciscozine#sh archive
The next archive file will be named
                      ftp://cisco:lab@192.168.217.1/Ciscozine-17
Archive #  Name
0       ftp://cisco:lab@192.168.217.1/Ciscozine-15
1       ftp://cisco:lab@192.168.217.1/Ciscozine-16 &lt;- Most Recent
2       ftp://cisco:lab@192.168.217.1/Ciscozine-2
3       ftp://cisco:lab@192.168.217.1/Ciscozine-3
4       ftp://cisco:lab@192.168.217.1/Ciscozine-4
5       ftp://cisco:lab@192.168.217.1/Ciscozine-5
6       ftp://cisco:lab@192.168.217.1/Ciscozine-6
7       ftp://cisco:lab@192.168.217.1/Ciscozine-7
8       ftp://cisco:lab@192.168.217.1/Ciscozine-8
9       ftp://cisco:lab@192.168.217.1/Ciscozine-9
10       ftp://cisco:lab@192.168.217.1/Ciscozine-10
11       ftp://cisco:lab@192.168.217.1/Ciscozine-11
12       ftp://cisco:lab@192.168.217.1/Ciscozine-12
13       ftp://cisco:lab@192.168.217.1/Ciscozine-13
14       ftp://cisco:lab@192.168.217.1/Ciscozine-14
Ciscozine#</code></pre>
<p> </p>
<p>To display the differences between two config files use the &#8217;show archive config differences&#8217;; for instance, to find the differences between the startup-config and the &#8216;Ciscozine-8&#8242; file, type:</p>
<pre><code>NEW-CISCOZINE#show archive config differences nvram:startup-config
    ftp://cisco:lab@192.168.217.1/Ciscozine-8
Loading Ciscozine-8 !
[OK - 717/4096 bytes]

Contextual Config Diffs:
+hostname Ciscozine

-hostname NEW-CISCOZINE
NEW-CISCOZINE#</code></pre>
<p>As you can see, there are two differences: the hostname saved in the startup-configuration file (NEW-CISCOZINE) is different from the Ciscozine-8 file (Ciscozine).</p>
<p> </p>
<p><strong><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="305" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/rGVM3i9S5pE" /><embed type="application/x-shockwave-flash" width="500" height="305" src="http://www.youtube.com/v/rGVM3i9S5pE"> </embed></object></strong></p>
<p><strong> </strong></p>
<p><strong>Remember:</strong> If the router is reloaded, the system will restart to save the configuration with the counter equal to one (for example Ciscozine-1). So the previous configurations will be overwritten!</p>
<p> </p>
<p><strong>References:</strong> <a href="http://www.cisco.com/en/US/docs/ios/12_3t/fun/command/reference/cfrgt_01.html#wp1094403" target="_blank">http://www.cisco.com/&#8230;/cfrgt_01.html#wp1094403</a></p>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2010. |
<a href="http://www.ciscozine.com/2010/01/08/how-to-use-archive-command-to-save-configuration/">Permalink</a> |
<a href="http://www.ciscozine.com/2010/01/08/how-to-use-archive-command-to-save-configuration/#comments">One comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/archive/" rel="tag">Archive</a>, <a href="http://www.ciscozine.com/tag/video/" rel="tag">Video</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2010/01/08/how-to-use-archive-command-to-save-configuration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Slow ADSL with 12.4 IOS version?!</title>
		<link>http://www.ciscozine.com/2009/11/05/slow-adsl-with-12-4-ios-version/</link>
		<comments>http://www.ciscozine.com/2009/11/05/slow-adsl-with-12-4-ios-version/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 22:25:00 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ADSL]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=739</guid>
		<description><![CDATA[Recently, I have upgraded my Cisco 2650XM from 12.3 to 12.4 version; I use it to connect my PC to Internet, but something goes wrong.
After the upgrading, I have tried to downlad an ISO image but the speed was very low (about 300KB/s and not 700KB/s). Mhhh this is strange! I have begun the troubleshooting [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have upgraded my Cisco 2650XM from 12.3 to 12.4 version; I use it to connect my PC to Internet, but something goes wrong.</p>
<p>After the upgrading, I have tried to downlad an ISO image but the <strong>speed was very low</strong> (about 300KB/s and not 700KB/s). Mhhh this is strange! I have begun the troubleshooting but no error, no warning message. So I have reset my current configuration, but nothing&#8230; no real improvement.<span id="more-739"></span></p>
<p>Fortunately my better friend (google hihihi) help me and I have found how to fix the &#8216;download speed&#8217;: define manually the &#8216;clockrate&#8217; into the atm interface!</p>
<p> </p>
<pre><code>Ciscozine(config-if)#clock rate aal5 ?
        1000000
        1300000
        1600000
        2000000
        2600000 (default)
        3200000
        4000000
        5300000
        7000000

  &lt;1000000-7000000&gt;  clock rates in bits per second,
                     choose one from above

Ciscozine(config-if)#</code></pre>
<p style="text-align: left;"> </p>
<p style="text-align: left;">In fact, if you don&#8217;t define the clock rate command into the atm interface, the IOS set to <strong>2600000</strong> this parameter. To force it, use the command <strong>&#8216;clock rate aal5&#8242;</strong>; in my case I use the command &#8216;clock rate aal5 7000000&#8242;.</p>
<p style="text-align: left;">Below the download speed test guarantee the bandwith improvement.</p>
<p style="text-align: left;"> </p>
<p style="TEXT-ALIGN: center"><strong>Without clock rate command</strong></p>
<p style="TEXT-ALIGN: center"><a href="http://www.ciscozine.com/wp-content/uploads/low_speed.jpg" target="_blank"><img class="aligncenter size-full wp-image-741" title="low_speed" src="http://www.ciscozine.com/wp-content/uploads/low_speed.jpg" alt="low_speed" width="500" height="332" /></a></p>
<p style="TEXT-ALIGN: center"> </p>
<p style="TEXT-ALIGN: center"><strong>With clock rate command</strong></p>
<p style="TEXT-ALIGN: center"><a href="http://www.ciscozine.com/wp-content/uploads/high_speed.jpg" target="_blank"><img class="size-full wp-image-740 aligncenter" title="high_speed" src="http://www.ciscozine.com/wp-content/uploads/high_speed.jpg" alt="high_speed" width="500" height="332" /></a></p>
<p> </p>
<p>That&#8217;s all! I hope this tutorial can help you! <img src='http://www.ciscozine.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/11/05/slow-adsl-with-12-4-ios-version/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/11/05/slow-adsl-with-12-4-ios-version/#comments">No comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/adsl/" rel="tag">ADSL</a>, <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/tips/" rel="tag">Tips</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/11/05/slow-adsl-with-12-4-ios-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CoPP?! What is that?</title>
		<link>http://www.ciscozine.com/2009/07/22/copp-what-is-that/</link>
		<comments>http://www.ciscozine.com/2009/07/22/copp-what-is-that/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 15:57:40 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[QOS]]></category>
		<category><![CDATA[Secure a router]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=722</guid>
		<description><![CDATA[Cisco Network Foundation Protection (NFP) is an umbrella strategy encompassing Cisco IOS Security features that provides the tools, technologies, and services that enable organizations to secure their network foundations. NFP helps to establish a methodical approach to protecting router planes, forming the foundation for continuous service delivery.
The router is typically segmented into three planes of [...]]]></description>
			<content:encoded><![CDATA[<p>Cisco Network Foundation Protection (<strong>NFP</strong>) is an umbrella strategy encompassing <strong>Cisco IOS Security features</strong> that provides the tools, technologies, and services that enable organizations to secure their network foundations. NFP helps to establish a methodical approach to protecting router planes, forming the foundation for continuous service delivery.</p>
<p>The router is typically segmented into <strong>three planes</strong> of operation, each with a clearly identified objective:</p>
<ul>
<li>the data plane allows the ability to forward data packets</li>
<li>the control plane allows the ability to route data correctly</li>
<li>the management plane allows the ability to manage network elements.</li>
</ul>
<p><strong>The vast majority of packets</strong> handled by a router <strong>travel</strong> through the router <strong>by way of the forwarding plane</strong>, or data plane. However, the system&#8217;s route processor must handle certain packets, such as routing protocols, keepalives, packets destined to the local IP addresses of the router, and packets from management protocols and other interactive access protocols, such as Telnet and Secure Shell (SSH) Protocol. This type of traffic is often referred to as control plane traffic.<span id="more-722"></span></p>
<p>Packet overloads on a router&#8217;s control plane can slow down routing processes and, as a result, degrade network service levels and user productivity. One cause for an overburdened router control plane is a router making inefficient use of shared CPU and memory resources. The same result can occur if <strong>reconnaissance</strong> or denial-of-service (<strong>DoS</strong>) attacks appear on the control plane, or if a routing protocol otherwise misbehaves.</p>
<p>For example, if a high volume of rogue packets generated by a virus or worm is presented to the control plane, the router will spend an excessive amount of time processing and discarding unnecessary traffic. This can eventually overwhelm the route processor, which is responsible for handling router control plane functions, and possibly bring router processes to a halt.</p>
<p>Following is an overview of several Cisco IOS Software security features that protect the control plane of networking devices.</p>
<ul>
<li><strong>Receive Access Control Lists: </strong>Receive Access Controls Lists (rACLs) are designed to protect the route processor on high-end routers from unnecessary traffic that could potentially affect system performance.<br />
The rACL feature uses standard or extended ACLs that control the traffic sent by the various line cards to the route processor on distributed architectures such as Cisco 12000 Series Routers. An rACL does not apply to transit traffic.</li>
<li><strong>Control Plane Policing:</strong> The control plane policing (CoPP) feature significantly improves upon the rACL feature. Whereas rACLs allow the configuration of basic &#8220;permit&#8221; and &#8220;deny&#8221; filters for traffic destined to the router CPU, the CPP feature extends this by allowing users to configure a quality of service (QoS) filter that can also &#8220;rate-limit&#8221; this traffic.</li>
<li><strong>Control Plane Protection:</strong> Cisco Control Plane Protection (CPPr) extends the CPP feature by enabling classification of the control plane traffic based on packet destination and information provided by the forwarding plane, allowing appropriate throttling for each category of packet.</li>
</ul>
<p> </p>
<p>In this article I will explain the control plane policing (<strong>CoPP</strong>), a feature introduced with release 12.2(18)S.</p>
<p>The CoPP feature protects the control plane of Cisco IOS Software-based routers and switches against many attacks, including reconnaissance and denial-of-service (DoS) attacks. In this manner, the control plane can maintain packet forwarding and protocol state despite an attack or heavy load on the router or switch.</p>
<p>CoPP provides <strong>the following benefits</strong>:</p>
<ul>
<li>Protection against DoS attacks at infrastructure routers and switches</li>
<li>QoS control for packets that are destined to the control plane of Cisco routers or switches</li>
<li>Ease of configuration for control plane policies</li>
<li>Better platform reliability and availability</li>
</ul>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>Example: Implement and test CoPP feature<br />
</strong>Suppose to have a network (192.168.144.0/24) with two routers (.252 and .253) and an untrusted PC (.100). It is required to protect Ciscozine1 control plane from ICMP flood attack.</p>
<p> </p>
<p style="text-align: center;"><a href="http://www.ciscozine.com/wp-content/uploads/copp.png" target="_blank"><img class="aligncenter size-full wp-image-724" title="CoPP" src="http://www.ciscozine.com/wp-content/uploads/copp.png" alt="CoPP" width="394" height="253" /></a></p>
<p> </p>
<p>Ciscozine2 (the trusted host) can forward ICMP packets to the control plane without constraint, while all remaining ICMP packets will be policed at the specified rate.</p>
<p>To test the CoPP feature, I use the ping command, with a size of 1250byte. As you can see, all ICMP packets sent by Ciscozine2 are received, while some ICMP packets from the Untrusted_pc are lost due to the control plane policing feature.</p>
<p> </p>
<p><object width="500" height="305" data="http://www.youtube.com/v/8szaGUsXcCU" type="application/x-shockwave-flash"><param name="src" value="http://www.youtube.com/v/8szaGUsXcCU" /></object></p>
<p> </p>
<p>To display the configuration and <strong>statistics for a traffic class or all traffic classes</strong> in the policy maps attached to the control plane for aggregate or distributed control plane services, use the <strong>show policy-map control-plane</strong> command in privileged EXEC mode.</p>
<pre><code>Ciscozine1#show policy-map control-plane
 Control Plane

  Service-policy input: control-plane-policing-test

    Class-map: block-untrusted-icmp (match-all)
      5246 packets, 3764458 bytes
      5 minute offered rate 10000 bps, drop rate 6000 bps
      Match: access-group 100
      police:
          cir 8000 bps, bc 1500 bytes
        conformed 3536 packets, 1386530 bytes; actions:
          transmit
        exceeded 1710 packets, 2377928 bytes; actions:
          drop
        conformed 4000 bps, exceed 6000 bps

    Class-map: class-default (match-any)
      1478 packets, 132467 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any
Ciscozine1#</code></pre>
<p> </p>
<p><strong>Ciscozine1 (partial) configuration:</strong><code><br />
Ciscozine1#<br />
!<br />
hostname Ciscozine1<br />
!<br />
class-map match-all block-untrusted-icmp<br />
 match access-group 100<br />
!<br />
!<br />
policy-map control-plane-policing-test<br />
 class block-untrusted-icmp<br />
    police 8000 conform-action transmit  exceed-action drop<br />
!<br />
interface FastEthernet0/0<br />
 ip address 192.168.144.252 255.255.255.0<br />
 duplex auto<br />
 speed auto<br />
!<br />
access-list 100 deny   icmp host 192.168.144.253 any<br />
access-list 100 permit icmp any any<br />
!<br />
control-plane<br />
 service-policy input control-plane-policing-test<br />
</code></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://www.cisco.com/en/US/docs/ios/12_3t/12_3t4/feature/guide/gtrtlimt.html" target="_blank">http://www.cisco.com/&#8230;/gtrtlimt.html</a></li>
<li><a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6586/ps6642/prod_white_paper0900aecd805ffde8.html" target="_blank">http://www.cisco.com/&#8230;/prod_white_paper0900aecd805ffde8.html</a></li>
<li><a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6586/ps6642/prod_presentation0900aecd80313fee.pdf" target="_blank">http://www.cisco.com/&#8230;/prod_presentation0900aecd80313fee.pdf</a></li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/07/22/copp-what-is-that/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/07/22/copp-what-is-that/#comments">No comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/dos/" rel="tag">DOS</a>, <a href="http://www.ciscozine.com/tag/qos/" rel="tag">QOS</a>, <a href="http://www.ciscozine.com/tag/secure-a-router/" rel="tag">Secure a router</a>, <a href="http://www.ciscozine.com/tag/video/" rel="tag">Video</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/07/22/copp-what-is-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSPF Virtual Link</title>
		<link>http://www.ciscozine.com/2009/07/01/ospf-virtual-link/</link>
		<comments>http://www.ciscozine.com/2009/07/01/ospf-virtual-link/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 11:53:20 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[OSPF]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=717</guid>
		<description><![CDATA[The Open Shortest Path First (OSPF) protocol, defined in RFC 2328, is an Interior Gateway Protocol used to distribute routing information within a single Autonomous System.
The OSPF protocol is based on link-state technology, which is a departure from the Bellman-Ford vector based algorithms used in traditional Internet routing protocols such as RIP. OSPF has introduced [...]]]></description>
			<content:encoded><![CDATA[<p>The Open Shortest Path First (OSPF) protocol, defined in <a href="http://www.ietf.org/rfc/rfc2328.txt" target="_blank">RFC 2328</a>, is an <strong>Interior Gateway Protocol</strong> used to distribute routing information within a single Autonomous System.</p>
<p>The OSPF protocol is based on <strong>link-state technology</strong>, which is a departure from the Bellman-Ford vector based algorithms used in traditional Internet routing protocols such as RIP. OSPF has introduced new concepts such as authentication of routing updates, Variable Length Subnet Masks (VLSM), route summarization, and so forth.</p>
<p>An OSPF network can be divided into sub-domains called areas. <strong>An area is a logical collection of OSPF networks</strong>, routers, and links that have the same area identification. A router within an area must maintain a topological database for the area to which it belongs. The router doesn&#8217;t have detailed information about network topology outside of its area, thereby reducing the size of its database.</p>
<p><strong>All areas</strong> in an OSPF autonomous system <strong>must be</strong> physically <strong>connected to the backbone area (area 0)</strong>. In some cases where this physical connection is not possible, <strong>you can use a virtual link to connect to the backbone through a non-backbone area</strong>. You can also use virtual links to connect two parts of a partitioned backbone through a non-backbone area. The area through which you configure the virtual link, known as a transit area, must have full routing information. The transit area <strong>cannot be a stub area</strong>.<span id="more-717"></span></p>
<p> </p>
<p><strong>Example:</strong><br />
Suppose to manage a network running an OSPF process. The network has three areas: area0 (the backbone), area2 and area3.</p>
<p><a href="http://www.ciscozine.com/wp-content/uploads/ospf-virtual-link.png"></a></p>
<p style="text-align: center;"><a href="http://www.ciscozine.com/wp-content/uploads/ospf-virtual-link.png" target="_blank"><img class="size-medium wp-image-718 aligncenter" title="ospf-virtual-link" src="http://www.ciscozine.com/wp-content/uploads/ospf-virtual-link-300x165.png" alt="ospf-virtual-link" width="380" height="209" /></a></p>
<p> </p>
<p>The area0 has four networks:</p>
<ul>
<li>1.0.0.0/24</li>
</ul>
<ul>
<li>1.0.1.0/24</li>
</ul>
<ul>
<li>1.0.2.0/24</li>
</ul>
<ul>
<li>1.0.3.0/24</li>
</ul>
<p>The area2 has two networks:</p>
<ul>
<li>2.0.0.0/24</li>
</ul>
<ul>
<li>2.0.1.0/24</li>
</ul>
<p>The area3 is connected to the area0 via area2 and it has two networks:</p>
<ul>
<li>3.0.0.0/24</li>
</ul>
<ul>
<li>3.0.1.0/24</li>
</ul>
<p> </p>
<p>In this example, we must configure three routers: Ciscozine1, Ciscozine2 and Ciscozine3. Ciscozine1 belongs to Area0 and Area2, Ciscozine2 belongs to Area2. Ciscozine3 belongs to Area2 and Area3, but due to OSPF constraint (all areas in an OSPF autonomous system must be physically connected to the backbone area), the Ciscozine3 router requires a Virtual-link.</p>
<p> </p>
<p><strong>Tips:</strong></p>
<ul>
<li>For convenience, the networks 1.0.0.0/22 and 3.0.0.0/23 will be defined using loopback interfaces.</li>
<li>To advertises the loopback subnet as the actual subnet configured on loopbacks, the &#8220;ip ospf network point-to-point&#8221; command is configured under loopbacks.</li>
<li>Router ID: It&#8217;s a 32-bit number assigned to each router running the OSPF protocol. This number uniquely identifies the router within an Autonomous System. RID is the highest logical (loopback) IP address configured on a router, if no logical/loopback IP address is set then the Router uses the highest IP address configured on its active interfaces. In this example, to have more control, I have chose to define statically the RID using the &#8220;router-id&#8221; command</li>
</ul>
<p> </p>
<p>Below, the router configurations based on four steps:</p>
<ol>
<li>Interface configuration</li>
<li>Test connectivity</li>
<li>OSPF configuration</li>
<li>Virtual Link</li>
</ol>
<p> </p>
<p><object width="500" height="305" data="http://www.youtube.com/v/xgkE90GVvCQ" type="application/x-shockwave-flash"><param name="src" value="http://www.youtube.com/v/xgkE90GVvCQ" /></object></p>
<p> </p>
<p>The three (partial) router configurations:</p>
<pre><code>Ciscozine1#
!
interface Loopback0
 ip address 1.0.0.1 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback1
 ip address 1.0.1.1 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback2
 ip address 1.0.2.1 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback3
 ip address 1.0.3.1 255.255.255.0
 ip ospf network point-to-point
!
interface FastEthernet0/0
 description Link-to-Ciscozine2
 ip address 2.0.0.1 255.255.255.0
!
router ospf 1
 router-id 1.0.0.1
 area 2 virtual-link 3.0.0.1
 network 1.0.0.0 0.0.3.255 area 0
 network 2.0.0.0 0.0.0.255 area 2</code></pre>
<pre><code> 

Ciscozine2#
!
interface FastEthernet0/0
 description Link-to-Ciscozine1
 ip address 2.0.0.2 255.255.255.0
!
interface FastEthernet0/1
 description Link-to-Ciscozine3
 ip address 2.0.1.1 255.255.255.0
!
router ospf 1
 router-id 2.0.0.2
 network 2.0.0.0 0.0.1.255 area 2</code></pre>
<pre><code>

Ciscozine3#
!
interface Loopback0
 ip address 3.0.0.1 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback1
 ip address 3.0.1.1 255.255.255.0
 ip ospf network point-to-point
!
interface FastEthernet0/0
 description Link-to-Ciscozine2
 ip address 2.0.1.2 255.255.255.0
!
router ospf 1
 router-id 3.0.0.1
 area 2 virtual-link 1.0.0.1
 network 2.0.1.0 0.0.0.255 area 2
 network 3.0.0.0 0.0.1.255 area 3
</code></pre>
<p><strong></strong></p>
<p><strong>Remember:</strong> To display parameters about and the current state of OSPF virtual links, use the &#8220;show ip ospf virtual-links&#8221; command in EXEC mode.</p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>Note:</strong> You can also build a generic routing encapsulation (GRE) tunnel between two routers and put the tunnel in Area 0. The main differences between a GRE tunnel and a virtual link are:</p>
<table class="table_text" border="0">
<tbody>
<tr>
<td><strong>GRE Tunnel</strong></td>
<td><strong>Virtual Link</strong></td>
</tr>
<tr>
<td>All traffic in the tunnel is encapsulated and decapsulated by the tunnel endpoints.</td>
<td>The routing updates are tunneled, but the data traffic is sent natively.</td>
</tr>
<tr>
<td>Tunnel headers in every packet cause overhead.</td>
<td>Data traffic is not subject to any tunnel overhead.</td>
</tr>
<tr>
<td>The tunnel can go through a stub area.</td>
<td>The transit area cannot be a stub area, because routers in the stub area do not have routes for external destinations. Because data is sent natively, if a packet destined for an external destination is sent into a stub area which is also a transit area, then the packet is not routed correctly. The routers in the stub area do not have routes for specific external destinations.</td>
</tr>
</tbody>
</table>
<p> </p>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://www.cisco.com/en/US/tech/tk365/tk480/tsd_technology_support_sub-protocol_home.html" target="_blank">http://www.cisco.com/&#8230;/support_sub-protocol_home.html</a></li>
</ul>
<ul>
<li><a href="http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a00801ec9ee.shtml" target="_blank">http://www.cisco.com/&#8230;/configuration_example09186a00801ec9ee.shtml</a></li>
</ul>
<ul>
<li><a href="http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a00800946bd.shtml" target="_blank">http://www.cisco.com/&#8230;/configuration_example09186a00800946bd.shtml</a></li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/07/01/ospf-virtual-link/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/07/01/ospf-virtual-link/#comments">No comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/ospf/" rel="tag">OSPF</a>, <a href="http://www.ciscozine.com/tag/routing/" rel="tag">Routing</a>, <a href="http://www.ciscozine.com/tag/video/" rel="tag">Video</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/07/01/ospf-virtual-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Have you never seen a Cisco crash?</title>
		<link>http://www.ciscozine.com/2009/06/22/have-you-never-seen-a-cisco-crash/</link>
		<comments>http://www.ciscozine.com/2009/06/22/have-you-never-seen-a-cisco-crash/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 07:47:30 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Hidden commands]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=714</guid>
		<description><![CDATA[It is not common see a Cisco crash: Software forced crash, Bus Error, Software watchdog timeout, and so on&#8230;
But if you would do it, there is a pretty trick   : it&#8217;s the &#8220;test crash&#8221; command, an hidden IOS command. This can help you if you are lucky enough to have the real crash [...]]]></description>
			<content:encoded><![CDATA[<p>It is not common see a Cisco crash: Software forced crash, Bus Error, Software watchdog timeout, and so on&#8230;</p>
<p>But if you would do it, there is a pretty trick <img src='http://www.ciscozine.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  : it&#8217;s the &#8220;test crash&#8221; command, an <a href="http://www.ciscozine.com/2008/09/08/undocumented-cisco-commands/">hidden IOS command</a>. This can help you if you are lucky enough to have the real crash exactly like one of those you can test with “test crash” command.<br />
<span id="more-714"></span><br />
Below, the test crash menu:</p>
<pre><code>Ciscozine#test crash
WARNING: Command selections marked with '(crash router)' will crash
         router when issued. However a selection 'C' will need to
         be issued IMMEDIATELY before these selections to enable them.
Type the number for the selected crash:
--------------------------------------
 1  (crash router) Bus Error, due to invalid address access
 2  (crash router) Bus Error, due to parity error in Main memory
 3  (crash router) Bus Error, due to parity error in I/O memory
 4  (crash router) Address Error, due to fetching code from odd address
 5  (crash router) Jump to zero
 6  (crash router) Software forced crash
 7  (crash router) Illegal read of address zero
 8  (crash router) Divide by zero
 9  (crash router) Corrupt memory
 C  Enable crash router selection marked with (crash router)
 R  (crash router) User enter read bus error address
 U  (crash router) User enter write bus error address
 W  (crash router) Software watchdog timeout (*** Watch Dog Timeout ***)
 w  (crash router) Process watchdog timeout (SYS-2-WATCHDOG)
 d  Disable crashinfo collection
 e  Enable crashinfo collection
 i  Display contents of current crashinfo flash file
 m  Write crashinfo on crashinfo RAM
 n  Change crashinfo flash file name
 q  Exit crash menu
 s  Save crashinfo to current crashinfo flash file
 c  Close current crashinfo flash file
 t  Write crashinfo on console TTY
 x  Exit crash menu
?</code></pre>
<p>To generate a Cisco crash, type &#8220;C&#8221; to enable Cisco crash feature. Then select the crash type that you would generate.</p>
<p> </p>
<p><strong>How Cisco test crash command works?</strong></p>
<p>In this example, I have selected the &#8220;s&#8221; option to save crashinfo to the flash. The file will be named like: <em>crashinfo_YYYYMMDD-hhmmss</em>, where:</p>
<ul>
<li>YYYY is the year, like 2009</li>
<li>MM is the month, like 06</li>
<li>DD is the day, like 18</li>
<li>hh are the hours, like 15</li>
<li>mm are the minutes, like 03</li>
<li>ss are the seconds, like 34</li>
</ul>
<p>As you can see, the file saved on the flash memory (due a Software forced crash, option #6) could be read with the command &#8220;more&#8221;. Remember that it is not easy understand the crashinfo file&#8230;</p>
<p><object width="500" height="305" data="http://www.youtube.com/v/af3LLC01fiE&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_profilepage&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/af3LLC01fiE&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_profilepage&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/06/22/have-you-never-seen-a-cisco-crash/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/06/22/have-you-never-seen-a-cisco-crash/#comments">One comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/hidden-commands/" rel="tag">Hidden commands</a>, <a href="http://www.ciscozine.com/tag/video/" rel="tag">Video</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/06/22/have-you-never-seen-a-cisco-crash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tips for securing Cisco administrative access</title>
		<link>http://www.ciscozine.com/2009/04/16/tips-for-securing-cisco-administrative-access/</link>
		<comments>http://www.ciscozine.com/2009/04/16/tips-for-securing-cisco-administrative-access/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 20:57:03 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Secure a router]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=696</guid>
		<description><![CDATA[In this article I would explain some tips for securing Cisco administrative access.
When creating passwords, keep these rules in mind:

Make passwords lengthy
Passwords should combine letters, numbers, and symbols. Passwords should not use dictionary words
Change passwords as often as possible

Strong passwords are the primary defense against unauthorized access to your router. The best way to manage [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I would explain some <strong>tips </strong>for securing Cisco administrative access.</p>
<p>When creating passwords, <strong>keep these rules in mind</strong>:</p>
<ul>
<li>Make passwords lengthy</li>
<li>Passwords should combine letters, numbers, and symbols. Passwords should not use dictionary words</li>
<li>Change passwords as often as possible</li>
</ul>
<p><strong>Strong passwords</strong> are the <strong>primary defense</strong> against unauthorized access to your router. The best way to manage passwords is to maintain them on an AAA server, but not all people can have/manage a AAA server.</p>
<p>Cisco provides a number of <strong>enhanced features</strong> that allow you to increase the security of your passwords.</p>
<p>For the basic configuration read <a href="http://www.ciscozine.com/2008/10/10/cisco-basic-configuration/">this article</a>.<span id="more-696"></span></p>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>Protecting Line Access</strong><br />
Resctrict the AUX, VTY and console access with a password or with a username/password.</p>
<p>The simplest configuration to protect is:<br />
Enables password checking at login</p>
<pre><code>login</code></pre>
<p>Sets the password</p>
<pre><code>password my_password</code></pre>
<p><strong>Note:</strong> Administrators sometimes use auxiliary ports to remotely configure and monitor the router using a dial-up modem connection. If you want to turn off the EXEC process for the aux port, use the <strong>no exec</strong> command within the auxiliary line configuration mode.</p>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>service password-encryption</strong><br />
All Cisco router passwords are, by default, stored in plaintext form within the router configuration (see the running-config or startup-config &#8230;). Cisco permits to &#8220;hide&#8221; these password with a proprietary Cisco algorithm based on a Vigenere cipher. To encrypt system password use:</p>
<pre><code>service password-encryption</code></pre>
<p>For instance, if you set an &#8220;enable password ciscozine&#8221; without this feature the password in your running-config is in plaintext:</p>
<pre><code>enable password ciscozine</code></pre>
<p>but if you enable service password-encryption command, the password is hidden:</p>
<pre><code>enable password 7 02050D4808091528424B</code></pre>
<p><strong>Remember:</strong> When you remove the service password-encryption command with the no form, the command does not decrypt the passwords.<br />
<strong>Remember:</strong>Vigenere cipher is not a SECURE crypto algorithm; in fact you can find many software to decrypt this type of password. This method is <strong>not as safe as MD5</strong>, which is used with the <strong>enable secret</strong> command, but prevents casual discovery of the router line-level passwords.</p>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>Use MD5</strong><br />
Use MD5  hash function where it is possible; for instance:</p>
<ul>
<li><em>enable secret</em> command is more secure than <em>enable password</em>command, because it use MD5 algorithm for hash the passsword.</li>
<li><em>username my_user secret my_password</em>is more secure than username <em>my_user password my_password</em>, because it use MD5 algorithm for hash the passsword.</li>
</ul>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>Timeout<br />
</strong>By default, an administrative interface (TTY, AUX, &#8230;.) stays active (and logged on) for ten minutes after the last session activity. A better choise is to limit the time to three minutes.<br />
To adjust this timer to 2 minutes and 30 seconds:</p>
<pre><code>exec-timeout 2 30</code></pre>
<p><strong>Remember:</strong> Setting the exec-timeout value to zero means that there will be no timeout and the session will stay active for an unlimited time. Do not set the value to zero.</p>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>Protecting against dictionary attack<br />
</strong>Cisco has implemented many features to procted router/swtich against dictionary attack; there are many ways to protect:</p>
<ul>
<li><strong>security password min-length</strong><br />
From Cisco IOS Release 12.3(1) and later it is possible to define a minimum password length (default is Six characters). This command affects user passwords, enable passwords and secrets, and line passwords that users create after the command is executed. Existing router passwords remain unaffected.</li>
</ul>
<p style="padding-left: 30px;">For instance, if you would set a minimum password length of 8 characters:</p>
<pre style="padding-left: 30px;"><code>security password min-length 8</code></pre>
<p style="padding-left: 30px;">If you insert a password that not respect the lenght an error message is displayed:</p>
<pre style="padding-left: 30px;"><code>Password too short - must be at least 8 characters. Password not configured.</code></pre>
<p><strong></strong></p>
<ul>
<li><strong>security authentication failure rate<br />
</strong>From Cisco IOS Release 12.3(1) and later, it it possible to configure the number of allowable unsuccessful login attempts. The security authentication failure-rate command provides enhanced security access to the router by generating syslog messages after the number of <strong>unsuccessful login attempts</strong> exceeds the configured threshold rate. This command ensures that there are not any continuous failures to access the router.</li>
</ul>
<p style="padding-left: 30px;">After the <strong>15-second delay</strong> has passed, the user can continue to attempt to log in to the router.</p>
<p style="padding-left: 30px;">The following example shows how to configure your router to generate a syslog message after five failed login attempts (a 15-second delay timer starts after the number of login failed is reached):</p>
<pre style="padding-left: 30px;"><code>security authentication failure rate 5 log</code></pre>
<p><strong></strong></p>
<ul>
<li><strong>login block for<br />
</strong>Another helpful command to block dictionary attack is the <em>login block for</em>command. This command permits to block for &#8216;x&#8217; seconds after &#8216;y&#8217; login are tried within &#8216;z&#8217; seconds. See below to understand how the command works.</li>
</ul>
<p style="padding-left: 30px;">The following example shows how block login access for <strong>120</strong> seconds after <strong>5 </strong>failed login attempts within <strong>30</strong> seconds:</p>
<pre style="padding-left: 30px;"><code>login block-for 120 attempts 5 within 30</code></pre>
<p style="padding-left: 30px;"><strong>Remember:</strong>All login attempts made via <strong>Telnet, SSH, and HTTP are denied </strong>during the quiet period; that is, no ACLs are exempt from the login period until the login <em>quiet-mode access-class</em> command is issued.</p>
<p><strong></strong></p>
<ul>
<li><strong>login quiet-mode access-class<br />
</strong>It is possible to define an ACL to permit login attempts when the login access is blocked by the <em>login block-for</em> or by the <em>security authentication failure rate</em> command. It can be useful in emergency situation.</li>
</ul>
<pre style="padding-left: 30px;"><code>login quiet-mode access-class 101</code></pre>
<pre style="padding-left: 30px;"><code>access-list 101 permit ip 192.168.1.0 0.0.0.255 any</code></pre>
<p style="padding-left: 30px;">The following logging message is generated after the router switches to quiet-mode:</p>
<pre style="padding-left: 30px;"><code>00:04:07:%SEC_LOGIN-1-QUIET_MODE_ON:Still timeleft for watching failures is 158 seconds,
[user:ciscozine] [Source:192.168.10.10] [localport:23] [Reason:Invalid login], [ACL:22] at 16:17:23
UTC Wed Apr 15 2009</code></pre>
<p style="padding-left: 30px;">The following logging message is generated after the router switches from quiet mode back to normal mode:</p>
<pre style="padding-left: 30px;"><code>00:09:07:%SEC_LOGIN-5-QUIET_MODE_OFF:Quiet Mode is OFF, because block period timed out at
16:22:23 UTC Wed Apr 15 2009</code></pre>
<p><strong></strong></p>
<ul>
<li><strong>login delay<br />
</strong>From Cisco IOS Release 12.3(4)T and later, it is possbile to define the time between successive login attempts. If this command is not enabled, a login delay of one second is automatically enforced after the login block-for command is applied to the router configuration.For instance, if I would define a delay of 10 seconds, use this command:</li>
</ul>
<pre style="padding-left: 30px;"><code>login delay 10</code></pre>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>Logging login requests</strong><br />
It is possible logging failure/success login requests:</p>
<ul>
<li><strong>login on-success</strong><br />
Generates logging messages for successful login attempts. For example:</p>
<pre><code>00:04:32:%SEC_LOGIN-5-LOGIN_SUCCESS:Login Success [user:ciscozine] [Source:192.168.10.10]
[localport:23] at 16:30:40 UTC Wed Apr 15 2009</code></pre>
</li>
</ul>
<p><strong></strong></p>
<ul>
<li><strong>login on-failure<br />
</strong>Generates logging messages for failed login attempts. For example:</p>
<pre><code>00:03:34:%SEC_LOGIN-4-LOGIN_FAILED:Login failed [user:ciscozine] [Source:192.168.10.10]
[localport:23] [Reason:Invalid login] at 16:32:12 UTC Wed Apr 15 2009</code></pre>
</li>
</ul>
<p>To check login enforcement settings use the &#8220;show login&#8221; command.<strong></strong></p>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>Disable password recovery<br />
</strong>Cisco permits to <a href="http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_tech_note09186a00801746e6.shtml" target="_blank">recover password</a> during the reload system. This scenario presents a potential security breach because <strong>anyone who gains physical access</strong> to the router console port can enter ROMMON, reset the enable secret password, and <strong>discover the router configuration</strong>.</p>
<p>For this reason, it is possible disable password recovery procedure. To do it use the &#8220;hidden&#8221; command &#8220;no service password-recovery&#8221;.</p>
<p>When you configure the router, disabling password recovery feature, you see this message:</p>
<pre><code>ciscozine(config)#no service password-recovery
WARNING:
Executing this command will disable password recovery mechanism.
Do not execute this command without another plan for
password recovery.

Are you sure you want to continue? [yes/no]: yes
ciscozine(config)#</code></pre>
<p>When the no service password-recovery command is configured, you see this message during boot up:</p>
<pre><code>System Bootstrap, Version 11.1(19)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1)
Copyright (c) 1998 by Cisco Systems, Inc.
C3600 processor with 65536 Kbytes of main memory
Main memory is configured to 64 bit mode with parity enabled

PASSWORD RECOVERY FUNCTIONALITY IS DISABLED
program load complete, entry point: 0x80008000, size: 0x10ce394
Self decompressing the image : #########################################################
########################################################################################
#######################################################################    [OK]</code></pre>
<p><strong>Remember:</strong> If a router is configured with the no service password-recovery command, this disables all access to the ROMMON. If there is no valid Cisco IOS software image in the Flash memory of the router, the user is not able to use the ROMMON XMODEM command in order to load a new Flash image. In order to fix the router, you must get a new Cisco IOS software image on a Flash SIMM, or on a PCMCIA card, for example on the 3600 Series Routers.</p>
<p> </p>
<p>References:</p>
<ul>
<li><a href="http://www.cisco.com/en/US/docs/ios/security/configuration/guide/sec_login_enhance.html" target="_blank">http://www.cisco.com/&#8230;/sec_login_enhance.html</a></li>
<li><a href="http://www.cisco.com/en/US/products/hw/routers/ps274/products_configuration_example09186a00801d8113.shtml" target="_blank">http://www.cisco.com/&#8230;/configuration_example09186a00801d8113.shtml</a></li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/04/16/tips-for-securing-cisco-administrative-access/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/04/16/tips-for-securing-cisco-administrative-access/#comments">No comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/secure-a-router/" rel="tag">Secure a router</a>, <a href="http://www.ciscozine.com/tag/tips/" rel="tag">Tips</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/04/16/tips-for-securing-cisco-administrative-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to protect against BPDU attack</title>
		<link>http://www.ciscozine.com/2009/03/17/how-to-protect-against-bpdu-attack/</link>
		<comments>http://www.ciscozine.com/2009/03/17/how-to-protect-against-bpdu-attack/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 17:04:02 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[Secure a router]]></category>
		<category><![CDATA[Spanning-Tree]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=692</guid>
		<description><![CDATA[The spanning-tree protocol is used to cut loops that redundant links create in bridge networks. These packets are not attested by the system, so an attacker could spoof the BPDU and compromise the network stability!
See below to understand BPDU attack:
In this example the Ciscozine1 switch is elected Root Bridge due to the lower MAC-address (suppose that [...]]]></description>
			<content:encoded><![CDATA[<p>The spanning-tree protocol is used to <strong>cut loops</strong> that redundant links create in bridge networks. These packets are not attested by the system, so an attacker could <strong>spoof the BPDU</strong> and compromise the network stability!</p>
<p>See below to understand <strong>BPDU attack</strong>:</p>
<p>In this example the Ciscozine1 switch is elected Root Bridge due to the lower MAC-address (suppose that all the switches have the same priority).</p>
<p style="text-align: center;"><a href="http://www.ciscozine.com/wp-content/uploads/bpdu_attack_1.png" target="_blank"><img class="size-medium wp-image-693 aligncenter" title="bpdu_attack_1" src="http://www.ciscozine.com/wp-content/uploads/bpdu_attack_1-300x293.png" alt="bpdu_attack_1" width="300" height="293" /></a></p>
<p><span id="more-692"></span> </p>
<p>What happen if an attacker (in this instance a laptop) spoof a BPDU with a lower priority?</p>
<p style="text-align: center;"><a href="http://www.ciscozine.com/wp-content/uploads/bpdu_attack_2.png" target="_blank"><img class="size-medium wp-image-694 aligncenter" title="bpdu_attack_2" src="http://www.ciscozine.com/wp-content/uploads/bpdu_attack_2-300x293.png" alt="bpdu_attack_2" width="300" height="293" /></a></p>
<p> </p>
<p>The attacker (red laptop) will be the new root bridge and the spanning-tree topology change. See the figure:</p>
<p style="text-align: center;"><a href="http://www.ciscozine.com/wp-content/uploads/bpdu_attack_3.png" target="_blank"><img class="size-medium wp-image-695 aligncenter" title="bpdu_attack_3" src="http://www.ciscozine.com/wp-content/uploads/bpdu_attack_3-300x293.png" alt="bpdu_attack_3" width="300" height="293" /></a></p>
<p> </p>
<p>With this new topology, Ciscozine3 and Ciscozine4 use only Ciscozine1 to switch packets, while Ciscozine2 is not used by the access switches (Ciscozine3 and Ciscozine4)!<br />
Moreover the election of the attacker as root causes the Gigabit Ethernet link that connects the two core switches (Ciscozine1 and Ciscozine2) to block, causing <strong>suboptimal</strong> <strong>network</strong>.</p>
<p><strong>Note:</strong> The administrator can set the root bridge priority to zero in an effort to secure the root bridge position, but there is no guarantee against a bridge with a priority of 0 and a lower MAC address.<br />
<strong>Note:</strong> The temporary introduction and subsequent removal of STP devices with low (0) bridge priority cause a <strong>permanent STP recalculation</strong>.</p>
<p> </p>
<p>How can I protect myself against BPDU spoof attack?<br />
Cisco has implemented three different solutions: <strong>BPDU Guard</strong>, <strong>BPDU Filtering</strong> and <strong>Root Guard</strong>.</p>
<p><strong>BPDU Guard</strong><br />
The STP PortFast BPDU guard enhancement allows network designers to <strong>enforce the STP domain</strong> borders and keep the active topology predictable. The devices behind the ports that have STP PortFast enabled are not able to influence the STP topology. At the reception of BPDUs, the BPDU guard operation <strong>disables the port</strong> that has PortFast configured. The BPDU guard transitions the port into errdisable state, and a message appears on the console.</p>
<p>You can enable or disable STP PortFast BPDU guard on a global basis, which affects all ports that have PortFast configured. By default, STP BPDU guard is disabled.</p>
<p>To enable BPDU guard globally on the switch, use this command:</p>
<pre><code>Ciscozine3(config)#spanning-tree portfast bpduguard default</code></pre>
<p>To enable PortFast BPDU guard on a specific switch port, use this command:</p>
<pre><code>Ciscozine3(config)#spanning-tree bpduguard enable</code></pre>
<p>Use the following command to verify the BPDU configuration:</p>
<pre><code>Ciscozine3#show spanning-tree summary totals</code></pre>
<p>The STP PortFast BPDU guard was introduced in Cisco IOS Software Release 12.1.</p>
<p><strong>Note:</strong> STP PortFast BPDU guard is not available for the Catalyst 8500 series, 2948G-L3, or 4908G-L3 switches.<br />
<strong>Note:</strong> You must manually reenable the port that is put into errdisable state or configure errdisable-timeout. </p>
<p> </p>
<p><strong>BPDU Filterning<br />
</strong>When configured globally, PortFast BPDU filtering applies to all operational PortFast ports. Ports in an operational PortFast state are supposed to be connected to hosts, that typically drop BPDUs. If an operational PortFast port receives a BPDU, it immediately loses <strong>its operational PortFast status</strong>. In that case, PortFast BPDU filtering is disabled on this port and STP resumes sending BPDUs on this port.</p>
<p>PortFast BPDU filtering can also be configured on a per-port basis. When PortFast BPDU filtering is explicitly configured on a port, it does not send any BPDUs and drops all BPDUs it receives.</p>
<p>To enable PortFast BPDU filtering globally on the switch, use this command:</p>
<pre><code>Ciscozine3(config)#spanning-tree portfast bpdufilter default</code></pre>
<p>To enable PortFast BPDU filtering on a specific switch port, use this command:</p>
<pre><code>Ciscozine3(config-if)#spanning-tree bpdufilter enable</code></pre>
<p>To verify the configuration on the switch, use this command:</p>
<pre><code>Ciscozine3#show spanning-tree summary</code></pre>
<p>The STP PortFast BPDU filtering was introduced in Cisco IOS Software Release 12.1(13)E.</p>
<p><strong>Remember:</strong> Explicit configuration of PortFast BPDU filtering on a port not connected to a host station can result in bridging loops. The port ignores any incoming BPDUs and changes to the forwarding state. This does not occur when PortFast BPDU filtering is enabled globally.</p>
<p> </p>
<p><strong>BPDU Root guard</strong><br />
The root guard ensures that the port on which root guard is enabled is the designated port. Normally, root bridge ports are all designated ports, unless two or more ports of the root bridge are connected together. If the bridge receives superior STP Bridge Protocol Data Units (BPDUs) on a root guard-enabled port, root guard moves this port to a <strong>root-inconsistent STP state</strong>. This root-inconsistent state is effectively <strong>equal to a listening state</strong>. No traffic is forwarded across this port. In this way, the root guard enforces the position of the root bridge.</p>
<p>To enable Root Guard on a specific switch port, use this command:</p>
<pre><code>Ciscozine3(config-if)#spanning-tree rootguard</code></pre>
<p>Root guard is available in Cisco IOS Software Release 12.0(5)XU and later. The Catalyst 2950 series switches support the root guard feature in Cisco IOS Software Release 12.0(5.2)WC(1) and later. The Catalyst 3550 series switches support the root guard feature in Cisco IOS Software Release 12.1(4)EA1 and later.</p>
<p><strong>Note:</strong> You must manually reenable the port that is put into errdisable state or configure errdisable-timeout. </p>
<p> </p>
<p><strong>Conclusion: </strong>In my opinion, <strong>BPDU Guard</strong> control BPDU spoof attack much <strong>better than BPDU Filtering</strong>. As a matter of fact, BPDU Guard block immediately the port at the reception of BPDUs, whereas BPDU Filtering only disable portfast feature.<br />
The <strong>root guard feature partially restricts</strong> this type of attack; in fact an attacker will not be the root bridge, but it could take part of the spanning-tree instance.</p>
<p>For these reasons, a good solution to block BPDU spoof attack is to enable BPDU Guard control at all fastethernet ports used to connect laptop/PC/Server, while enable root guard feature on the ports used to connect switches.</p>
<p> </p>
<p>References: </p>
<ul>
<li><a href="http://www.cisco.com/en/US/tech/tk389/tk621/technologies_tech_note09186a008009482f.shtml" target="_blank">http://www.cisco.com/&#8230;/technologies_tech_note09186a008009482f.shtml</a></li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst6500/ios/12.1E/native/configuration/guide/stp_enha.html#wp1033403" target="_blank">http://www.cisco.com/&#8230;/guide/stp_enha.html#wp1033403</a></li>
<li><a href="http://www.cisco.com/en/US/tech/tk389/tk621/technologies_tech_note09186a00800ae96b.shtml" target="_blank">http://www.cisco.com/&#8230;/technologies_tech_note09186a00800ae96b.shtml</a></li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/03/17/how-to-protect-against-bpdu-attack/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/03/17/how-to-protect-against-bpdu-attack/#comments">2 comments</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/dos/" rel="tag">DOS</a>, <a href="http://www.ciscozine.com/tag/secure-a-router/" rel="tag">Secure a router</a>, <a href="http://www.ciscozine.com/tag/spanning-tree/" rel="tag">Spanning-Tree</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/03/17/how-to-protect-against-bpdu-attack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Protecting against MAC flooding attack</title>
		<link>http://www.ciscozine.com/2009/01/05/protecting-against-mac-flooding-attack/</link>
		<comments>http://www.ciscozine.com/2009/01/05/protecting-against-mac-flooding-attack/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 21:34:05 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Flooding attack]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=644</guid>
		<description><![CDATA[In a typical MAC flooding attack, a switch is flooded with packets, each containing different source MAC addresses. The intention is to consume the limited memory set aside in the switch to store the MAC address-to-physical port translation table.
The result of this attack causes the switch to enter a state called failopen mode, in which [...]]]></description>
			<content:encoded><![CDATA[<p>In a typical MAC flooding attack, a <strong>switch is flooded</strong> with packets, each containing different source MAC addresses. The intention is to <strong>consume the limited memory</strong> set aside in the switch to store the MAC address-to-physical port translation table.</p>
<p style="text-align: left;">The result of this attack causes the switch to enter a state called failopen mode, in which all incoming packets are broadcast out on all ports (<strong>as with a hub</strong>), instead of just down the correct port as per normal operation. A malicious user could then use a packet sniffer running in promiscuous mode to capture sensitive data from other computers, which would not be accessible were the switch operating normally.</p>
<p style="text-align: left;">Cisco gives you an opportunity to set up protection against this attack with limiting and/or hardwiring some MAC addresses to a dedicated port.<span id="more-644"></span></p>
<p style="text-align: left;"> </p>
<p style="text-align: left;"><strong>Understand the MAC flooding attack<br />
</strong>Suppose to have a switch with 3 PC: PC A, PC B and PC C; in normal situation, when PC A sends a packet to PC B, PC C does not view packet sent between PC A and PC B.</p>
<p style="text-align: center;"><img class="size-full wp-image-653 aligncenter" title="mac_learning" src="http://www.ciscozine.com/wp-content/uploads/mac_learning.png" alt="mac_learning" width="333" height="218" /></p>
<p style="text-align: left;">This because the 3 PC are connected to a switch and <strong>NOT</strong> to a hub.</p>
<p>Under MAC flooding attack, the switch behaviour is different. During the MAC flooding attack, the attacker (in this instance PC C) floods the switch with packets, each with different source MAC address.</p>
<p style="text-align: center;"><img class="size-full wp-image-648 aligncenter" title="mac_flooding_attack" src="http://www.ciscozine.com/wp-content/uploads/mac_flooding_attack.png" alt="mac_flooding_attack" width="461" height="218" /></p>
<p>If the Content Addressable Memory (the memory where the MAC addresses are stored) is full, the switch works like an hub; so, if the PC A sends a packet to PC B, the packet will be received to PC C too.</p>
<p style="text-align: center;"><img class="size-full wp-image-652 aligncenter" title="mac_flooding_attack_2" src="http://www.ciscozine.com/wp-content/uploads/mac_flooding_attack_2.png" alt="mac_flooding_attack_2" width="333" height="218" /></p>
<p style="text-align: left;"> </p>
<p style="text-align: left;"><strong>Protecting against MAC flooding attack</strong><br />
Cisco has implemented a feature, called <strong>switchport port-security</strong>, to protect against this type of attack. You can use the port security feature to restrict input to an interface by limiting and identifying MAC addresses of the stations allowed to access the port.</p>
<p style="text-align: left;">There are three types of secure MAC addresses:</p>
<ul>
<li>
<div style="text-align: left;">Static secure MAC addresses: These are manually configured by using the <em>switchport port-security mac-address mac-address interface</em> configuration command, stored in the address table, and added to the switch running configuration.</div>
</li>
<li>
<div style="text-align: left;">Dynamic secure MAC addresses: These are dynamically learned, stored only in the address table, and removed when the switch restarts.</div>
</li>
<li>
<div style="text-align: left;">Sticky secure MAC addresses: These can be dynamically learned or manually configured, stored in the address table, and added to the running configuration. If these addresses are saved in the configuration file, the interface does not need to dynamically relearn them when the switch restarts.</div>
</li>
</ul>
<p style="text-align: left;"><strong>Remember:</strong> A secure port can have from 1 to 132 associated secure addresses. The total number of available secure addresses on the switch is 1024.</p>
<p style="text-align: left;">When the maximum number of secure MAC addresses have been added to the address table and a station whose MAC address is not in the address table attempts to access the interface a security violation occurs.</p>
<p style="text-align: left;">The switch can react to a security violation in three different ways:</p>
<ul>
<li>
<div style="text-align: left;">protect: When the number of secure MAC addresses reaches the limit allowed on the port, packets with <strong>unknown source addresses are dropped</strong> until you remove a sufficient number of secure MAC addresses or increase the number of maximum allowable addresses. You are not notified that a security violation has occurred.</div>
</li>
<li>
<div style="text-align: left;">restrict: When the number of secure MAC addresses reaches the limit allowed on the port, packets with <strong>unknown source addresses are dropped</strong> until you remove a sufficient number of secure MAC addresses or increase the number of maximum allowable addresses. In this mode, you are notified that a security violation has occurred. Specifically, an <strong>SNMP trap is sent</strong>, a syslog message is logged, and the violation counter increments.</div>
</li>
<li>
<div style="text-align: left;">shutdown: In this mode, a port security violation causes the <strong>interface</strong> to immediately bec<strong>ome error-disabled</strong>, and turns off the port LED. It also <strong>sends an SNMP trap</strong>, logs a syslog message, and increments the violation counter. When a secure port is in the error-disabled state, you can bring it out of this state by entering the errdisable recovery cause psecure-violation global configuration command, or you can manually re-enable it by entering the shutdown and no shutdown interface configuration commands. This is the default mode.</div>
</li>
</ul>
<p style="text-align: left;"> </p>
<p style="text-align: left;"><strong>Example: Limit to ten MAC addresses</strong>, two of which are statics (aaaa.aaaa.aaaa, bbbb.bbbb.bbbb), on FastEthernet 0/1 port. The violation required is &#8220;restricted&#8221;.</p>
<pre><code>Ciscozine# conf t
Ciscozine(config)# interface fastethernet0/1
Ciscozine(config-if)# switchport mode access
Ciscozine(config-if)# switchport port-security
Ciscozine(config-if)# switchport port-security maximum 10
Ciscozine(config-if)# switchport port-security violation restrict
Ciscozine(config-if)# switchport port-security mac-address aaaa.aaaa.aaaa
Ciscozine(config-if)# switchport port-security mac-address bbbb.bbbb.bbbb</code></pre>
<p><em></em></p>
<p><em>switchport mode access</em>: The port-security works only on access port,  so define it.<br />
<em>switchport port-security</em>: Enable port security on the interface.<br />
<em>switchport port-security maximum 10</em>: Sets the maximum number of secure MAC addresses for the interface to 10.<br />
<em>switchport port-security violation restrict</em>: It defines to &#8220;restrict&#8221; the violation mode.<br />
<em>switchport port-security mac-address aaaa.aaaa.aaaa</em>: Define the static MAC address; remember that if you configure fewer secure MAC addresses than the maximum, the remaining MAC addresses are dynamically learned.</p>
<p style="text-align: left;">Useful commands to displaying traffic control status and configuration are:</p>
<ul>
<li>
<div style="text-align: left;"><em>show interfaces [interface-id] switchport</em>: Displays the administrative and operational status of all switching (nonrouting) ports or the specified port, including port blocking and port protection settings.</div>
</li>
<li>
<div style="text-align: left;"><em>show port-security [interface interface-id]</em>: Displays port security settings for the switch or for the specified interface, including the maximum allowed number of secure MAC addresses for each interface, the number of secure MAC addresses on the interface, the number of security violations that have occurred, and the violation mode.</div>
</li>
<li>
<div style="text-align: left;"><em>show port-security [interface interface-id] address</em>: Displays all secure MAC addresses configured on all switch interfaces or on a specified interface with aging information for each address.</div>
</li>
</ul>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>Remember:</strong> you can enable port security on a interface only if the port is not configured as one of these:</p>
<ul>
<li>Trunk ports: If you try to enable port security on a trunk port, an error message appears, and port security is not enabled. If you try to change the mode of a secure port to trunk, the port mode is not changed.</li>
<li>Dynamic port: A port in dynamic mode can negotiate with its neighbor to become a trunk port. If you try to enable port security on a dynamic port, an error message appears, and port security is not enabled. If you try to change the mode of a secure port to dynamic, the port mode is not changed.</li>
<li>Dynamic-access port: If you try to enable port security on a dynamic-access (VLAN Query Protocol [VQP]) port, an error message appears, and port security is not enabled. If you try to change a secure port to dynamic VLAN assignment, an error message appears, and the VLAN configuration is not changed.</li>
<li>EtherChannel porT: Before enabling port security on the port, you must first remove it from the EtherChannel. If you try to enable port security on an EtherChannel or on an active port in an EtherChannel, an error message appears, and port security is not enabled. If you enable port security on a not-yet active port of an EtherChannel, the port does not join the EtherChannel.</li>
<li>802.1X port: You cannot configure an 802.1X port as a secure port. If you try to enable port security on an 802.1X port, an error message appears, and port security is not enabled. If you try to change a secure port to an 802.1X port, an error message appears, and the 802.1X settings are not changed.</li>
<li>Switch Port Analyzer (SPAN) destination port: You can enable port security on a port that is a SPAN destination port; however, port security is disabled until the port is removed as a SPAN destination. You can enable port security on a SPAN source port.</li>
</ul>
<p> </p>
<p>References:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/MAC_flooding" target="_blank">http://en.wikipedia.org/wiki/MAC_flooding</a></li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_22_ea2/configuration/guide/swtrafc.html#wp1038501" target="_blank">http://www.cisco.com/&#8230;/configuration/guide/swtrafc.html#wp1038501</a></li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2009. |
<a href="http://www.ciscozine.com/2009/01/05/protecting-against-mac-flooding-attack/">Permalink</a> |
<a href="http://www.ciscozine.com/2009/01/05/protecting-against-mac-flooding-attack/#comments">2 comments</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/flooding-attack/" rel="tag">Flooding attack</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2009/01/05/protecting-against-mac-flooding-attack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IOS Scripting with Tcl</title>
		<link>http://www.ciscozine.com/2008/12/13/ios-scripting-with-tcl/</link>
		<comments>http://www.ciscozine.com/2008/12/13/ios-scripting-with-tcl/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 18:04:48 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Tcl]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=608</guid>
		<description><![CDATA[Discovered during Cisco CCNP course, Tcl (originally from &#8220;Tool Command Language&#8220;) is a scripting language created by John Ousterhout and introduced from IOS version 12.3(2)T.
But what is Cisco Tcl?
The Cisco IOS Tcl shell was designed to allow customers to run Tcl commands directly from the Cisco IOS CLI prompt. Cisco IOS software does contain some [...]]]></description>
			<content:encoded><![CDATA[<p>Discovered during Cisco CCNP course, Tcl (originally from &#8220;<strong>Tool Command Language</strong>&#8220;) is a scripting language created by John Ousterhout and introduced from IOS version 12.3(2)T.</p>
<p>But what is Cisco Tcl?<br />
The Cisco IOS Tcl shell was designed to allow customers to run <strong>Tcl commands</strong> directly from the Cisco IOS CLI prompt. Cisco IOS software does contain some subsystems such as <strong>Embedded Syslog Manager</strong> (ESM) and <strong>Interactive Voice Response</strong> (IVR) that use Tcl interpreters as part of their implementation. These subsystems have their own proprietary commands and keyword options that are not available in the Tcl shell.<span id="more-608"></span></p>
<p>Several methods have been developed for creating and running Tcl scripts within Cisco IOS software. A Tcl shell can be enabled, and Tcl commands can be entered line by line. After Tcl commands are entered, they are sent to a Tcl interpreter. If the commands are recognized as valid Tcl commands, the commands are executed and the results are sent to the tty. If a command is not a recognized Tcl command, it is sent to the Cisco IOS CLI parser. If the command is not a Tcl or Cisco IOS command, two error messages are displayed. A predefined Tcl script can be created outside of Cisco IOS software, transferred to flash or disk memory, and run within Cisco IOS software. It is also possible to create a Tcl script and precompile the code before running it under Cisco IOS software.</p>
<p>Multiple users on the same router can be in Tcl configuration mode at the same time without interference because each Tcl shell session launches a separate interpreter and Tcl server process. The tty interface number served by each Tcl process is represented in the server process name and can be displayed using the show process CLI command.</p>
<p>The Tcl shell can be used to run Cisco IOS CLI EXEC commands within a Tcl script. Using the Tcl shell to run CLI commands allows customers to build menus to guide novice users through tasks, to automate repetitive tasks, and to create custom output for show commands.</p>
<p>To enter in the &#8220;Tool Command Language shell&#8221; type &#8220;<strong>tclsh</strong>&#8221; command, while to exit type &#8220;<strong>tclquit</strong>&#8220;.</p>
<p>Remember: <strong>errors in Tcl scripts can cause infinite loops in the router</strong></p>
<p><strong></strong></p>
<p><strong>1. A very simple example: Hello world</strong><br />
Copy this function in the Tcl configuration mode</p>
<pre><code>proc test {} {
puts "Hello world!"
}</code></pre>
<p>The result will be:</p>
<pre><code>Ciscozine#tclsh
Ciscozine(tcl)#proc test {} {

+&gt;puts "Hello world!"
+&gt;}</code></pre>
<p>To test the script type &#8220;test&#8221;:</p>
<pre><code>Ciscozine(tcl)#test
Hello world!

Ciscozine(tcl)#</code></pre>
<p> </p>
<p><strong>2. Ping multiple IP addresses<br />
</strong>Often during troubleshooting, it is needed to ping some IP addresses to test connectivity; in these situations Tcl could be very useful.</p>
<p>For instance, suppose to ping the first &#8216;x&#8217; ip address of the 172.16.1.x/24 network. Usually a network administrator must type &#8220;ping 172.16.1.1&#8243; then &#8220;ping 172.16.1.2&#8243; and so on&#8230;, but it could take a long time.</p>
<p>Tcl could help us with a very simple script:</p>
<pre><code>proc ping_net {x} {
 for {set n 1} {$n&lt;=$x} {incr n 1} {
    exec "ping 172.16.1.$n"
 }
}</code></pre>
<p>The result will be:</p>
<pre><code>Ciscozine(tcl)#proc ping_net {x} {
+&gt; for {set n 1} {$n&lt;=$x} {incr n 1} {
+&gt;    exec "ping 172.16.1.$n"
+&gt; }
+&gt;}</code></pre>
<p>To test the first five IP addresses:</p>
<pre><code>Ciscozine(tcl)#ping_net 5

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Ciscozine(tcl)#</code></pre>
<p> </p>
<p>In these 2 simple examples, I have used 3 Tcl command: <em>proc</em>, <em>puts</em>, <em>for</em>.</p>
<p>The <strong>proc</strong> command creates a new command. The syntax for the proc command is: <em>proc name args body</em><br />
When proc is evaluated, it creates a new command with name name that takes arguments args. When the procedure name is called, it then runs the code contained in body.</p>
<p>The <strong>puts </strong>command is used to print &#8220;somethings&#8221;.</p>
<p>The <strong>for</strong> command in Tcl takes four arguments; an initialization, a test, an increment, and the body of code to evaluate on each pass through the loop. The syntax for the for command is: <em>for start test next body</em><br />
During evaluation of the for command, the start code is evaluated once, before any other arguments are evaluated.</p>
<p>You can find more informations about tcl command syntax on <a href="http://www.tcl.tk/" target="_blank">http://www.tcl.tk/</a>.</p>
<p><strong></strong></p>
<p> </p>
<p>References:</p>
<ul>
<li><a href="http://www.cisco.com/en/US/docs/ios/12_3t/12_3t2/feature/guide/gt_tcl.html" target="_blank">http://www.cisco.com/&#8230;/feature/guide/gt_tcl.html</a></li>
<li><a href="http://en.wikipedia.org/wiki/Tcl" target="_blank">http://en.wikipedia.org/wiki/Tcl</a></li>
<li><a href="http://forums.cisco.com/eforum/servlet/EEM?page=main" target="_blank">http://forums.cisco.com/eforum/servlet/EEM?page=main</a></li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2008. |
<a href="http://www.ciscozine.com/2008/12/13/ios-scripting-with-tcl/">Permalink</a> |
<a href="http://www.ciscozine.com/2008/12/13/ios-scripting-with-tcl/#comments">One comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/tcl/" rel="tag">Tcl</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2008/12/13/ios-scripting-with-tcl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring Link Aggregation with EtherChannel</title>
		<link>http://www.ciscozine.com/2008/11/04/configuring-link-aggregation-with-etherchannel/</link>
		<comments>http://www.ciscozine.com/2008/11/04/configuring-link-aggregation-with-etherchannel/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 17:45:36 +0000</pubDate>
		<dc:creator>Fabio Semperboni</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Advanced configuration]]></category>
		<category><![CDATA[Etherchannel]]></category>

		<guid isPermaLink="false">http://www.ciscozine.com/?p=505</guid>
		<description><![CDATA[EtherChannel bundles individual Ethernet links into a single logical link that provides bandwidth up to 1600 Mbps (Fast EtherChannel, full duplex) or 16 Gbps (Gigabit EtherChannel) between two Cisco Catalyst switches. All interfaces in each EtherChannel must be the same speed and duplex, and both ends of the channel must be configured as either a [...]]]></description>
			<content:encoded><![CDATA[<p>EtherChannel bundles individual Ethernet links into a single logical link that provides bandwidth up to <strong>1600 Mbps</strong> (Fast EtherChannel, full duplex) or <strong>16 Gbps</strong> (Gigabit EtherChannel) between two Cisco Catalyst switches. All interfaces in each EtherChannel must be the same speed and duplex, and both ends of the channel must be configured as either a Layer 2 or Layer 3 interface.</p>
<p>If a link within the EtherChannel bundle fails, traffic previously carried over the failed link is carried over the remaining links within the EtherChannel.</p>
<p>There are two protocols used for the link aggregation:</p>
<ul>
<li>Cisco’s proprietary Port Aggregation Protocol (<strong>PAgP</strong>).</li>
<li>IEEE standard Link Aggregation Protocol (<strong>LACP</strong>)<span id="more-505"></span></li>
</ul>
<p> </p>
<p>PAgP packets are sent between Fast EtherChannel-capable ports to negotiate the forming of a channel. When PAgP identifies matched Ethernet links, it groups the links into an EtherChannel. The EtherChannel is then added to the spanning tree as a single bridge port.</p>
<table class="table_text" border="0">
<tbody>
<tr>
<td><strong>Mode (PAgP)</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>Auto</td>
<td>Places an interface into a passive negotiating state, in which the interface responds to PAgP packets it receives but does not start PAgP packet negotiation. This setting minimizes the transmission of PAgP packets and is the default.</td>
</tr>
<tr>
<td>Desirable</td>
<td>Places an interface into an active negotiating state, in which the interface starts negotiations with other interfaces by sending PAgP packets.</td>
</tr>
<tr>
<td>On</td>
<td>Forces the interface to channel without PAgP. With the <strong>on</strong> mode, a usable <strong>EtherChannel</strong> exists only when an interface group in the <strong>on</strong> mode is connected to another interface group in the <strong>on</strong> mode.</td>
</tr>
</tbody>
</table>
<p> </p>
<p>LACP is part of an IEEE specification (802.3ad) that allows several physical ports to be bundled together to form a single logical channel. LACP allows a switch to negotiate an automatic bundle by sending LACP packets to the peer. It performs a similar function as PAgP with Cisco EtherChannel. Because LACP is an IEEE standard, it can be used to facilitate EtherChannels in mixed-switch environments.</p>
<table class="table_text" border="0">
<tbody>
<tr>
<td><strong>Mode (LACP)</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>Passive</td>
<td>The switch does not initiate the channel, but does understand incoming LACP packets. The peer (in active state) initiates negotiation (by sending out an LACP packet) which we receive and reply to, eventually forming the aggregation channel with the peer. This is similar to the auto mode in PAgP.</td>
</tr>
<tr>
<td>Active</td>
<td>We are willing to form an aggregate link, and initiate the negotiation. The link aggregate will be formed if the other end is running in LACP active or passive mode. This is similar to the desirable mode of PAgP.</td>
</tr>
<tr>
<td>On</td>
<td>The link aggregation is forced to be formed without any LACP negotiation .In other words, the switch will neither send the LACP packet nor process any incoming LACP packet. This is similar to the on state for PAgP.</td>
</tr>
</tbody>
</table>
<p><strong><strong></strong></strong></p>
<p><strong><strong></strong></strong></p>
<p><strong><strong>Etherchannel</strong> Negotiation Protocols</strong></p>
<table class="table_text" border="0">
<tbody>
<tr>
<td colspan="2"><strong>Negotiation Mode </strong></td>
<td><strong>Packets Sent? </strong></td>
<td><strong>Charateristics</strong></td>
</tr>
<tr>
<td><strong>PAgP</strong></td>
<td><strong>LACP</strong></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>on</td>
<td>on</td>
<td>No</td>
<td>All ports channeling</td>
</tr>
<tr>
<td>auto</td>
<td>passive</td>
<td>Yes</td>
<td>Waits to channel until asked</td>
</tr>
<tr>
<td>desirable</td>
<td>active</td>
<td>Yes</td>
<td>Actively asks to form a channel</td>
</tr>
</tbody>
</table>
<p> </p>
<p><strong>Matrix of Load Balancing Methods<br />
</strong>Cisco EtherChannel technology is composed of several Fast Ethernet links and is capable of load balancing traffic across those links. Unicast, broadcast, and multicast traffic is evenly distributed across the links, providing higher performance and redundant parallel paths. When a link fails, traffic is redirected to the remaining links within the channel without user intervention and with minimal packet loss. To <strong>define the load-balance method</strong>, enter in the global configuration mode and <strong>use the command “port-channel load-balance ?”</strong> to see the load-distribution method availables.</p>
<p>This matrix consolidates the load balancing methods:</p>
<table class="table_text" border="0">
<tbody>
<tr>
<td><strong>Platform</strong></td>
<td><strong>Address Used in XOR</strong></td>
<td><strong>Source-Based?</strong></td>
<td><strong>Destination-Based?</strong></td>
<td><strong>Source-Destination-Based?</strong></td>
<td><strong>Load Balancing Method—Configurable/Fixed?</strong></td>
</tr>
<tr>
<td>6500/6000</td>
<td>Layer 2, Layer 3 addresses, Layer 4 information, or MPLS information ²</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Configurable</td>
</tr>
<tr>
<td>5500/5000</td>
<td>Layer 2 address only</td>
<td>—</td>
<td>—</td>
<td>Yes</td>
<td>Cannot change the method</td>
</tr>
<tr>
<td>4500/4000</td>
<td>Layer 2, Layer 3 addresses, or Layer 4 information</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Configurable</td>
</tr>
<tr>
<td>2900XL/3500XL</td>
<td>Layer 2 address only</td>
<td>Yes</td>
<td>Yes</td>
<td>—</td>
<td>Configurable</td>
</tr>
<tr>
<td>3750/3560</td>
<td>Layer 2 or Layer 3 address only</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Configurable</td>
</tr>
<tr>
<td>2950/2955/3550</td>
<td>Layer 2 address only ¹</td>
<td>Yes</td>
<td>Yes</td>
<td>—1</td>
<td>Configurable</td>
</tr>
<tr>
<td>1900/2820</td>
<td colspan="5">These platforms use a special method of load balancing. See the <a href="http://www.cisco.com/en/US/tech/tk389/tk213/technologies_tech_note09186a0080094714.shtml#cat1900_2820" target="_blank">Catalyst 1900/2820</a> section for details.</td>
</tr>
<tr>
<td>8500</td>
<td>Layer 3 address only</td>
<td>—</td>
<td>—</td>
<td>Yes</td>
<td>Cannot change the method</td>
</tr>
</tbody>
</table>
<p>¹ For the 3550 series switch, when source-MAC address forwarding is used, load distribution based on the source and destination IP address is also enabled for routed IP traffic. All routed IP traffic chooses a port based on the source and destination IP address.<br />
² For the 6500 series switches that run Cisco IOS, MPLS layer 2 information can also be used for load balancing MPLS packets.</p>
<p> </p>
<p><strong>Example #1: Configuring Layer2 Etherchannel</strong></p>
<p style="text-align: center;"><img class="size-full wp-image-508 aligncenter" title="etherchannel" src="http://www.ciscozine.com/wp-content/uploads/etherchannel.png" alt="" width="420" height="125" /></p>
<p>In this example, the FastEthernet0/0-0/1-0/2 (on Ciscozine_SW1 and Ciscozine_SW2) must belong to vlan 10; it is required to create a Layer2 etherchannel using LACP with desirable mode on Ciscozine_SW1 and passive mode on the Ciscozine_SW2. The configuration is:</p>
<p><strong>Ciscozine_SW1 etherchannel L2 configuration</strong></p>
<pre><code>Ciscozine_SW1# configure terminal
Ciscozine_SW1(config)# interface range fastethernet0/0 -2
Ciscozine_SW1(config-if-range)# switchport mode access
Ciscozine_SW1(config-if-range)# switchport access vlan 10
Ciscozine_SW1(config-if-range)# channel-protocol lacp
Ciscozine_SW1(config-if-range)# channel-group 1 mode active
Ciscozine_SW2 etherchannel L2 configuration</code></pre>
<p><strong></strong></p>
<p><strong>Ciscozine_SW2 etherchannel L2 configuration</strong></p>
<pre><code>Ciscozine_SW2# configure terminal
Ciscozine_SW2(config)# interface range fastethernet0/0 -2
Ciscozine_SW2(config-if-range)# switchport mode access
Ciscozine_SW2(config-if-range)# switchport access vlan 10
Ciscozine_SW1(config-if-range)# channel-protocol lacp
Ciscozine_SW2(config-if-range)# channel-group 1 mode passive</code></pre>
<p> </p>
<p> </p>
<p><strong>Example #2: Configuring Layer3 Etherchannel</strong></p>
<p style="text-align: center;"><img class="size-full wp-image-508 aligncenter" title="etherchannel" src="http://www.ciscozine.com/wp-content/uploads/etherchannel.png" alt="" width="420" height="125" /></p>
<p>In this example, the FastEthernet0/0-0/1-0/2 (on Ciscozine_SW1 and Ciscozine_SW2) must be aggregated; it is required to create a Layer3 etherchannel using PAgP with desirable mode on Ciscozine_SW1 and auto mode on the Ciscozine_SW2. The configuration is:</p>
<p><strong>Ciscozine_SW1 etherchannel L3 configuration</strong></p>
<pre><code>Ciscozine_SW1# configure terminal
Ciscozine_SW1(config)# interface port-channel 1
Ciscozine_SW1(config-if)# no switchport
Ciscozine_SW1(config-if)# ip address 172.16.1.11 255.255.255.0
Ciscozine_SW1(config-if)# end
Ciscozine_SW1# configure terminal
Ciscozine_SW1(config)# interface range fastethernet0/0 -2
Ciscozine_SW1(config-if-range)# no switchport
Ciscozine_SW1(config-if-range)# no ip address
Ciscozine_SW1(config-if-range)# channel-group 1 mode desirable
Ciscozine_SW1(config-if-range)# end
Ciscozine_SW2 etherchannel L3 configuration</code></pre>
<p><strong></strong></p>
<p><strong>Ciscozine_SW2 etherchannel L3 configuration</strong></p>
<pre><code>Ciscozine_SW2# configure terminal
Ciscozine_SW2(config)# interface port-channel 1
Ciscozine_SW2(config-if)# no switchport
Ciscozine_SW2(config-if)# ip address 172.16.1.12 255.255.255.0
Ciscozine_SW2(config-if)# end
Ciscozine_SW2# configure terminal
Ciscozine_SW2(config)# interface range fastethernet0/0 -2
Ciscozine_SW2(config-if-range)# no switchport
Ciscozine_SW2(config-if-range)# no ip address
Ciscozine_SW2(config-if-range)# channel-group 1 mode auto
Ciscozine_SW2(config-if-range)# end</code></pre>
<p><strong></strong></p>
<p><strong>REMEMBER</strong>: The “no switchport” command is required to change interface from layer2 to layer3 mode.</p>
<p>Use the “show etherchannel” command to display port-channel information after configuration and remember to save the configuration!</p>
<p> </p>
<p>References:</p>
<ul>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst6500/ios/12.1E/native/configuration/guide/channel.html" target="_blank">Configuring EtherChannels</a> (Catalyst 6500/6000 Switches That Run Cisco IOS Software)</li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst5000/catos/6.x/configuration/guide/channel.html" target="_blank">Configuring Fast EtherChannel and Gigabit EtherChannel</a> (Catalyst 5000 Switches)</li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst4000/7.1/configuration/guide/channel.html" target="_blank">Configuring Fast EtherChannel and Gigabit EtherChannel</a> (Catalyst 4000 Switches That Run CatOS)</li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst4500/12.1/8aew/configuration/guide/channel.html#wp1020334" target="_blank">Understanding and Configuring EtherChannel</a> (Catalyst 4000 Switches That Run Cisco IOS Software)</li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst2900xl_3500xl/release12.0_5_wc3/swg/Swgports.html#wp1028774" target="_blank">Creating EtherChannel Port Groups </a>section of <a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst2900xl_3500xl/release12.0_5_wc3/swg/Swgports.html" target="_blank">Configuring the Switch Ports</a> (Catalyst 2900XL/3500XL Switches)</li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst3550/software/release/12.1_8_ea1/configuration/guide/swethchl.html" target="_blank">Configuring EtherChannel</a> (Catalyst 3550 Switches)</li>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_6_ea2c/configuration/guide/swgports.html#wp1044951" target="_blank">Understanding the EtherChannel </a>section of <a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_6_ea2c/configuration/guide/swgports.html" target="_blank">Configuring the Switch Ports</a> (Catalyst 2950 Switches)</li>
</ul>
<hr />
<p><small>© Fabio Semperboni for <a href="http://www.ciscozine.com">CiscoZine</a>, 2008. |
<a href="http://www.ciscozine.com/2008/11/04/configuring-link-aggregation-with-etherchannel/">Permalink</a> |
<a href="http://www.ciscozine.com/2008/11/04/configuring-link-aggregation-with-etherchannel/#comments">No comment</a><br/>
Post tags: <a href="http://www.ciscozine.com/tag/advanced-configuration/" rel="tag">Advanced configuration</a>, <a href="http://www.ciscozine.com/tag/etherchannel/" rel="tag">Etherchannel</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.ciscozine.com/2008/11/04/configuring-link-aggregation-with-etherchannel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
