<?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>HandsomePlanet &#187; Cisco</title>
	<atom:link href="http://www.handsomeplanet.com/archives/tag/cisco/feed" rel="self" type="application/rss+xml" />
	<link>http://www.handsomeplanet.com</link>
	<description>technology and other perplexities</description>
	<lastBuildDate>Sun, 05 Sep 2010 02:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Cisco 3560, 3750 archive command to install or upgrade IOS via tar file</title>
		<link>http://www.handsomeplanet.com/archives/164</link>
		<comments>http://www.handsomeplanet.com/archives/164#comments</comments>
		<pubDate>Fri, 21 May 2010 19:18:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[CLI]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=164</guid>
		<description><![CDATA[Some newer L3 Cisco switches are now happier if you use the &#8216;archive&#8217; facility to manage images. If you only want the IOS, and not the web interface and so on, use the /imageonly flag. From the Cisco release notes : For example: Switch# archive download-sw /overwrite tftp://198.30.20.19/c3750-ipservices-tar.122-50.SE.tar Check the release notes or command reference [...]]]></description>
			<content:encoded><![CDATA[<p>Some newer L3 Cisco switches are now happier if you use the &#8216;archive&#8217; facility to manage images.<br />
If you only want the IOS, and not the web interface and so on, use the /imageonly flag.<br />
From the <a title="release notes" href="http://origin-www.cisco.com/en/US/docs/switches/lan/catalyst3750/software/release/12.2_53_se/release/notes/OL21141.html">Cisco release notes</a> :<br />
For example:<br />
<span style="font-family: monospace;">Switch# archive download-sw /overwrite tftp://198.30.20.19/c3750-ipservices-tar.122-50.SE.tar</span></p>
<p>Check the release notes or command reference (or in-exec help) for further options.</p>
<p>This apparently does away with &#8216;boot system statements&#8217; as well,  as you can see if you run &#8216;show boot&#8217; on the switches.  The image set by your &#8216;archive&#8217; command becomes the active image on reboot.  I&#8217;m not sure what happens if you have both explicit &#8216;system boot &lt;blah&gt;&#8217; statements and the automatic IOS precedence setting configured via the fancy archive method.<br />
<code><br />
anynode#sh boot<br />
BOOT path-list      : flash:c3750-ipservicesk9-mz.122-53.SE1/c3750-ipservicesk9-mz.122-53.SE1.bin<br />
Config file         : flash:/config.text<br />
Private Config file : flash:/private-config.text<br />
Enable Break        : no<br />
Manual Boot         : no<br />
HELPER path-list    :<br />
Auto upgrade        : yes<br />
Auto upgrade path   :<br />
Timeout for Config<br />
          Download:    0 seconds<br />
Config Download<br />
       via DHCP:       disabled (next boot: disabled)<br />
-------------------<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/164/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple output filter for “show cdp neighbors” using a compound regular expression (Cisco IOS)</title>
		<link>http://www.handsomeplanet.com/archives/16</link>
		<comments>http://www.handsomeplanet.com/archives/16#comments</comments>
		<pubDate>Sat, 23 May 2009 20:30:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=16</guid>
		<description><![CDATA[Here is a simple filter I&#8217;ve used on ’show cdp’ output, which lets me get information quickly. MalbecMDF#show cdp neighbor detail &#124; include (---&#124;Device ID&#124;IP address&#124;Platform) In practice, I generally cut the command down to: sh cdp ne d &#124; inc (blah&#124;blah) It is probably best to start with obvious match choices, before pairing them [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple filter I&#8217;ve used on ’show cdp’ output, which lets me get information quickly.</p>
<p><code>MalbecMDF#show cdp neighbor detail | include (---|Device ID|IP address|Platform)</code></p>
<p>In practice, I generally cut the command down to:<br />
<code>sh cdp ne d | inc (blah|blah)</code><br />
It is probably best to start with obvious match choices, before pairing them down, as you can find yourself surprised with the text that is grabbed from different types of devices if you’re basing your regular expression match on a small sample.</p>
<p>In any case, the output should come out something like this:<br />
<code><br />
MalbecMDF#sh cdp ne d | inc (---|e ID|IP add|Plat)<br />
-------------------------<br />
Device ID: SummaC-6509<br />
IP address: 10.77.234.131<br />
Platform: cisco WS-C6509-E,  Capabilities: Router Switch IGMP<br />
-------------------------<br />
Device ID: Malbec-AP10<br />
IP address: 10.88.129.22<br />
Platform: cisco AIR-AP1231G-A-K9    ,  Capabilities: Trans-Bridge<br />
-------------------------<br />
Device ID: Malbec-AP11<br />
IP address: 10.88.129.29<br />
Platform: cisco AIR-AP1231G-A-K9    ,  Capabilities: Trans-Bridge<br />
-------------------------</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco IOS CLI regular expressions, Part II — ‘AND’</title>
		<link>http://www.handsomeplanet.com/archives/11</link>
		<comments>http://www.handsomeplanet.com/archives/11#comments</comments>
		<pubDate>Thu, 02 Apr 2009 21:25:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=11</guid>
		<description><![CDATA[In an earlier post, I talked about Cisco command line regular expressions, and held off on giving any good examples of using the CLI regexp tools to get ‘AND’ functionality. ( I pointed out there that the ‘&#124;’ (pipe symbol) could be used as a simple ‘OR’ function.) Here are some easy regexp’s that function [...]]]></description>
			<content:encoded><![CDATA[<p>In an earlier <a title="cisco-ios-cli-regular-expressions">post</a>, I talked about Cisco command line regular expressions, and held off on giving any good examples of using the CLI regexp tools to get ‘AND’ functionality. ( I pointed out there that the ‘|’ (pipe symbol) could be used as a simple ‘OR’ function.)<br />
Here are some easy regexp’s that function (more as less) as simple Boolean ‘AND’s.</p>
<p>Here’s a scenario: you’re auditing one of your routers, checking to make sure privilege levels are what they should be for individual users, and that commands that have been moved into non-default privilege levels that appear to be correctly defined.</p>
<p>Here’s the output of ’show running-config’ with only lines that match ‘privi’ included (so as to catch lines that show privilege levels):</p>
<p><code>IOS-rtr#sh run | inc privi</code><br />
<code>username sneezy privilege 0 secret 5 $1$Dz6cKoEINsYusITt.l</code><br />
<code>username dopey privilege 0 secret 5 $1$MIUYWJ.I3iGq/qNleB.</code><br />
<code>username meson privilege 0 secret 5 $1$7uBWyjan.5JB8KHR0</code><br />
<code>username gluon privilege 15 secret 5 $1$VuoC$09dsgXRB.A/d</code><br />
<code>privilege exec level 0 traceroute</code><br />
<code>privilege exec level 0 ping</code><br />
<code>privilege exec all level 0 show</code><br />
<code>privilege exec level 0 clear ip nat translation</code><br />
<code>privilege exec level 0 clear ip nat</code><br />
<code>privilege exec level 0 clear ip</code><br />
<code>privilege exec level 0 clear</code><br />
<code>privilege configure level 7 logging </code><br />
<code>privilege configure level 7 logging trap </code><br />
<code>privilege configure level 7 logging source</code><br />
<code> privilege level 15</code><br />
<code> privilege level 15</code></p>
<p>In this case, you can use the regular expression “.*” (dot-star) to match lines that contain both the word ‘privilege’ and ‘level 0′, thus eliminating other priv levels, as well as username definitions:<br />
<code>IOS-rtr#sh run | inc privi.*level 0</code><br />
<code>privilege exec level 0 traceroute</code><br />
<code>privilege exec level 0 ping</code><br />
<code>privilege exec all level 0 show</code><br />
<code>privilege exec level 0 clear ip nat translation</code><br />
<code>privilege exec level 0 clear ip nat</code><br />
<code>privilege exec level 0 clear ip</code><br />
<code>privilege exec level 0 clear</code></p>
<p>The same thing works for an audit of ‘level 7′ commands:</p>
<p><code>OS-rtr#sh run | inc privi.*level 7</code><br />
<code>privilege configure level 7 logging </code><br />
<code>privilege configure level 7 logging trap </code><br />
<code>privilege configure level 7 logging source</code></p>
<p>If you want to show lines that match privilege levels <em>other</em> than zero, you could use this:<br />
<code>IOS-rtr#sh run | inc priv.*[1-9]</code></p>
<p>You should note that the “.*” (dot-star) regular expression can be used as a synonym for AND, provided that you are aware that “.*” is not order agnostic.<br />
In order to do a true AND, you’d need an expression like :<br />
<code>sh run | inc (privi.*level 0|level 0.*privi)</code><br />
This will match lines containing both ‘privilege’ and ‘level 0′, no matter which of the words appears first. To illustrate this, I’ll create a loopback interface (loop3) with some description text that will match the regex:</p>
<p><code>IOS-rtr#conf t</code><br />
<code>Enter configuration commands, one per line.  End with CNTL/Z.</code><br />
<code>IOS-rtr(config)#int loop3</code><br />
<code>IOS-rtr(config-if)#desc level 0 is not privileged here!</code><br />
<code>IOS-rtr(config-if)#^Z</code><br />
<code>IOS-rtr#sh run | inc (privi.*level 0|level 0.*privi)</code><br />
<code> description level 0 is not privileged here!</code><br />
<code>privilege exec level 0 traceroute</code><br />
<code>privilege exec level 0 ping</code><br />
<code>privilege exec all level 0 show</code><br />
<code>privilege exec level 0 clear ip nat translation</code><br />
<code>privilege exec level 0 clear ip nat</code><br />
<code>privilege exec level 0 clear ip</code><br />
<code>privilege exec level 0 clear</code></p>
<p>It works!   Notice that we caught both the description line and the privilege exec lines.</p>
<p>Apparently I’m easily amused, but there it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/11/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco IOS CLI regular expressions (&#8220;Ceci n&#8217;est pas une pipe.&#8221;)</title>
		<link>http://www.handsomeplanet.com/archives/7</link>
		<comments>http://www.handsomeplanet.com/archives/7#comments</comments>
		<pubDate>Tue, 31 Mar 2009 15:09:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=7</guid>
		<description><![CDATA[[taken from a  note originally written March 2007] Yesterday, I was trying to find a method to implement an  ‘AND’ function within the Cisco IOS cisco command line.  I was familiar with the  ‘OR’ function available through the ‘&#124;’ symbol (which is to say, the same symbol as the pipe). For example, if you wanted [...]]]></description>
			<content:encoded><![CDATA[<address>[taken from a  note originally written March 2007]<br />
</address>
<p>Yesterday, I was trying to find a method to implement an  ‘AND’ function within the Cisco IOS cisco command line.  I was familiar with the  ‘OR’ function available through the ‘|’ symbol (which is to say, the same symbol as the pipe).</p>
<p>For example, if you wanted to show the running config, and filter out lines that contained either ‘foo’ or ‘bar’, you could type</p>
<p><code>show run | include foo|bar</code></p>
<p>The second &#8220;pipe,&#8221;  in this case, isn’t a pipe, but the symbol for an ‘OR’ function.  (&#8220;Ceci n&#8217;est pas une pipe.&#8221;)</p>
<p><a href="http://en.wikipedia.org/wiki/The_Treachery_of_Images"><img class="size-full wp-image-35 alignright" title="300px-magrittepipe" src="http://www.handsomeplanet.com/wp-content/uploads/2009/03/300px-magrittepipe.jpg" alt="Magritte -- this (pipe) is not a pipe" width="300" height="230" /></a></p>
<p>I wasn’t able to find a way to do an ‘AND’ in an analogous fashion, but I  did find a decent Cisco webpage on CLI and regular expressions (regexp) that helped a bit. That page can be found here: <a title="http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/cliparse.htm" onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/cliparse.htm" target="_blank">http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/cliparse.htm </a></p>
<p>It is possible to do ‘AND’ type functions implicitly by using a more complex set of matching rules based on regular expressions.</p>
<p>Here’s a example that shows (from an interactive session on the Cisco CLI) if access-lists have been applied to interfaces using the &#8220;access-group&#8221; command:</p>
<p><code>sh run | include (^interface [A-Z])|(ip access-group [0-9a-zA-Z])</code></p>
<p>Lines that start with ‘interface’ followed by an uppercase letter (the expression matches anything in the range A-Z) are supposed to match things like ‘interface Fastethernet,’ ‘interface Serial’ and so on. The second part of the expression matches access-groups that have three possible initial character ranges: a lowercase letter (a-z), an uppercase letter (A-Z), or a number (0-9) for the standard access lists.<br />
Some rudimentary filtering is done, so things like Loopback sourcing, route-maps, and so on, don’t match.</p>
<p>Interfaces that have no access-lists applied have on the interface name listed, but interfaces with an access-group command show the complete access-group statement under the relevant interface (which makes sense, given that this is only a filtered ’show run’).</p>
<p>Output might look something like this:</p>
<p><code>interface Serial3/3<br />
interface Serial3/3.1 point-to-point<br />
ip access-group pac in<br />
ip access-group ket out<br />
interface FastEthernet4/0<br />
interface Serial6/0<br />
ip access-group Ozona in</code></p>
<p>If this kind of function is useful for you, it is even easier to use if you put it in an alias on your switch or router:</p>
<p><code>#conf t<br />
#alias exec shag sh run | include (^interface [A-Z])|(ip access-group [0-9a-zA-Z])</code></p>
<p>You should, of course, pick a name for the alias that you’ll remember.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
