<?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>ardenpackeer.com &#187; IOS Features &amp; Management</title>
	<atom:link href="http://ardenpackeer.com/category/ios-features-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://ardenpackeer.com</link>
	<description>Helping You Become a Network Ninja</description>
	<lastBuildDate>Thu, 16 Jul 2009 06:23:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Troubleshooting: IP Addressing Tricks &amp; Tips Using PPP</title>
		<link>http://ardenpackeer.com/ios-features-management/troubleshooting-ip-addressing-tricks-tips-using-ppp/</link>
		<comments>http://ardenpackeer.com/ios-features-management/troubleshooting-ip-addressing-tricks-tips-using-ppp/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 08:13:27 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[frame relay]]></category>
		<category><![CDATA[point-to-point]]></category>
		<category><![CDATA[ppp]]></category>
		<category><![CDATA[ppp ipcp]]></category>
		<category><![CDATA[ppp multilink]]></category>
		<category><![CDATA[ppp over frame-relay]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/blog/troubleshooting-ip-addressing-tricks-tips-using-ppp/</guid>
		<description><![CDATA[Let's say you have this scenario: R4 and R5 are connected via a serial cable. Configure IP Addressing so that R4 and R5 are in the 192.168.45.0/24. R4 should have an IP of 192.168.45.4/24. R5 should have an IP address off 192.168.45.5/24. The catch: Do not configure an IP Address with the <em>ip address 192.168.45.4 255.255.255.0</em> command directly on R4's s1/1 interface. Let's have a look at the different ways we can solve this....<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/troubleshooting-ip-addressing-tricks-tips-using-ppp/">Troubleshooting: IP Addressing Tricks &#038; Tips Using PPP</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have this scenario:</p>
<p>R4 and R5 are connected via a serial cable. Configure IP Addressing so that R4 and R5 are in the 192.168.45.0/24. R4 should have an IP of 192.168.45.4/24. R5 should have an IP address off 192.168.45.5/24.</p>
<p><strong>The catch: Do not configure an IP Address with the <em>ip address 192.168.45.4 255.255.255.0</em> command directly on R4&#8217;s s1/1 interface.</strong></p>
<div class="captionfull"><img src='http://ardenpackeer.com/wp-content/uploads/2008/04/ip-addressing.gif' alt='IP Addressing Topology' /></div>
<p>Let&#8217;s have a look at the different ways we can solve this!</p>
<h3 class="mast">IP Unnumbered</h3>
<p><strong>R4:</strong></p>
<pre>
<code>interface lo0
 ip add 192.168.1.45.4 255.255.255.0
!
interface Serial1/1
 ip unnumbered Loopback0
 encapsulation ppp
 clock rate 64000</code>
</pre>
<p><strong>R5:</strong></p>
<pre>
<code>interface Serial1/1
 ip address 192.168.45.5 255.255.255.0
 encapsulation ppp
 no peer neighbor-route</code>
</pre>
<pre>
<code>R4#sh ip route | b Gateway
Gateway of last resort is not set

     192.168.45.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.45.5/32 is directly connected, Serial1/1
C       192.168.45.0/24 is directly connected, Loopback0</code>
</pre>
<pre>
<code>R5#sh ip route | b Gateway
Gateway of last resort is not set

C    192.168.45.0/24 is directly connected, Serial1/1</code>
</pre>
<p>The no peer neighbor-route is not needed on R5, but I put it there to illustrate a point. R5 doesn&#8217;t need the peer neighbor-route to R4 because it will see the 192.168.45.0/24 subnet as directly connected on its s1/1 interface. R4 does need the peer route to 192.168.45.5/32 otherwise it will forward any packets destined to that address out Lo0.</p>
<h3 class="mast">PPP IPCP</h3>
<p><strong>R4:</strong></p>
<pre>
<code>interface Serial1/1
 ip address negotiated
 encapsulation ppp
 clock rate 64000</code>
</pre>
<p><strong>R5:</strong></p>
<pre>
<code>interface Serial1/1
 ip address 192.168.45.5 255.255.255.0
 encapsulation ppp
 no peer neighbor-route
 peer default ip address 192.168.45.4</code>
</pre>
<pre>
<code>R4#sh ip route | b Gateway
Gateway of last resort is not set

     192.168.45.0/32 is subnetted, 2 subnets
C       192.168.45.5 is directly connected, Serial1/1
C       192.168.45.4 is directly connected, Serial1/1</code>
</pre>
<pre>
<code>R5#sh ip route | b Gateway
Gateway of last resort is not set

C    192.168.45.0/24 is directly connected, Serial1/1</code>
</pre>
<p>We have used IPCP to give R4 and IP address. R4 needs the peer route, otherwise its routing table will only have a route to the 192.168.45.4/32 network. R5 doesn&#8217;t need the peer neighbor-route because that subnet is directly connected on the interface. </p>
<h3 class="mast">PPP Multilink</h3>
<p><strong>R4:</strong></p>
<pre>
<code>interface Multilink1
 ip address 192.168.45.4 255.255.255.0
 no peer neighbor-route
!
interface Serial1/1
 no ip address
 encapsulation ppp
 clock rate 64000
 ppp multilink
 ppp multilink group 1</code>
</pre>
<p><strong>R5:</strong></p>
<pre>
<code>interface Multilink1
 ip address 192.168.45.5 255.255.255.0
 no peer neighbor-route
!
interface Serial1/1
 no ip address
 encapsulation ppp
 ppp multilink
 ppp multilink group 1</code>
</pre>
<pre>
<code>R4#sh ip route | b Gateway
Gateway of last resort is not set

C    192.168.45.0/24 is directly connected, Multilink1</code>
</pre>
<p>The IP address isn&#8217;t on R4&#8217;s s1/1 interface! :)</p>
<p>Once again the <em>no peer neighbor-route command</em> is not needed, but is used to show that we don&#8217;t require a /32 to the remote end of the PPP connection. </p>
<h3 class="mast">PPP over Frame Relay</h3>
<p><strong>R4:</strong></p>
<pre>
<code>interface Serial1/1
 no ip address
 encapsulation frame-relay
 no keepalive
 clockrate 64000
 no frame-relay inverse-arp
!
interface Serial1/1.45 point-to-point
 frame-relay interface-dlci 45 ppp Virtual-Template1
!
interface Virtual-Template1
 ip address 192.168.45.4 255.255.255.0
 no peer neighbor-route</code>
</pre>
<p><strong>R5:</strong></p>
<pre>
<code>interface Serial1/1
 no ip address
 encapsulation frame-relay
 no keepalive
 no frame-relay inverse-arp
!
interface Serial1/1.45 point-to-point
 frame-relay interface-dlci 45 ppp Virtual-Template1
!
interface Virtual-Template1
 ip address 192.168.45.5 255.255.255.0
 no peer neighbor-route</code>
</pre>
<pre>
<code>R4#sh ip route | b Gateway
Gateway of last resort is not set

C    192.168.45.0/24 is directly connected, Virtual-Access1</code>
</pre>
<pre>
<code>R5#sh ip route | b Gateway
Gateway of last resort is not set

C    192.168.45.0/24 is directly connected, Virtual-Access1</code>
</pre>
<p>We have disabled LMI with the <em>no keepalive</em> command so we can do back-to-back frame-relay. Once again we have used no peer neighbor-route it illustrate that we don&#8217;t need a specific /32 to the other end.</p>
<p>Cool Huh? Why the hell would you need this stuff outside the CCIE? You wouldn&#8217;t! Just configure the damn interface with 192.168.45.4/24! Since when was the CCIE about best practices and how you would do it in real life?! :)</p>
<p>Anybody know of any other methods?</p>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/troubleshooting-ip-addressing-tricks-tips-using-ppp/">Troubleshooting: IP Addressing Tricks &#038; Tips Using PPP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/ios-features-management/troubleshooting-ip-addressing-tricks-tips-using-ppp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multicast: What is the difference between an igmp filter and an igmp access-group?</title>
		<link>http://ardenpackeer.com/ios-features-management/multicast-what-is-the-difference-between-an-igmp-filter-and-an-igmp-access-group/</link>
		<comments>http://ardenpackeer.com/ios-features-management/multicast-what-is-the-difference-between-an-igmp-filter-and-an-igmp-access-group/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 07:46:06 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[access list]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[igmp]]></category>
		<category><![CDATA[igmp filtering]]></category>
		<category><![CDATA[mock labs]]></category>
		<category><![CDATA[multicast]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/ios-features-management/multicast-what-is-the-difference-between-an-igmp-filter-and-an-igmp-access-group/</guid>
		<description><![CDATA[After doing IE Mock Lab 5, and analyzing it over the last few days, I had an epiphany with regards to an igmp filtering question. The question required you to limit users joining a certain multicast group, and also place a limit on how many groups users in that vlan can join. I immediately thought "Oh cool, no problem <em>ip igmp access-group</em> with a standard access list, and an <em>ip igmp limit</em> and we are good to go! This stuff is easy". Brrr! Wrong! :)<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/multicast-what-is-the-difference-between-an-igmp-filter-and-an-igmp-access-group/">Multicast: What is the difference between an igmp filter and an igmp access-group?</a></p>
]]></description>
			<content:encoded><![CDATA[<p>After doing IE Mock Lab 5, and analyzing it over the last few days, I had an epiphany with regards to an igmp filtering question. The question required you to limit users joining a certain multicast group, and also place a limit on how many groups users in that vlan can join. I immediately thought &#8220;Oh cool, no problem <em>ip igmp access-group</em> with a standard access list, and an <em>ip igmp limit</em> and we are good to go! This stuff is easy&#8221;. Brrr! Wrong! :)</p>
<p>The <a href="http://www.cisco.com/en/US/docs/ios/12_3t/ip_mcast/command/reference/ip3_i1gt.html#wp1072480">ip igmp limit</a> and <a href="http://www.cisco.com/en/US/docs/ios/12_3t/ip_mcast/command/reference/ip3_i1gt.html#wp1117805">ip igmp access-group</a> commands apply to a layer 3 routed port! The question involved setting this up on a layer 2 port so this wouldn&#8217;t work properly. The correct answer involved <a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst3560/software/release/12.2_44_se/command/reference/cli1.html#wp2238359">ip igmp profile</a> and <a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst3560/software/release/12.2_44_se/command/reference/cli1.html#wp2238313">ip igmp max-groups</a>.</p>
<p>So, lets say you have a requirement where you want to limit users on vlan 10 from joining multicast groups 232.0.0.0 -> 239.255.255.255. The requirement also says to limit it so they can belong to only 5 multicast groups. How would you do this on a layer 2 port vs a layer 3 port? I&#8217;m glad you asked! :)</p>
<h3 class="mast">Solution on Layer 3 Switch:</h3>
<p><strong>Layer 2 Port (ie switchport)</strong></p>
<pre>
<code>int f0/10
 switchport mode access
 switchport access vlan 10
 ip igmp max-groups 5
 ip igmp filter 1
!
ip igmp profile 1
 deny
 range 232.0.0.0 239.255.255.255</code>
</pre>
<p><strong>Layer 3 Port (ie routed port)</strong></p>
<pre>
<code>int vlan 10
 ip igmp access-group DENY_THESE_GROUPS
 ip igmp limit 5
!
ip access-list standard DENY_THESE_GROUPS
 deny 232.0.0.0 7.255.255.255
 permit any</code>
</pre>
<p>The Layer 3 port configuration would equally apply on a routed port (ie port with <em>no switchport</em> configured or a port on a router). Notice the differences in defining of the groups allowed. &#8220;Hey Ards, How about one of your famous tutorials on this so I can follow along in Dynamips?&#8221;. Sorry, no time :) My CCIE lab is in 30 days and I have a million practice labs to do! I&#8217;ll write one up when I&#8217;m done&#8230;hopefully with some CCIE digits next to my name!</p>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/multicast-what-is-the-difference-between-an-igmp-filter-and-an-igmp-access-group/">Multicast: What is the difference between an igmp filter and an igmp access-group?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/ios-features-management/multicast-what-is-the-difference-between-an-igmp-filter-and-an-igmp-access-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: How to set up backup interfaces</title>
		<link>http://ardenpackeer.com/ios-features-management/tutorial-how-to-set-up-backup-interfaces/</link>
		<comments>http://ardenpackeer.com/ios-features-management/tutorial-how-to-set-up-backup-interfaces/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 09:55:08 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[backup interface]]></category>
		<category><![CDATA[eigrp]]></category>
		<category><![CDATA[point-to-point]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/ios-features-management/tutorial-how-to-set-up-backup-interfaces/</guid>
		<description><![CDATA[The idea behind a backup interface is a simple one. If your main interface goes down, a secondary interface (like ISDN or frame) is brought up and traffic goes through this until connectivity is restored to the main interface. In this article we will be exploring how we can implement such a configuration using the Cisco IOS <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hdia_r/dia_a1h.htm#wp1078001">backup interface</a> command. <p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/tutorial-how-to-set-up-backup-interfaces/">Tutorial: How to set up backup interfaces</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A common scenario that you might face when working with routers is the need to have an alternate path for traffic if your main interface goes down. Say for example you have your branch office connected to your main office via Frame-Relay. If this connection goes down, you might want an ISDN connection to be brought up and traffic automatically redirected through that interface. </p>
<p>This is the main idea behind a backup interface. If your main interface goes down, a secondary interface (like ISDN or frame) is brought up and traffic goes through this until connectivity is restored to the main interface. In this article we will be exploring how we can implement such a configuration using the Cisco IOS <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hdia_r/dia_a1h.htm#wp1078001">backup interface</a> command. </p>
<p>We will be using the following topology for this tutorial:</p>
<div class="captionfull"><img src='http://ardenpackeer.com/wp-content/uploads/2008/02/backup-int.gif' alt='Backup Interface Topology' /></div>
<p>The Dynagen configuration that I am using to demonstrate this is as follows:</p>
<pre>
<code>ghostios = True
sparsemem = True
model = 3640

[localhost]

    [[3640]]
        image = \Program Files\Dynamips\images\c3640-jk9o3s-mz.124-12.bin
        # On Linux / Unix use forward slashes:
        # image = /opt/7200-images/c7200-jk9o3s-mz.124-7a.image
        ram = 96

    [[ROUTER R1]]
        f0/0 = LAN 1
        s1/0 = FRAME 1
        s1/1 = R2 s1/1
        console = 2000
        model = 3640

    [[ROUTER R2]]
        f0/0 = LAN 2
        s1/0 = FRAME 2
        console = 2001
        model = 3640

    [[FRSW FRAME]]
        1:102 = 2:201</code>
</pre>
<p>You can download this configuration .net file <a href='http://ardenpackeer.com/wp-content/uploads/2008/02/backup-int.net' title='Backup Interface Topology - Dynagen .net'>here.</a></p>
<p>Let&#8217;s set up the basic configuration. We are going to implement a point-to-point frame relay connection, and run EIGRP as our routing protocol.</p>
<p><strong>R1:</strong></p>
<pre>
<code>hostname R1
!
interface FastEthernet0/0
 ip address 1.1.1.1 255.255.255.0
!
interface Serial1/0
 no ip address
 encapsulation frame-relay
 serial restart-delay 0
 no frame-relay inverse-arp
!
interface Serial1/0.12 point-to-point
 ip address 192.168.1.1 255.255.255.0
 frame-relay interface-dlci 102
!
interface Serial1/1
 ip address 192.168.2.1 255.255.255.0
!
router eigrp 1
 network 1.0.0.0
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary</code>
</pre>
<p><strong>R2:</strong></p>
<pre>
<code>hostname R2
!
interface FastEthernet0/0
 ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
 no ip address
 encapsulation frame-relay
 no frame-relay inverse-arp
!
interface Serial1/0.12 point-to-point
 ip address 192.168.1.2 255.255.255.0
 frame-relay interface-dlci 201
!
interface Serial1/1
 ip address 192.168.2.2 255.255.255.0
!
router eigrp 1
 network 2.0.0.0
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary</code>
</pre>
<p>Let&#8217;s check connectivity and verify our routing table:</p>
<pre>
<code>R2#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/137/188 ms</code>
</pre>
<pre>
<code>R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2172416] via 192.168.2.1, 00:05:44, Serial1/1
                [90/2172416] via 192.168.1.1, 00:05:44, Serial1/0.12
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, Serial1/0.12
C    192.168.2.0/24 is directly connected, Serial1/1</code>
</pre>
<p>Looking at the routing table it looks like R2 has two paths to get to the 1.1.1.0/24 network attached to R1. EIGRP is doing its job and has discovered both paths to that network.</p>
<p>The scenario that we are going to implement is that our frame-relay connection is our main connection. The s1/1 connection is connected to an ISDN modem which we don&#8217;t want to send traffic through unless there is a failure on R2&#8217;s frame-relay connection.</p>
<p>Let&#8217;s have a look at the configuration:</p>
<pre>
<code>R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s1/0.12
R2(config-subif)#backup interface s1/1
R2(config-subif)#
*Mar  1 00:39: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.2.1 (Serial1/1) is down: interface down
*Mar  1 00:39: %LINK-5-CHANGED: Interface Serial1/1, changed state to standby mode
*Mar  1 00:39: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down</code>
</pre>
<pre>
<code>R2#sh int s1/1
Serial1/1 is standby mode, line protocol is down
  Hardware is M4T
  Internet address is 192.168.2.2/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, crc 16, loopback not set
  Keepalive set (10 sec)
  Restart-Delay is 0 secs
  Last input 00:05:13, output 00:05:10, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/1/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     430 packets input, 24351 bytes, 0 no buffer
     Received 243 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     443 packets output, 23912 bytes, 0 underruns
     0 output errors, 0 collisions, 2 interface resets
     0 output buffer failures, 0 output buffers swapped out
     3 carrier transitions     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up</code>
</pre>
<p>Here we have configured serial 1/1 to be the backup interface for serial 1/0.12 (our frame-relay interface). Serial 1/0.12 is our primary interface and Serial 1/1 is our secondary interface. </p>
<p>You can see that as soon as we configure this the s1/1 interface state was changed to the standby state. It will remain in this state until our main interface serial 1/0.12 goes into the down state. </p>
<p>We can verify the backup configuration using the show backup command:</p>
<pre>
<code>R2#sh backup
Primary Interface   Secondary Interface   Status
-----------------   -------------------   ------
Serial1/0.12        Serial1/1             normal operation</code>
</pre>
<p>We can see here that serial 1/0.12 is acting as the primary interface. If that interface enters the down state the secondary interface will brought up.</p>
<h3>Testing the Configuration</h3>
<p>Let&#8217;s test the configuration. We will shut down the main interface. The standby interface will should then be brought up and we will form a EIGRP neighbor relationship with R1 over the standby interface.</p>
<p>Let&#8217;s have a look at the current routing table before we take down our main interface.</p>
<pre>
<code>R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2172416] via 192.168.1.1, 00:09:31, Serial1/0.12
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, Serial1/0.12</code>
</pre>
<p>You can see above that traffic to the 1.1.1.0/24 subnet is via our frame-relay connection. Let&#8217;s take down the interface and verify that the backup configuration is working.</p>
<pre>
<code>R2(config)#int s1/0
R2(config-if)#shut
R2(config-if)#end
R2#
*Mar  1 00:49: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.1.1 (Serial1/0.12) is down: interface down
*Mar  1 00:49: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 00:49: %LINK-5-CHANGED: Interface Serial1/0, changed state to administratively down
*Mar  1 00:49: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
*Mar  1 00:49: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar  1 00:49: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up</code>
</pre>
<pre>
<code>R2#sh backup
Primary Interface   Secondary Interface   Status
-----------------   -------------------   ------
Serial1/0.12        Serial1/1             backup mode
R2#
*Mar  1 00:49: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.2.1 (Serial1/1) is up: new adjacency</code>
</pre>
<p>Looks great. You can see that as soon as the main interface went down (interface serial 1/0.12) the standby interface was immediately brought up. Using the show backup command above, you can see that we are now operating in backup mode. </p>
<pre>
<code>R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2172416] via 192.168.2.1, 00:00:15, Serial1/1
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, FastEthernet0/0
D    192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:00:15, Serial1/1
C    192.168.2.0/24 is directly connected, Serial1/1</code>
</pre>
<p>Traffic to the 1.1.1.0/24 will now traverse the secondary interface until the main interface is brought back up. </p>
<pre>
<code>R2#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/80/212 ms</code>
</pre>
<p>Let&#8217;s have a look and see what happens when the main interface is brought back up.</p>
<pre>
<code>R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s1/0
R2(config-if)#no shut
R2(config-if)#end
R2#
*Mar  1 00:54: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 00:54: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.1.1 (Serial1/0.12) is up: new adjacency
*Mar  1 00:54: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar  1 00:54: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.2.1 (Serial1/1) is down: interface down
*Mar  1 00:54: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
*Mar  1 00:54: %LINK-5-CHANGED: Interface Serial1/1, changed state to standby mode
*Mar  1 00:54: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down</code>
</pre>
<pre>
<code>R2#sh backup
Primary Interface   Secondary Interface   Status
-----------------   -------------------   ------
Serial1/0.12        Serial1/1             normal operation</code>
</pre>
<p>Looks like it works as advertised! When the main interface for frame-relay is up, our secondary interface is in the standby state. When the main interface goes down, our secondary interface immediately comes up and connectivity to the 1.1.1.0/24 is maintained.</p>
<h3>Waiting to Resume a Connection</h3>
<p>Let&#8217;s say that the backup configuration is in a backup state (ie, the main interface has gone down). When the interface comes back up, the secondary interface switches back into a standby state immediately. This might not always be a good idea. Especially if the main interface is a bit flaky. We might want to wait a little while before we go into the standby state again in case the primary interface is flapping.</p>
<p>Let&#8217;s configure R2 to switch immediately to s1/1 if the main interface goes down. However if the main interface comes back up, we want to wait 5 minutes before interface s1/1 goes back into the standby state. We can implement this with the <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hdia_r/dia_a1h.htm#wp1075263">backup delay</a> command.</p>
<p><strong>R2:</strong></p>
<pre>
<code>interface Serial1/0.12 point-to-point
 backup delay 0 300
 backup interface Serial1/1
 ip address 192.168.1.2 255.255.255.0
 frame-relay interface-dlci 201   </code>
</pre>
<p>You can see above the backup delay command takes two arguments. The first argument is how long to wait before switching over to the standby interface (in this case 0 seconds ie. immediately). The second argument is how long the standby interface should wait once the main interface comes back up before switching back to the standby state (in this case 300 seconds ie. 5 minutes). </p>
<p>Let&#8217;s test it:</p>
<pre>
<code>R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s1/0
R2(config-if)#shut
R2(config-if)#en
*Mar  1 01:21: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.1.1 (Serial1/0.12) is down: interface do
*Mar  1 01:21: %LINK-5-CHANGED: Interface Serial1/0, changed state to administratively down
*Mar  1 01:21: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
*Mar  1 01:21: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar  1 01:21: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up</code>
</pre>
<pre>
<code>R2#sh backu
*Mar  1 01:21:22.955: %SYS-5-CONFIG_I: Configured from console by console
Primary Interface   Secondary Interface   Status
-----------------   -------------------   ------
Serial1/0.12        Serial1/1             backup mode
*Mar  1 01:21: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.2.1 (Serial1/1) is up: new adjacency</code>
</pre>
<p>So it looks like our configuration is still working, with the standby interface coming up as soon as the main interface goes down.</p>
<pre>
<code>R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s1/0
R2(config-if)#no shut
*Mar  1 01:21: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar  1 01:21: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.1.1 (Serial1/0.12) is up: new adjacency
*Mar  1 01:21: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up</code>
</pre>
<pre>
<code>R2#sh backup
Primary Interface   Secondary Interface   Status
-----------------   -------------------   ------
Serial1/0.12        Serial1/1             waiting to revert (288 more seconds)</code>
</pre>
<p>You can see above, the secondary interface did not reenter the standby state. It will revert to the standby state once the 300 seconds have elapsed. Let&#8217;s  wait 5 minutes and see if Serial1/1 reverts back to the standby state:</p>
<pre>
<code>R2#
*Mar  1 01:26: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.2.1 (Serial1/1) is down: interface down
*Mar  1 01:26: %LINK-5-CHANGED: Interface Serial1/1, changed state to standby mode
*Mar  1 01:26: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down
R2#
R2#sh backup
Primary Interface   Secondary Interface   Status
-----------------   -------------------   ------
Serial1/0.12        Serial1/1             normal operation</code>
</pre>
<p>Looks great. So we have a working backup configuration. Hope this helps, now back to labs! </p>
<p><strong>Summary:</strong></p>
<ul>
<li>You can use the backup interface command to configure primary and secondary interfaces</li>
<li>The backup interface command is configured on the primary interface and takes the secondary interface as an argument</li>
<li>When the primary interface is up, the secondary interface is in a standby state. </li>
<li>When the primary interface is down, the secondary interface is immediately brought up. </li>
<li>You can configure a delay both for when the primary interface goes down, and when it comes back up</li>
</ul>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="'http://ardenpackeer.com/wp-content/uploads/2008/02/backup-int.net">Dynamips/Dynagen .net configuration file</a></li>
</ul>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/tutorial-how-to-set-up-backup-interfaces/">Tutorial: How to set up backup interfaces</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/ios-features-management/tutorial-how-to-set-up-backup-interfaces/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tutorial: How to use Cisco MQC &amp; NBAR to filter websites like Youtube</title>
		<link>http://ardenpackeer.com/qos-voip/tutorial-how-to-use-cisco-mqc-nbar-to-filter-websites-like-youtube/</link>
		<comments>http://ardenpackeer.com/qos-voip/tutorial-how-to-use-cisco-mqc-nbar-to-filter-websites-like-youtube/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 01:32:47 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[QoS & VoIP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[dynagen]]></category>
		<category><![CDATA[dynamips]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[mqc]]></category>
		<category><![CDATA[nbar]]></category>
		<category><![CDATA[qos]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/qos-voip/tutorial-how-to-use-cisco-mqc-nbar-to-filter-websites-like-youtube/</guid>
		<description><![CDATA[I was asked a great question by one of my clients regarding filtering of websites. He had filtered youtube and google video at his proxy server but with the number of different video sites popping up (metacafe, jibjab etc etc), his filters just couldn&#8217;t keep up&#8230;and neither could his bandwidth!
One solution to this problem is [...]<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/qos-voip/tutorial-how-to-use-cisco-mqc-nbar-to-filter-websites-like-youtube/">Tutorial: How to use Cisco MQC &#038; NBAR to filter websites like Youtube</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I was asked a great question by one of my clients regarding filtering of websites. He had filtered <a href="http://www.youtube.com/">youtube</a> and <a href="http://video.google.com.au/">google video</a> at his proxy server but with the number of different video sites popping up (metacafe, jibjab etc etc), his filters just couldn&#8217;t keep up&#8230;and neither could his bandwidth!</p>
<p>One solution to this problem is the use of Cisco&#8217;s Network Based Application Recognition (NBAR). NBAR is a deep packet inspection and classification engine. It was first introduced in experimental versions of IOS v12.1 and can be used with Cisco&#8217;s <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cg/hqos_c/part40/qctmcli2.htm">Modular Quality Of Service Command Line (MQC)</a>.</p>
<p>In this article we will look at using MQC to filter websites. I will demonstrate using the <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hqos_r/qos_m1h.htm#wp1128712">match protocol http</a> command to match a URL, a host or MIME type. We will use the following topology for demonstration:</p>
<div class="captionfull"><img src="http://ardenpackeer.com/wp-content/uploads/2007/12/topology1.gif" alt="Network Topology - Webserver" /></div>
<p>R3 will act as a webserver and R1 as a client. The filtering will be applied on R2. You can download the dynamips .net file the following topology <a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver.net">here</a>.<br />
R1 Base Configuration:</p>
<pre>
<code>hostname R1
!
int s1/0
 ip add 10.0.12.1 255.255.255.0
 no shut
!
router ospf 1
 network 10.0.12.1 0.0.0.0 area 0</code></pre>
<p>R2 Base Configuration:</p>
<pre>
<code>hostname R2
!
int s1/0
 ip add 10.0.12.2 255.255.255.0
 no shut
!
int s1/1
 ip add 10.0.23.2 255.255.255.0
 no shut
!
router ospf 1
 network 10.0.12.2 0.0.0.0 area 0
 network 10.0.23.2 0.0.0.0 area 0</code></pre>
<p>R3 Base Configuration:</p>
<pre>
<code>hostname R3
!
int s1/0
 ip add 10.0.23.3 255.255.255.0
 no shut
!
int f0/0
 ip add 192.168.1.100 255.255.255.0
 no shut
!
router ospf 1
 network 10.0.23.3 0.0.0.0 area 0
!
ip http server
ip http path flash:</code></pre>
<p>We have set up R3 as a webserver. Details on how to setup R3 as a webserver using IOS can be found <a href="http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/">here</a>.</p>
<pre>
<code>R3#sh run | in ip http
ip http server
no ip http secure-server
ip http path flash:</code></pre>
<pre>
<code>R3#dir
Directory of flash:/

    1  -rw-          90                    &lt;no&gt;  picture.gif
    2  -rw-         329                    &lt;no&gt;  picture.jpg
    3  -rw-         174                    &lt;no&gt;  index.html

8388604 bytes total (8387812 bytes free)
&lt;/no&gt;&lt;/no&gt;&lt;/no&gt;</code></pre>
<p><strong>Basic HTTP Filtering using NBAR</strong></p>
<p>Lets set up basic http filtering with MQC on R2.</p>
<pre>
<code>R2(config)#class-map match-all MATCH-HTTP
R2(config-cmap)#match protocol http
R2(config-cmap)#exit
R2(config)#policy-map HTTP-POLICY
R2(config-pmap)#class MATCH-HTTP
R2(config-pmap-c)#set dscp af13
R2(config-pmap-c)#exit
R2(config-pmap)#int s1/0
R2(config-if)#service-policy input HTTP-POLICY</code></pre>
<p>In the code above we have a class map called MATCH-HTTP. The match protocol http command tells NBAR to match the http protocol. This will match all http traffic. The MATCH-HTTP class is then utilized in the HTTP-POLICY policy map. This policy map is used to set a DSCP marking on all traffic that matches the MATCH-HTTP class (ie all http traffic). The policy is then implemented on R2&#8217;s s1/0. Traffic is inspected and marked as it comes into that interface.</p>
<p>We can check how many packets have been marked using the show policy-map command.</p>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http
      QoS Set
        dscp af13
          Packets marked 0

    Class-map: class-default (match-any)
      2 packets, 168 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any
R2#</code></pre>
<p>Lets generate some http traffic, and see if our policy marks some packets.</p>
<pre>
<code>R1#copy http://10.0.23.3/index.html null:
Loading http://10.0.23.3/index.html
174 bytes copied in 0.544 secs (320 bytes/sec)</code></pre>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      5 packets, 344 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http
      QoS Set
        dscp af13
          Packets marked 5

    Class-map: class-default (match-any)
      124 packets, 10340 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>We used the <strong>copy http://10.0.23.3/index.html null:</strong> command to generate some http traffic. We can see above that 5 packets were generated and were marked as af13. All other traffic will fall into the class-default class. With the packets marked, we could forward them or drop them.</p>
<p>Instead of matching all of the http protocol we can use NBAR to look further into the packet and classify or drop packets based on the host requested.</p>
<p><strong>Match protocol HTTP host</strong></p>
<p>The match protocol HTTP url command is used to match a url. It takes a regular expression as an argument. For example:</p>
<pre>
<code>match protocol http host *youtube.com*
! This would match anything in youtube.com like http://www.youtube.com or http://video.youtube.com
!
match protocol http host *google*
! This would match anything with google in the host like http://mail.google.com or
http://www.google.com.au
!
match protocol http host google*
! This would match http://google.com but not http://video.google.com</code></pre>
<p>Lets set up R2 to filter based on a host.</p>
<pre>
<code>R2(config)#class-map MATCH-HTTP
R2(config-cmap)#no match protocol http
R2(config-cmap)#match protocol http host 10.0.23.3</code></pre>
<pre>
<code>R2#clear counters s1/0
Clear "show interface" counters on this interface [confirm]
*Mar  1 00:04:42.071: %CLEAR-5-COUNTERS: Clear counter on interface Serial1/0 by console
R2#
R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http host "10.0.23.3"
      QoS Set
        dscp af13
          Packets marked 0

    Class-map: class-default (match-any)
      1 packets, 84 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>We&#8217;ve cleared the counters on R2, so lets generate some traffic on R1 again.</p>
<pre>
<code>R1#copy http://10.0.23.3/index.html null:
Loading http://10.0.23.3/index.html
174 bytes copied in 0.596 secs (292 bytes/sec)</code></pre>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      5 packets, 344 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http host "10.0.23.3"
      QoS Set
        dscp af13
          Packets marked 5

    Class-map: class-default (match-any)
      64 packets, 5300 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>We can see here it matched 5 packets based on the host. We can use this to match whole sites like youtube.com or video.google.com.</p>
<p><strong>Match protocol HTTP url</strong></p>
<p>We can match strings AFTER the host portion of a URL using the match protocol http url command. It also takes a regular expression as an argument. For example:</p>
<pre>
<code>match protocol http url *video*
! This would match http://www.cisco.com/video/index.php or
http://www.google.com/stuff/video.html
!
match protocol http url video*
! This would match http://www.cisco.com/video but not http://www.cisco.com/stuff/video.html
! because stuff precedes the video portion of the url and in the expression above we have said
! it has to start with the string video
!
match protocol http url *.jpeg|*.jpg|*.gif
! This would match any .jpeg or .jpg or .gif extention in the url</code></pre>
<p>Lets set up R2 to match based on a URL.</p>
<pre>
<code>R2(config)#class-map MATCH-HTTP
R2(config-cmap)#no match protocol http host 10.0.23.3
R2(config-cmap)#match protocol http url *.jpg</code></pre>
<p>As you can see above we have used the match protocol http url function of NBAR to match any url that ends in a .jpg. This effectively blocks jpeg images (unless they have a different extension).</p>
<p>Let test it, before we send some traffic we&#8217;ll reset the counters on the interface.</p>
<pre>
<code>R2#clear counters s1/0
Clear "show interface" counters on this interface [confirm]
*Mar  1 00:43:39.135: %CLEAR-5-COUNTERS: Clear counter on interface Serial1/0 by console
R2#
R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http url "*.jpg"
      QoS Set
        dscp af13
          Packets marked 0

    Class-map: class-default (match-any)
      1 packets, 84 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>If we request a gif file we <strong>shouldn&#8217;t</strong> match the class MATCH-HTTP. Lets test that first.</p>
<pre>
<code>R1#copy http://10.0.23.3/picture.gif null:
Loading http://10.0.23.3/picture.gif
90 bytes copied in 0.644 secs (140 bytes/sec)</code></pre>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http url "*.jpg"
      QoS Set
        dscp af13
          Packets marked 0

    Class-map: class-default (match-any)
      18 packets, 1209 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>Great Success! Looks pretty good. Now lets try a .jpg extension. We <strong>should</strong> match this.</p>
<pre>
<code>R1#copy http://10.0.23.3/picture.jpg null:
Loading http://10.0.23.3/picture.jpg
329 bytes copied in 0.820 secs (401 bytes/sec)</code></pre>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      7 packets, 433 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http url "*.jpg"
      QoS Set
        dscp af13
          Packets marked 7

    Class-map: class-default (match-any)
      22 packets, 1469 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>Awesome! You can see above we matched based on a URL.</p>
<p><strong>match protocol http mime</strong></p>
<p>We can also use the match protocol http mime to match internet mime types. The mime type has to be the same mime type that the web server responds with. For a list of valid mime types check out: <a href="http://www.sfsu.edu/training/mimetype.htm">http://www.sfsu.edu/training/mimetype.htm</a>. Lets look at an example:</p>
<pre>
<code>match protocol http mime image/jpeg
! This would match jpeg,jpg,jpe,jfif,pjpeg, and pjp types
!
match protocol http mime image/jpg
! This would not match anything as it is not a proper mime type. Get a list of the mime types
! here: http://www.sfsu.edu/training/mimetype.htm
!
match protocol http mime image*
! This would match all image mime types
!
match protocol http mime application/x-shockwave-flash
! This would not only match swf flash movies, but all of flash.</code></pre>
<p>Lets set up R2 to filter the image/jpeg mime type:</p>
<pre>
<code>R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#class-map MATCH-HTTP
R2(config-cmap)#no match protocol http url *.jpg
R2(config-cmap)#match protocol http mime ?
  WORD  Enter a string as the sub-protocol parameter

R2(config-cmap)#match protocol http mime image/jpeg
R2(config-cmap)#exit
R2(config)#exit</code></pre>
<p>Once again, we&#8217;ll clear the counters so we can verify that this works correctly.</p>
<pre>
<code>R2#clear counters s1/0
Clear "show interface" counters on this interface [confirm]
*Mar  1 01:12:10.759: %CLEAR-5-COUNTERS: Clear counter on interface Serial1/0 

R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http mime "image/jpeg"
      QoS Set
        dscp af13
          Packets marked 0

    Class-map: class-default (match-any)
      1 packets, 84 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>On R1 lets generate some traffic. A gif file will be requested first. This <strong>should not</strong> match our policy.</p>
<pre>
<code>R1#copy http://10.0.23.3/picture.gif null:
Loading http://10.0.23.3/picture.gif
90 bytes copied in 0.808 secs (111 bytes/sec)</code></pre>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http mime "image/jpeg"
      QoS Set
        dscp af13
          Packets marked 0

    Class-map: class-default (match-any)
      10 packets, 689 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>All good! Ok lets do the final test and actually request a jpeg image and see if it matches our policy.</p>
<pre>
<code>R1#copy http://10.0.23.3/picture.jpg null:
Loading http://10.0.23.3/picture.jpg
329 bytes copied in 1.216 secs (271 bytes/sec)</code></pre>
<pre>
<code>R2#sh policy-map int s1/0
 Serial1/0 

  Service-policy input: HTTP-POLICY

    Class-map: MATCH-HTTP (match-all)
      5 packets, 220 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http mime "image/jpeg"
      QoS Set
        dscp af13
          Packets marked 5

    Class-map: class-default (match-any)
      16 packets, 1162 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any</code></pre>
<p>You can see above that the jpeg image was matched. It works!</p>
<p><strong>Putting it all together</strong></p>
<p>So lets put it all together. We can use all three match protocol http commands in a match-any class map. For example:</p>
<pre>
<code>class-map match-any INTERNET-SCUM
 match protocol http host *youtube.com*|*video.google.com*
 match protocol http mime video/flv|video/x-flv|video/mp4|video/x-m4v|audio/mp4a-latm
 match protocol http mime video/3gpp|video/quicktime
 match protocol http url *.flv|*.mp4|*.m4v|*.m4a|*.3gp|*.mov
! uncomment below if you don't want ANY flash.
! match protocol http mime application/x-shockwave-flash
! match protocol http url *.swf
!
policy-map NOINTERNETVIDEO
 class INTERNET-SCUM
  drop
!
int s1/0
 service-policy input NOINTERNETVIDEO
!</code></pre>
<p>This would match any traffic going to youtube or video.google.com, or any flash applications, or common video mime types, and any swf (flash or flash movie) files! Be aware that NBAR does make your router take a hit in CPU processor usage, I&#8217;d suggest evaluating your processor usage before using this in production.</p>
<p>HTH! Now back to labs!</p>
<p><strong>Summary:</strong></p>
<ul>
<li>Use the <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hqos_r/qos_m1h.htm#wp1128712">match http protocol</a> command to match the http protocol.</li>
<li>match protocol http host matches the host portion</li>
<li>match protocol http url matches the url after the hostname</li>
<li>match protocol http mime matches mime types</li>
</ul>
<p><strong>Resources</strong><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver.net" title="Webserver - Dynamips .net configuration file">Webserver &#8211; Dynamips .net configuration file</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/qoshttp-r1.txt" title="QOS HTTP Filtering - R1 Final Configuration">QOS HTTP Filtering &#8211; R1 Final Configuration</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/qoshttp-r2.txt" title="QOS HTTP Filtering - R2 Final Configuration">QOS HTTP Filtering &#8211; R2 Final Configuration</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/qoshttp-r3.txt" title="QOS HTTP Filtering - R3 Final Configuration">QOS HTTP Filtering &#8211; R3 Final Configuration</a></p>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/qos-voip/tutorial-how-to-use-cisco-mqc-nbar-to-filter-websites-like-youtube/">Tutorial: How to use Cisco MQC &#038; NBAR to filter websites like Youtube</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/qos-voip/tutorial-how-to-use-cisco-mqc-nbar-to-filter-websites-like-youtube/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Tutorial: How to set up a Cisco router as a Web Server</title>
		<link>http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/</link>
		<comments>http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 03:36:27 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[dynagen]]></category>
		<category><![CDATA[dynamips]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/</guid>
		<description><![CDATA[Need a basic webserver? Did you know that little Cisco router in the corner can act as as one? Well, now you do! In this article we will be setting up a basic webserver on a cisco router. I will be using dynamips to demonstrate this, but it works just as well on a real router! I was using dynamips to simulate a QOS lab where i wanted to mark certain HTTP traffic for shaping. I needed a way to simulate a webserver so that I could test it. Enter the <strong>ip http server</strong> command!
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/">Tutorial: How to set up a Cisco router as a Web Server</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Need a basic web server? Did you know that little Cisco router in the corner can act as as one? Well, now you do! In this article we will be setting up a basic web server on a cisco router. I will be using dynamips to demonstrate this, but it works just as well on a real router! I was using dynamips to simulate a QOS lab where i wanted to mark certain HTTP traffic for shaping. I needed a way to simulate a web server so that I could test it. Enter the <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hnm_r/nmg_02h.htm#wp1030905">ip http server</a> command!</p>
<p>We will be setting up this topology:</p>
<div class="captionfull"><img src="http://ardenpackeer.com/wp-content/uploads/2007/12/topology1.gif" alt="Network Topology - Webserver" /></div>
<p>I will bridge f0/0 on the virtual R3 to my real lan. This way I can transfer the files i need to my virtual router using tftp. So first we need to set up dynamips so that f0/0 on R3 is bridged to my computers ethernet card. When you install Dynagen it creates a command script called Network device list.cmd. This script displays your network cards with device names that dynamips can refer to.</p>
<p>When run it produces something like this:</p>
<div class="captionfull"><img src="http://ardenpackeer.com/wp-content/uploads/2007/12/dynamips-networkcards.gif" alt="Dynamips Network Cards" /></div>
<p>The red circle is the part we are interested in. That is how dynamips refers to our physical network card. In our .net file for dynamips we will bridge a virtual interface to this physical interface.</p>
<p>To do this, we create a .net file (<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver.net">webserver.net</a>) with the following contents:</p>
<pre>
<code>ghostios = true
sparsemem = true
model = 3640

[localhost]

    [[3640]]
    image = \Program Files\Dynamips\images\c3640-jk9o3s-mz.124-12.bin
    # On Linux / Unix use forward slashes:
    # image = /opt/7200-images/c7200-jk9o3s-mz.124-7a.image
    ram = 96

    [[ROUTER R1]]
    s1/0 = R2 s1/0

    [[ROUTER R2]]
    s1/1 = R3 s1/0

    [[ROUTER R3]]
    f0/0 = NIO_gen_eth:\Device\NPF_{064084F0-A2EA-45FA-A362-ADDBC779026C}</code></pre>
<p>This sets up the topology shown above, with R3&#8217;s f0/0 bridged to our physical network card. Now all we need to do is add an ip address to R3&#8217;s f0/0 thats in the same subnet as our physical network card and we should have connectivity between the two.</p>
<p>R1 Configuration:</p>
<pre>
<code>hostname R1
!
int s1/0
 ip add 10.0.12.1 255.255.255.0
 no shut
!
router ospf 1
 network 10.0.12.1 0.0.0.0 area 0</code></pre>
<p>R2 Configuration:</p>
<pre>
<code>hostname R2
!
int s1/0
 ip add 10.0.12.2 255.255.255.0
 no shut
!
int s1/1
 ip add 10.0.23.2 255.255.255.0
 no shut
!
router ospf 1
 network 10.0.12.2 0.0.0.0 area 0
 network 10.0.23.2 0.0.0.0 area 0</code></pre>
<p>R3 Configuration:</p>
<pre>
<code>hostname R3
!
int s1/0
 ip add 10.0.23.3 255.255.255.0
 no shut
!
int f0/0
 ip add 192.168.1.100 255.255.255.0
 no shut
!
router ospf 1
 network 10.0.23.3 0.0.0.0 area 0</code></pre>
<p>I have added an ip address to the R3 f0/0 interface that&#8217;s in the same subnet as my computer (192.168.1.0/24), so lets see if they can ping each other.</p>
<pre>
<code>R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
O       10.0.12.0 [110/128] via 10.0.23.2, 00:00:10, Serial1/0
C       10.0.23.0 is directly connected, Serial1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R3#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/48/116 ms</code></pre>
<p>You can see the virtual R3 has connectivity to the physical host machine (192.168.1.1)! I&#8217;ve set up a tftp server on my host machine using <a href="http://tftpd32.jounin.net/">tftpd32</a>. I will use the tftp server to put files on R3 that i can serve out using the IOS webserver.</p>
<pre>
<code>R3#<strong>copy tftp flash:</strong>
Address or name of remote host []? <strong>192.168.1.1</strong>
Source filename []? <strong>picture.gif</strong>
Destination filename [picture.gif]?
Accessing tftp://192.168.1.1/picture.gif...
Erase flash: before copying? [confirm]<strong>n</strong>
Loading picture.gif from 192.168.1.1 (via FastEthernet0/0): !
[OK - 90 bytes]

Verifying checksum...  OK (0xA319)
90 bytes copied in 0.216 secs (417 bytes/sec)</code></pre>
<pre>
<code>R3#<strong>copy tftp flash:</strong>
Address or name of remote host [192.168.1.1]? <strong>192.168.1.1</strong>
Source filename [picture.gif]? <strong>picture.jpg</strong>
Destination filename [picture.jpg]?
Accessing tftp://192.168.1.1/picture.jpg...
Erase flash: before copying? [confirm]<strong>n</strong>
Loading picture.jpg from 192.168.1.1 (via FastEthernet0/0): !
[OK - 329 bytes]

Verifying checksum...  OK (0x7656)
329 bytes copied in 0.244 secs (1348 bytes/sec)</code></pre>
<pre>
<code>R3#<strong>copy tftp flash:</strong>
Address or name of remote host [192.168.1.1]? <strong>192.168.1.1</strong>
Source filename [picture.jpg]? <strong>index.html</strong>
Destination filename [index.html]?
Accessing tftp://192.168.1.1/index.html...
Erase flash: before copying? [confirm]<strong>n</strong>
Loading index.html from 192.168.1.1 (via FastEthernet0/0): !
[OK - 174 bytes]

Verifying checksum...  OK (0xA4BA)
174 bytes copied in 0.264 secs (659 bytes/sec)</code></pre>
<pre>
<code>R3#<strong>dir</strong>
Directory of flash:/

    1  -rw-          90                    &lt;no&gt;  picture.gif
    2  -rw-         329                    &lt;no&gt;  picture.jpg
    3  -rw-         174                    &lt;no&gt;  index.html

8388604 bytes total (8387812 bytes free)
&lt;/no&gt;&lt;/no&gt;&lt;/no&gt;</code></pre>
<p>You can see above that we copied three files (picture.jpg, picture.gif and index.html) to R3. These are the files that will make up a basic webpage that we are serving out.</p>
<p>Lets set up the web server:</p>
<pre>
<code>R3(config)#ip http server
R3(config)#ip http path flash:</code></pre>
<p>The ip http server command activates the built in IOS webserver. By default this command will first look for a file called home.html on any filesystem. If this file exists it will serve this page. If this file doesn&#8217;t exist it then looks for a file called home.shtml on any filesystem. If this is not found, by default it will serve a default page with links to exec, SDM, QDM and TAC support.</p>
<p>The <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hnm_r/nmg_02h.htm#wp1030289">ip http path</a> flash: allows you the serve pages from the flash: device. Normally files cannot be served from flash: (other than home.html and home.shtml) unless you use the ip http path flash: command.</p>
<p>We now have our web server set up. Lets test it.</p>
<pre>
<code>R1#telnet 10.0.23.3 80
Trying 10.0.23.3, 80 ... Open
get /index.html

&lt;a href="http://www.ardenpackeer.com/picture.gif"&gt;picture.gif&lt;/a&gt;
&lt;a href="http://www.ardenpackeer.com/picture.jpg"&gt;picture.jpg&lt;/a&gt;

[Connection to 10.0.23.3 closed by foreign host]</code></pre>
<pre>
<code>R1#copy http://10.0.23.3/index.html null0
Destination filename [null0]?
Erase flash: before copying? [confirm]n
Loading http://10.0.23.3/index.html
Verifying checksum...  OK (0xA4BA)
174 bytes copied in 0.704 secs (247 bytes/sec)</code></pre>
<p>You can see above, we telneted into R3 port 80, and issued a GET request which returned the html file we entered. We can also use the copy command to retrieve files from the web server on R3. Great Success!</p>
<p>We will be using this web server to test NBAR http protocol matching in another article, but for now we have a working web server in IOS under dynamips.</p>
<p>HTH! Now back to labs!</p>
<p><strong>Summary:</strong></p>
<ul>
<li>You can use the Network device list.cmd script to get a list of all your physical interfaces for use with dynamips</li>
<li>The <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hnm_r/nmg_02h.htm#wp1030905">ip http server</a> command sets up a http server on IOS</li>
<li>The <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hnm_r/nmg_02h.htm#wp1030289">ip http path flash:</a> allows you to serve pages from the flash: device.</li>
</ul>
<p><strong>Resources:</strong><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver.net" title="Webserver - Dynamips .net configuration file">Webserver &#8211; Dynamips .net configuration file</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver-r1.txt" title="Webserver - R1 Final Configuration">Webserver &#8211; R1 Final Configuration</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver-r2.txt" title="Webserver - R2 Final Configuration">Webserver &#8211; R2 Final Configuration</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webserver-r3.txt" title="Webserver - R3 Final Configuration">Webserver &#8211; R3 Final Configuration</a><br />
<a href="http://ardenpackeer.com/wp-content/uploads/2007/12/webpagefiles.zip" title="Webserver - Sample Webpage files">Webserver &#8211; Sample Webpage files</a></p>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/">Tutorial: How to set up a Cisco router as a Web Server</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/ios-features-management/how-to-set-up-a-cisco-router-as-a-webserver/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Troubleshooting: How to Get Interface Summaries in IOS</title>
		<link>http://ardenpackeer.com/ios-features-management/troubleshooting-how-to-get-interface-summaries-in-ios/</link>
		<comments>http://ardenpackeer.com/ios-features-management/troubleshooting-how-to-get-interface-summaries-in-ios/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 07:29:48 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[CCIE Lab Study Tips]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[summaries]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/study-tips/troubleshooting-how-to-get-interface-summaries-in-ios/</guid>
		<description><![CDATA[To quickly get a summary of interfaces and addressing information from IOS you could use one of the following:
Router#sh run &#124; include interface&#124;ip address
interface Loopback0
 ip address 10.200.200.11 255.255.255.255
interface FastEthernet0/0
 ip address 10.1.1.1 255.255.255.0
interface BRI0/0
 no ip address
interface Serial1/0
 no ip address
interface Serial1/0.1 multipoint
 ip address 172.31.1.1 255.255.255.0
interface Serial1/0.2 multipoint
 ip address 172.31.11.1 255.255.255.0
interface Serial1/1
 [...]<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/troubleshooting-how-to-get-interface-summaries-in-ios/">Troubleshooting: How to Get Interface Summaries in IOS</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To quickly get a summary of interfaces and addressing information from IOS you could use one of the following:</p>
<pre><code>Router#sh run | include interface|ip address
interface Loopback0
 ip address 10.200.200.11 255.255.255.255
interface FastEthernet0/0
 ip address 10.1.1.1 255.255.255.0
interface BRI0/0
 no ip address
interface Serial1/0
 no ip address
interface Serial1/0.1 multipoint
 ip address 172.31.1.1 255.255.255.0
interface Serial1/0.2 multipoint
 ip address 172.31.11.1 255.255.255.0
interface Serial1/1
 ip address 10.1.0.1 255.255.255.0
interface Serial1/2
 no ip address
interface Serial1/3
 no ip address</code></pre>
<pre><code>Router#sh int | include is up|Internet
FastEthernet0/0 is up, line protocol is up
  Internet address is 10.1.1.1/24
Serial1/0 is up, line protocol is up
Serial1/0.1 is up, line protocol is up
  Internet address is 172.31.1.1/24
  Internet address is 172.31.11.1/24
Serial1/1 is up, line protocol is up
  Internet address is 10.1.0.1/24
Loopback0 is up, line protocol is up
  Internet address is 10.200.200.11/32</code></pre>
<pre><code>Router#sh ip int brief | exclude unassigned
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            10.1.1.1        YES NVRAM  up                    up
Serial1/0.1                172.31.1.1      YES NVRAM  up                    up
Serial1/0.2                172.31.11.1     YES NVRAM  administratively down down
Serial1/1                  10.1.0.1        YES NVRAM  up                    up
Loopback0                  10.200.200.11   YES NVRAM  up                    up </code></pre>
<p>When starting a lab with pre-configured routers and switches the above commands are very useful to get an overview of interfaces and addressing. I use this when doing labs with troubleshooting sections. If your Lab contains a troubleshooting section with preconfigured routers or switches, I would use the above the commands to verify that the configuration matches the topology of the lab. </p>
<p>Now back to labs!</p>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/troubleshooting-how-to-get-interface-summaries-in-ios/">Troubleshooting: How to Get Interface Summaries in IOS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/ios-features-management/troubleshooting-how-to-get-interface-summaries-in-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verifying Connectivity Using A tcl Script</title>
		<link>http://ardenpackeer.com/ios-features-management/verifying-connectivity-using-a-tcl-script/</link>
		<comments>http://ardenpackeer.com/ios-features-management/verifying-connectivity-using-a-tcl-script/#comments</comments>
		<pubDate>Sun, 01 Jul 2007 08:58:49 +0000</pubDate>
		<dc:creator>Arden Packeer, CCIE #20716</dc:creator>
				<category><![CDATA[IOS Features & Management]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[tcl]]></category>

		<guid isPermaLink="false">http://ardenpackeer.com/?p=24</guid>
		<description><![CDATA[During the CCIE lab (or in real life!) it is useful to test connectivity between all your routers. You might have just configured redistribution or completed all your IGP configuration and BGP configuration and want to make sure that you still have full connectivity. We could go to each router and systematically ping each address [...]<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/verifying-connectivity-using-a-tcl-script/">Verifying Connectivity Using A tcl Script</a></p>
]]></description>
			<content:encoded><![CDATA[<p>During the CCIE lab (or in real life!) it is useful to test connectivity between all your routers. You might have just configured redistribution or completed all your IGP configuration and BGP configuration and want to make sure that you still have full connectivity. We could go to each router and systematically ping each address that we are concerned with, but this would take up an quite a bit of your time (and for the CCIE lab you really need every minute you can get). Enter tcl. Tcl is a scripting language that modern Cisco routers can utilise.</p>
<p>Lets have a look at a tcl script that we can use to ping all the interfaces in a lab:</p>
<pre><code>foreach address {
1.1.1.1
2.2.2.2
3.3.3.3
4.4.4.4
5.5.5.5
6.6.6.6
} { puts [ exec "ping $address" ] }</code></pre>
<p>The code above is an example of a tcl script. On the router interface, go into privilege exec mode and enter the <a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hnm_r/nmg_04h.htm#wp1036199">tclsh</a> command. This places you in a tcl mode where we can enter tcl scripts. Then cut and paste the above from something like notepad.</p>
<pre><code>Router#
Router#tclsh
Router(tcl)#foreach address {
+&amp;gt;1.1.1.1
+&amp;gt;2.2.2.2
+&amp;gt;3.3.3.3
+&amp;gt;4.4.4.4
+&amp;gt;5.5.5.5
+&amp;gt;6.6.6.6
+&amp;gt;} { puts [ exec "ping $address" ] }

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/7/12 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/5/12 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/8 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/8 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/8 ms

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/16 ms
Router(tcl)#</code></pre>
<p>Then end result: we ping each address in turn listed in the script. Something like this simple script is perfect for testing connectivity in the lab (or in real life!).</p>
<p>For more examples of tcl scripts check this <a href="http://www.netcraftsmen.net/welcher/papers/iostcl01.html">link</a> out.</p>
<p>HTH.</p>
<p>Read this article and more like it on <a href="http://ardenpackeer.com">ardenpackeer.com</a>
<br>
Follow me on twitter: <a href="http://twitter.com/ardenpackeer">http://twitter.com/ardenpackeer</a><br/><br/><a href="http://ardenpackeer.com/ios-features-management/verifying-connectivity-using-a-tcl-script/">Verifying Connectivity Using A tcl Script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardenpackeer.com/ios-features-management/verifying-connectivity-using-a-tcl-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
