<?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>Linux * Screw &#187; cisco</title>
	<atom:link href="http://www.linuxscrew.com/category/cisco/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxscrew.com</link>
	<description></description>
	<lastBuildDate>Fri, 04 Nov 2011 14:19:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=8575</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Implementing Cisco IP Routing (CCNP Route 642-902). Materials for efficient preparation to the exam.</title>
		<link>http://www.linuxscrew.com/2011/07/07/the-implementing-cisco-ip-routing-ccnp-route-642-902-materials-for-efficient-preparation-to-the-exam/</link>
		<comments>http://www.linuxscrew.com/2011/07/07/the-implementing-cisco-ip-routing-ccnp-route-642-902-materials-for-efficient-preparation-to-the-exam/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 06:26:07 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[docs]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1375</guid>
		<description><![CDATA[A few days ago I have successfully passed 642-902 exam (CCNP ROUTE v6) and would like to share the list of materials I have been using to prepare to that exam. To get prepared I was using official Cisco Press training resourses, lab simulations and cheat sheets (before actually to go an take the exam). [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.linuxscrew.com/wp-content/uploads/2011/02/cisco-logo-1.gif" alt="cisco logo" title="cisco logo" width="200" height="200" class="alignright size-full wp-image-1220" />A few days ago I have successfully passed <a href="https://learningnetwork.cisco.com/community/certifications/ccnp/route?tab=overview">642-902</a> exam (CCNP ROUTE v6) and would like to share the list of materials I have been using to prepare to that exam. To get prepared I was using official Cisco Press training resourses, lab simulations and cheat sheets (before actually to go an take the exam). In this post I&#8217;d like to share this staff with you.</p>
<p>A few words about CCNP ROUTE 642-902 exam. This is the first one of three qualifying exams for CCNP, CCIP and CCDP. If you plan to become one of those certifications you must take 642-902 (the possibility to take the composite CCNP exam is also opened). Cisco ROUTE exam contains detailed information regarding implementing of EIGRP, BGP, OSPF dynamic routing protocols, redistribution between different protocols, filtering, summarization/aggregation and a lot of related stuff. You can read more at <a href="http://www.cisco.com/web/learning/le3/le2/le37/le10/learning_certification_type_home.html">Cisco Learning Center</a>.</p>
<p><b>Main Preparation Materials</b></p>
<ul>
<li><a href="http://www.amazon.com/gp/product/1587058820/ref=as_li_tf_tl?ie=UTF8&#038;tag=linscr-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399369&#038;creativeASIN=1587058820">Implementing Cisco IP Routing (ROUTE) Foundation Learning Guide</a> [ref]</li>
<li><a href="http://www.amazon.com/gp/product/1587202530/ref=as_li_tf_tl?ie=UTF8&#038;tag=linscr-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399369&#038;creativeASIN=1587202530">CCNP ROUTE 642-902 Official Certification Guide</a> [ref]</li>
<li><a href="http://proquest.safaribooksonline.com/book/certification/ccnp/9781587140174">CCNP ROUTE 642-902 Quick Reference Guide</a></li>
<li><a href="http://www.amazon.com/gp/product/1587202492/ref=as_li_tf_tl?ie=UTF8&#038;tag=linscr-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399373&#038;creativeASIN=1587202492">CCNP ROUTE Portable Command Guide</a> [ref]</li>
</ul>
<p><b>Lab Simulations</b></p>
<p>I&#8217;ve been using the only available emulation software of this kind: <a href="http://www.dynagen.org">dynamips</a>. There are a lot of information available about it around the web. Meantime it is worth to say that <a href="http://www.cisco.com/web/learning/netacad/course_catalog/PacketTracer.html">Packet Tracer</a>&#8217;s functionality is far not enough to complete labs coming with CCNP ROUTE so using of dynamips is mandatory. It is clear that every lab include more than three routers in it so you should be able to interconnect devices between each other using different kinds of connection e.g. Serial or FastEthernet. I used <a href="http://www.gns3.net">GNS3</a> for this purpose and it did its job perfectly.</p>
<p><b>Cisco CCNP ROUTE Cheet Sheets</b></p>
<p>Before actually to take an exam it makes sense to sum everything up in your mind so you should us cheat sheets for this purpose. I&#8217;ve been using <a href="http://www.linuxscrew.com/2008/10/10/15-must-have-cisco-cheat-sheets/">Cisco cheat sheets</a> which were prepared by Jeremy from <a href="http://www.packetlife.com">www.packetlife.com</a>, here are the direct links to them:</p>
<ul>
<li><a href="http://packetlife.net/posters/IOS_Interior_Routing_Protocols.pdf">Interior Routing Protocols</a></li>
<li><a href="http://media.packetlife.net/media/library/1/BGP.pdf">BGP</a></li>
<li><a href="http://media.packetlife.net/media/library/2/EIGRP.pdf">EIGRP</a></li>
<li><a href="http://media.packetlife.net/media/library/8/IPv6.pdf">IPv6</a></li>
<li><a href="http://media.packetlife.net/media/library/10/OSPF.pdf">OSPF</a></li>
<li><a href="http://media.packetlife.net/media/library/35/RIP.pdf">RIP</a></li>
<li><a href="http://media.packetlife.net/media/library/14/IOS_IPv4_Access_Lists.pdf">IPv4 ACLs</a></li>
<li><a href="http://media.packetlife.net/media/library/32/NAT.pdf">NAT</a></li>
</ul>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/07/07/the-implementing-cisco-ip-routing-ccnp-route-642-902-materials-for-efficient-preparation-to-the-exam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco Load Balancing with Failover setup example</title>
		<link>http://www.linuxscrew.com/2011/02/27/cisco-load-balancing-failover-example/</link>
		<comments>http://www.linuxscrew.com/2011/02/27/cisco-load-balancing-failover-example/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 15:07:50 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1202</guid>
		<description><![CDATA[There is Cisco router of 7200 series with 4 FastEthernet interfaces (FE) and 2 serial ports. It should act as load balancer and failover for LAN connected to it via one FE 1/0 interface while two identical Internet connections are going to FE 0/0 and FE 0/1 (let&#8217;s name these  connections as ISP_1 and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxscrew.com/wp-content/uploads/2011/02/cisco-logo-1.gif"><img src="http://www.linuxscrew.com/wp-content/uploads/2011/02/cisco-logo-1.gif" alt="cisco logo" title="cisco logo" width="200" height="200" class="alignright size-full wp-image-1220" /></a>There is <strong>Cisco</strong> router of 7200 series with 4 FastEthernet interfaces (FE) and 2 serial ports. It should act as <strong>load balancer</strong> and <strong>failover</strong> for LAN connected to it via one FE 1/0 interface while two identical Internet connections are going to FE 0/0 and FE 0/1 (let&#8217;s name these  connections as ISP_1 and ISP_2).</p>
<p>No dynamic routing protocols are used by ISPs but only static routing. The primary task is to ensure quick failover between two Internet connections so LAN users are automatically switched to ISP_2 if ISP_1 fails and vice versa. When both ISP_1 and ISP_2 are online the traffic of LAN users should be shared between two links to double available bandwidth on uplink (Tx) and downlink (Rx), in other words the router should be configured for load balancing between the links. You can see a network diagram below:</p>
<p><center><img src="http://www.linuxscrew.com/wp-content/uploads/2011/02/load-balancer-failover-network-diagram.png" alt="" title="cisco load balancing with failover diagram" class="aligncenter size-full wp-image-1204" /></center></p>
<p><strong>Load balancing setup description</strong></p>
<p>There are two basic options available: <a href="http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094820.shtml#perper">per-destination</a> or <a href="http://www.cisco.com/en/US/docs/ios/12_0s/feature/guide/pplb.html"><strong>per-packet</strong></a> load balancing. Since ISP_1 and ISP_2 connections have almost the same link characteristics including delay, jitter and bandwidth, it is reasonable idea to pick per-packet option. In comparison to per-destination load balancing approach per-packet uses more router&#8217;s hardware resources but makes it possible to share traffic between connections more evenly. For better forwarding performance the router will be configured for Cisco Express Forwarding or simply <strong>CEF</strong> per-packet load balancing.</p>
<p><strong>Failover description</strong></p>
<p>Every 30 seconds the router will ping two IP addresses through ISP_1 and two other IP addresses via ISP_2. If both IPs via ISP_1 becomes unreachable (we assume that ISP_1 connection fails in this case) the router will delete ISP_1&#8217;s route from its routing table so ISP_2 becomes the only Internet connection for LAN users. Meantime the router still continues pinging two ISP_1&#8217;s IP addresses and once they become reachable back ISP_1 is added to ISP_2 as an active Internet connection link. Such failover scenario works in absolutely the same way for ISP_2. Usually this is reasonable idea to ping IP addresses of each provider&#8217;s DNS servers when monitoring availability of each ISP.</p>
<p><strong>Miscellaneous details</strong></p>
<p>Notice that CEF per-packet load balancing requires IOS version of 12.0+ while failover setup described above needs 12.4+ IOS version so you have to make sure your Cisco router runs at least 12.4 version of operating system. E.g. <em>c7200-ik9o3s-mz.124-12c.bin</em> would be ok.</p>
<p><strong>Cisco router&#8217;s configuration with comments</strong></p>
<pre>
<strong>! This line enables Cisco Express Forwarding (CEF)</strong>
ip cef
!
ip sla monitor 1
 type echo protocol ipIcmpEcho 10.0.0.100 source-interface FastEthernet0/0
<strong> ! IP address 10.0.0.100 is primary DNS of ISP_1</strong>
 timeout 1000
 threshold 250
 frequency 30
ip sla monitor schedule 1 life forever start-time now
ip sla monitor 2
 type echo protocol ipIcmpEcho 10.0.0.101 source-interface FastEthernet0/0
<strong> ! IP address 10.0.0.101 is secondary DNS of ISP_1</strong>
 timeout 1000
 threshold 250
 frequency 30
ip sla monitor schedule 2 life forever start-time now
!
!
ip sla monitor 3
 type echo protocol ipIcmpEcho 20.0.0.100 source-interface FastEthernet0/1
<strong> ! IP address 20.0.0.100 is primary DNS of ISP_2</strong>
 timeout 1000
 threshold 250
 frequency 30
ip sla monitor schedule 3 life forever start-time now
ip sla monitor 4
 type echo protocol ipIcmpEcho 20.0.0.101 source-interface FastEthernet0/1
<strong> ! IP address 20.0.0.101 is primary DNS of ISP_2</strong>
 timeout 1000
 threshold 250
 frequency 30
ip sla monitor schedule 4 life forever start-time now
!
!
track 1 rtr 1 reachability
track 2 rtr 2 reachability
track 3 rtr 3 reachability
track 4 rtr 4 reachability
!
<strong>! Tracker for ISP_1</strong>
track 10 list boolean or
 object 1
 object 2
!
<strong>! Tracker for ISP_2</strong>
track 20 list boolean or
 object 3
 object 4
!
<strong>! Interface connected to ISP_1</strong>
interface FastEthernet0/0
 ip address 10.0.0.2 255.255.255.0
 ip load-sharing per-packet
 duplex auto
 speed auto
!
<strong>! Interface connected to ISP_2</strong>
interface FastEthernet0/1
 ip address 20.0.0.2 255.255.255.0
 ip load-sharing per-packet
 duplex auto
 speed auto
!
<strong>! Interface connected to LAN</strong>
interface FastEthernet1/0
 ip address 192.168.100.2 255.255.255.0
 ip load-sharing per-packet
 duplex auto
 speed auto
!
<strong>! Two equal cost static routes to ISP_1 and ISP_2</strong>
ip route 0.0.0.0 0.0.0.0 10.0.0.1 track 10
ip route 0.0.0.0 0.0.0.0 20.0.0.1 track 20
!
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/27/cisco-load-balancing-failover-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install nfdump and nfsen netflow tools in Linux</title>
		<link>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/</link>
		<comments>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 20:00:01 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1182</guid>
		<description><![CDATA[Using nfsen it is possible to view IP traffic statistics on Linux interfaces including the graphs showing data sent and received (see the screenshot to the right) as well as historical information about all data transfers. So after you&#8217;ve configured nfsen and nfdump to monitor traffic on certain Linux server or router you&#8217;ll be able [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.linuxscrew.com/wp-content/uploads/2011/02/Selection_033.png"><img src="http://www.linuxscrew.com/wp-content/uploads/2011/02/Selection_033-small.png" alt="" title="nfsen screenshot" width="300" height="162" class="alignright size-full wp-image-1190" /></a>Using <strong><a href="http://nfsen.sourceforge.net/">nfsen</a></strong> it is possible to view IP traffic statistics on <strong><a href="http://www.linuxscrew.com/category/linux/">Linux</a></strong> interfaces including the graphs showing data sent and received (see the screenshot to the right) as well as historical information about all data transfers. So after you&#8217;ve configured <strong>nfsen</strong> and <strong>nfdump</strong> to monitor traffic on certain <strong>Linux</strong> server or router you&#8217;ll be able to answer the following example questions: What IP was downloading data through 48161 last Wednesday? or How many bytes were sent to IP 8.8.8.8 via 53 port from Linux server? These are the only examples so <strong>nfdump</strong> and <strong>nfdump</strong> <a href="http://en.wikipedia.org/wiki/Netflow">netflow</a> tools gives you wide range of capabilities to monitor and analyze traffic on your <strong>Linux</strong> host.</p>
<p><strong>Netflow</strong> is the protocol developed by <a href="http://www.cisco.com">Cisco</a> to manage data about IP traffic. In a few words using Netflow you can collect data about all IP data send/received on multiple Cisco/Linux/BSD/Juniper hosts and send it to central Netflow collector that will show you the nice graphs and also will allow to have a complete picture of what data was sent/received on those hosts (including destination and source IP, port, bytes transfered, int/out interfaces etc). <strong>Nfdump</strong> is netflow collector. <strong>Nfsen</strong> is graphical tools for generating graphs and querying <strong>Nfdump</strong> for historical traffic reports. In this article you will see how to deploy all this staff in <strong>Linux</strong>.</p>
<p>Netflow probe is required to collect IP traffic data on <strong>Linux</strong> host. In general this piece of sofware will sit in background, store every network activity on certain network interface and then send collected data to Netflow collector nfdump. As Netflow probe I prefer <strong><a href="http://fprobe.sourceforge.net/">fprobe</a></strong> that is totally simple application that just does its job. If you feel that fprobe is not what you need or there are some problems with installing it you can try <a href="http://www.mindrot.org/projects/softflowd/">softflowd</a> that can do the same job.</p>
<p><em>Install fprobe from sources:</em></p>
<pre>cd /usr/src/
sudo -s
wget http://sourceforge.net/projects/fprobe/files/fprobe/1.1/fprobe-1.1.tar.bz2/download
tar -xvjf fprobe-1.1.tar.bz2
cd fprobe-1.1
./configure --prefix=/
make
make install
</pre>
<p><em>Point fprobe to one of network interfaces of <strong>Linux</strong> host and make it to send data to Netflow collector:</em></p>
<pre>fprobe -i eth0 11.22.33.44:23456</pre>
<p>In above example fprobe stores all data trasnfers on eth0 network interface and sends collected data to 11.22.33.44 host via 23456 UDP port (you may want to change firewall rules to make Netflow working over 23456 UDP port).</p>
<p><em>Install nfdump Netflow collector from sources:</em></p>
<pre>cd /usr/src/
sudo -s
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.2/nfdump-1.6.2.tar.gz/download
tar -xvzf nfdump-1.6.2.tar.gz
cd nfdump-1.6.2
./configure --prefix=/ --enable-nfprofile
make make
install</pre>
<p>When finished Netflow collector becomes ready so you can start capturing traffic from Netflow probe. If you don&#8217;t need any graphical tools like <strong>nfsen</strong> described below you can just start collector and save Netflow data in /var/neflow/ directory (THIS STEP IS OPTIONAL):</p>
<pre>/bin/nfcapd -w -D -p 23456 -B 200000 -S 1 -z -I Linux-Host-1-eth0 -l /var/netflow/</pre>
<p>In order to install <strong>nfsen</strong> from sources you have to get all its prerequisites, run one of below lines depending on what <strong>Linux</strong> distro you&#8217;re using (1st line is for <a href="http://www.linuxscrew.com/category/fedora/">Fedora</a>, <a href="http://www.linuxscrew.com/category/centos/">Centos</a>, Redhat while 2nd line is for <a href="http://www.linuxscrew.com/category/ubuntu/">Ubuntu</a>, <a href="http://www.linuxscrew.com/category/debian/">Debian</a>, Mint and similar):</p>
<pre>yum install rrdtool rrdtool-devel rrdutils perl-rrdtool -y</pre>
<p>or</p>
<pre>aptitude install rrdtool librrd2-dev librrd-dev librrd4 librrds-perl librrdp-perl</pre>
<p><em>Compile nfsen from sources:</em></p>
<pre>cd /usr/src/
sudo -s
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.5/nfsen-1.3.5.tar.gz/download
tar -xvzf nfsen-1.3.5.tar.gz
cd nfsen-1.3.5
cp etc/nfsen-dist.conf etc/nfsen.conf</pre>
<p>In order to continue the installation you should edit file <i>etc/nfsen.conf</i> to specify where to install <strong>nfsen</strong>, web server’s username (yes, you have to install apache, lighttpd, nginx or any other web server first), its document root directory etc. The major section of that config file is ‘Netflow sources’ that must list all hosts you&#8217;ve started Netflow probes at. Here is an example section for monitoring above <strong>Linux</strong> host:</p>
<pre>%sources = (
    'Linux-Host-eth0'    => { 'port' => '23456', 'col' => '#ff0000', 'type' => 'netflow' },
);</pre>
<p>When finished it&#8217;s time to actually install <strong>nfsen</strong> using installation script:</p>
<pre>./install.pl etc/nfsen.conf</pre>
<p>In case of successful installation you will be notified with corresponding congratulations message so it would be proper time to start <strong>nfsen</strong> daemon:</p>
<pre>/path/to/nfsen/bin/nfsen start</pre>
<p>Now you can open http://localhost/nfsen/nfsen.php at Linux host where <strong>nfsen</strong> was installed to start using this Netflow tool and see some graphs. Notice that it takes about 5-10 minutes to see first bars at the graphs, if the graphs are still empty you will have to check at least the following:</p>
<p>1. If fprobe is able to communicate to Netwflow collector and can send Netflow data to it (use <em>&#8216;ps ax | grep fprobe&#8217;</em> and Linux host being monitored and tcpdump tool at Netflow collector).<br />
2. If Netflow collector is started and can receive data from Netflow probe. Use <em>&#8216;ps ax | grep nfcapd&#8217;</em> and tcpdump at Netflow collector Linux host.</p>
<p>If you can add anything &#8212; feel free to drop a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to monitor traffic at Cisco router using Linux (Netflow)</title>
		<link>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/</link>
		<comments>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 21:16:38 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[distros]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1109</guid>
		<description><![CDATA[By default Cisco IOS doesn&#8217;t provide any traffic monitoring tools like iftop or iptraff available in Linux. While there are lots of proprietary solutions for this purpose including Cisco Netflow Collection, you are free to choose nfdump and nfsen open source software to monitor traffic of one or many Cisco routers and get detailed monitoring [...]]]></description>
			<content:encoded><![CDATA[<p>By default <strong>Cisco IOS</strong> doesn&#8217;t provide any <strong>traffic monitoring</strong> tools like <a href="http://www.ex-parrot.com/pdw/iftop/">iftop</a> or <a href="http://iptraf.seul.org/shots/iptraf-iptm1.gif">iptraff</a> available in <strong>Linux</strong>. While there are lots of proprietary solutions for this purpose including <a href="http://www.cisco.com/en/US/products/sw/netmgtsw/ps1964/index.html">Cisco Netflow Collection</a>, you are free to choose <a href="http://nfdump.sourceforge.net/"><strong>nfdump</strong></a> and <strong><a href="http://nfdump.sourceforge.net/">nfsen</a></strong> open source software to monitor traffic of one or many Cisco routers and get detailed monitoring data through your Linux command line or as graphs at absolutely no cost.</p>
<p>Below is beginner&#8217;s guide that helps to quickly deploy netflow collector and visualizer under Linux and impress everybody by cute and descriptive graphs like these:</p>
<p><center><img src="http://www.linuxscrew.com/wp-content/uploads/2010/11/nfsen1.png" alt="nfsen screen" title="nfsen screen" width="500" height="307" class="aligncenter size-full wp-image-1115" /></center></p>
<p>It is highly recommended to look through Netflow basics to get brief understanding of how it works before configuring anything. For example, <a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6555/ps6601/prod_white_paper0900aecd80406232.html">here is Cisco&#8217;s document</a> that gives complete information about <a href="http://en.wikipedia.org/wiki/Netflow">Netflow</a>. In a few words to get started you should enable netflow exporting on Cisco router and point it to netflow collector running under Linux. Exported data will contain complete information about all packets the router has received/sent so nfdump and nfsen working under Linux will collect it and visualize to present you the graph like above example.</p>
<p><strong>Cisco Router Setup</strong></p>
<p>1. Enable flow export on ALL Cisco router&#8217;s interfaces that send and receive some traffic, here is an example:</p>
<pre>Router1# configure terminal
Router1(config)#interface FastEthernet 0/0
Router1(config-if)#ip route-cache flow input
Router1(config-if)#interface FastEthernet 0/1
Router1(config-if)#ip route-cache flow input
...</pre>
<p>2. Setup netflow export:</p>
<pre>Router1# configure terminal
Router1(config)#ip flow-export source FastEthernet0/0
Router1(config)#ip flow-export source FastEthernet0/1
Router1(config)#ip flow-export version 5
Router1(config)#ip flow-export destination 1.1.1.1 23456</pre>
<p>Where <em>1.1.1.1</em> is IP address of Linux host where you plan to collect and analyze netflow data. <em>23456</em> is port number of netflow collector running on Linux.</p>
<p><b>Linux Setup</b></p>
<p>1. Download and install nfdump.</p>
<pre>cd /usr/src/
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.2/nfdump-1.6.2.tar.gz/download
tar -xvzf nfdump-1.6.2.tar.gz
cd nfdump-1.6.2
./configure --prefix=/ --enable-nfprofile
make
make install
</pre>
<p>2. Download and install nfsen.</p>
<p>It requires web server with php module and <a href="http://www.mrtg.org/rrdtool/">RRD</a> so make sure you have the corresponding packages installed. I hope you&#8217;re running httpd with php already so below are rrd/perl related packages installation hints only.</p>
<p>Fedora/Centos/Redhat users should type this:</p>
<pre>yum install rrdtool rrdtool-devel rrdutils perl-rrdtool</pre>
<p>Ubuntu/Debian:</p>
<pre>aptitude install rrdtool librrd2-dev librrd-dev librrd4 librrds-perl librrdp-perl</pre>
<p>If you run some exotic Linux distribution just install everything that is related to rrd + perl.</p>
<p>At last, nfsen installation:</p>
<pre>cd /usr/src/
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.5/nfsen-1.3.5.tar.gz/download
tar -xvzf nfsen-1.3.5.tar.gz
cd nfsen-1.3.5
cp etc/nfsen-dist.conf etc/nfsen.conf
</pre>
<p>In order to continue you should edit file <em>etc/nfsen.conf</em> to specify where to install nfsen, web server&#8217;s username, its document root directory etc. That file is commented so there shouldn&#8217;t be serious problems with it.</p>
<p>One of the major sections of <em>nfsen.conf</em> is &#8216;Netflow sources&#8217;, it should contain exactly the same port number(s) you&#8217;ve configured Cisco with &#8212; recall &#8216;ip flow-export &#8230;&#8217; line where we&#8217;ve specified port 23456. E.g.</p>
<pre>%sources = (
    'Router1'    => { 'port' => '23456', 'col' => '#0000ff', 'type' => 'netflow' },
);</pre>
<p>Now it&#8217;s time to finish the installation:</p>
<pre>./install.pl etc/nfsen.conf</pre>
<p>In case of success you&#8217;ll see corresponding notification after which you will have to start nfsen daemon to get the ball rolling:</p>
<pre>/path/to/nfsen/bin/nfsen start</pre>
<p>From this point nfdump started collecting netflow data exported by Cisco router and nfsen is hardly working to visualize it &#8212; just open web browser and go to <em>http://linux_web_server/nfsen/nfsen.php</em> to make sure. If you see empty graphs just wait for a while to let nfsen to collect enough data to visualize it.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access to real Cisco routers and switches for free</title>
		<link>http://www.linuxscrew.com/2010/06/09/access-real-cisco-routers-and-switches-for-free/</link>
		<comments>http://www.linuxscrew.com/2010/06/09/access-real-cisco-routers-and-switches-for-free/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 06:54:15 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sites]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1054</guid>
		<description><![CDATA[Preparing for Cisco certification exam and need real equipment required to accomplish all those CCNA or CCNP labs? That&#8217;s not a problem any more. This is due to availability of Packet Tracer for Linux and Community Lab hosted by people behind packetlife.net. As for Packet Tracer it supports Linux natively now &#8212; Cisco offers it [...]]]></description>
			<content:encoded><![CDATA[<p>Preparing for Cisco certification exam and need real equipment required to accomplish all those CCNA or CCNP labs? That&#8217;s not a problem any more. This is due to availability of <a href="http://www.cisco.com/web/learning/netacad/course_catalog/PacketTracer.html">Packet Tracer</a> for Linux and <strong>Community Lab</strong> hosted by people behind <a href="http://www.packetlife.net">packetlife.net</a>. As for Packet Tracer it supports Linux natively now &#8212; Cisco offers it as deb package for Ubuntu or Debian and there is no need to use Wine to get <a href="http://www.linuxscrew.com/2007/10/16/running-cisco-packet-tracer-in-linux/">Packet Tracer working in Linux</a>. Try searching the web for &#8220;packet tracer deb&#8221; and I am sure you&#8217;ll find where to download desired file shortly (we do not share pirated content here).</p>
<p>Anyways sometimes Packet Tracer as like as <a href="http://dynagen.org/">dynamips</a>/<a href="http://www.gns3.net">gns3</a> are not a panacea when it&#8217;s necessary to emulate mid-sized network or test some specific ios features on <strong>real Cisco devices</strong>. There are several options: the first and the easiest one means to buy Cisco device. But we all know that Cisco&#8217;s pricing policy is far away from democratic in application to individual users so even used or refurbished Cisco router/switch will cost enough to think about another option. Second option is to schedule access to <a href="http://packetlife.net/lab/"><strong>Community Lab at packetlife.net</strong></a>. Nice to know the access to it is absolutely free so anyone can get logon to Cisco routers, switches or ASAs once user reached his/her timeslot. Here is the list of hardware you can have access to (there are multiple devices of the same model):</p>
<p><strong><a href="http://www.cisco.com/en/US/products/ps6120/index.html">Cisco ASA 5505</a><br />
<a href="http://www.cisco.com/en/US/products/ps5881/index.html">Cisco 2811</a> (2xWIC-2T)<br />
<a href="http://www.www.cisco.com/en/US/products/ps5875/" class="broken_link" >Cisco 1841</a> (1xWIC-2T)<br />
<a href="http://www.cisco.com/en/US/products/hw/switches/ps646/index.html"> Cisco Catalyst 3550-24</a></strong></p>
<p>Not bad for free lab as for me. The lab is broken into two blocks so user can reserve only one block or both blocks simultaneously. This is to make it possible to access the lab by multiple users simultaneously. Devices are connected to each other according to predefined topology &#8212; see separate diagrams for Ethernet and Serial connections below (they are split to prevent overhead on the graph I guess). All documentation as well as FAQs can be found here: <a href="http://packetlife.net/wiki/packet-life-community-lab/">here</a> and <a href="http://packetlife.net/wiki/community-lab-faq/">here</a>. Thanks to <a href="http://packetlife.net/users/stretch/">Jeremy Stretch</a>.</p>
<p style="text-align: center;"><a href="http://packetlife.net/media/wiki/attachments/6/3/lab_topology_ethernet.png"><img class="aligncenter" title="packetlife community lab ethernet topology" src="/files/lab_topology_ethernet.png" alt="packetlife community lab ethernet topology" /></a></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="http://packetlife.net/media/wiki/attachments/7/5/lab_topology_serial.png"><img class="aligncenter" title="packetlife community lab serial topology" src="/files/lab_topology_serial.png" alt="packetlife community lab serial topology" /></a></p>
<p>P.S. By the way if you can share any other similar labs allowing people on the web to access Cisco (or some other networking devices) &#8212; you are welcome to share this information here. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/06/09/access-real-cisco-routers-and-switches-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco GRE example setup</title>
		<link>http://www.linuxscrew.com/2010/02/18/cisco-gre-example-setup/</link>
		<comments>http://www.linuxscrew.com/2010/02/18/cisco-gre-example-setup/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 15:06:23 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[howtos]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=977</guid>
		<description><![CDATA[Hosts from LAN1 should be able to access hosts at LAN2 and vice-versa through GRE tunnel between R1 and R2. ISP doesn&#8217;t care what networks are behind R1 and R2 so the only way to establish connection between LAN1 and LAN2 is to use VPN, in this example we use GRE.

GRE setup example topology

R1&#8217;s startup-config [...]]]></description>
			<content:encoded><![CDATA[<p>Hosts from LAN1 should be able to access hosts at LAN2 and vice-versa through GRE tunnel between R1 and R2. ISP doesn&#8217;t care what networks are behind R1 and R2 so the only way to establish connection between LAN1 and LAN2 is to use VPN, in this example we use GRE.</p>
<p style="text-align: center;"><a href="http://www.linuxscrew.com/wp-content/uploads/2010/02/GRE-lab.jpg"><img class="size-full wp-image-978 aligncenter" title="GRE-lab" src="http://www.linuxscrew.com/wp-content/uploads/2010/02/GRE-lab.jpg" alt="" width="431" height="148" /></a><br />
GRE setup example topology</p>
<p><span id="more-977"></span></p>
<p style="text-align: left;"><strong>R1&#8217;s startup-config (part of it)</strong></p>
<p style="text-align: left;">!</p>
<pre>hostname R1
!
interface Tunnel0
description GRE tunell to R2
ip address 192.168.200.1 255.255.255.0
tunnel source 123.123.0.10
tunnel destination 123.123.1.10
!
interface FastEthernet 1/0
ip address 10.0.0.1 255.255.255.0
!
interface Serial1/0
ip address 123.123.0.10 255.255.255.0
serial restart-delay 0
!
ip classless
ip route 0.0.0.0 0.0.0.0 123.123.0.1
ip route 10.1.1.0 255.255.255.0 192.168.200.2
!</pre>
<p><strong>R2&#8217;s startup-config (part of it)</strong></p>
<p style="text-align: left;">!</p>
<pre>hostname R2
!
interface Tunnel0
description GRE tunnel to R2
ip address 192.168.200.2 255.255.255.0
tunnel source 123.123.1.10
tunnel destination 123.123.0.10
!
interface FastEthernet 1/0
ip address 10.1.1.1 255.255.255.0
!
interface Serial1/0
ip address 123.123.1.10 255.255.255.0
no fair-queue
serial restart-delay 0
!
ip classless
ip route 0.0.0.0 0.0.0.0 123.123.1.1
ip route 10.0.0.0 255.255.255.0 192.168.200.1
!</pre>
<p><strong>Results</strong></p>
<pre>R2#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/17/28 ms

R3#ping 10.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/20/44 ms</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/02/18/cisco-gre-example-setup/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>15+ &#8220;must have&#8221; Cisco Cheat Sheets</title>
		<link>http://www.linuxscrew.com/2008/10/10/15-must-have-cisco-cheat-sheets/</link>
		<comments>http://www.linuxscrew.com/2008/10/10/15-must-have-cisco-cheat-sheets/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 11:38:41 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[sites]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/2008/10/10/15-must-have-cisco-cheat-sheets/</guid>
		<description><![CDATA[<p><img src="http://www.linuxscrew.com/wp-content/uploads/2008/10/cheating.JPG" title="cheat sheet" alt="cheat sheet" align="right" />Below is the link list to essential Cisco related cheat sheets (collection of notes or quick reference guides whatever). By the way, we don&#8217;t recommend to cheat anything and/or do a cheating of any sort by means of using these materials <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>1. <a href="http://packetlife.net/media/library/21/Cisco_IOS_Versions.pdf">Cisco IOS Versions</a> <a href="http://en.wikipedia.org/wiki/Cisco_IOS">what&#8217;s this?</a>)<br />
2. <a href="http://packetlife.net/media/library/22/physical-terminations.pdf">Physical Terminations/Connectors</a> (<a href="http://en.wikipedia.org/wiki/Electrical_connector">what&#8217;s this?</a>)<br />
3. <a href="http://packetlife.net/media/library/20/VLANs.pdf">VLANs</a> (<a href="http://en.wikipedia.org/wiki/Vlan">what&#8217;s this?</a>)<br />
4. <a href="http://packetlife.net/media/library/19/QoS.pdf">Quality of Service</a> (<a href="http://en.wikipedia.org/wiki/Qos">what&#8217;s this?</a>)<br />
<img src="http://www.linuxscrew.com/wp-content/uploads/2008/10/mpls_t.jpg" title="mpls cheat sheet small" alt="mpls cheat sheet small" align="right" /> 5. <a href="http://packetlife.net/media/library/18/Frame_Mode_MPLS.pdf">MPLS</a> (<a href="http://en.wikipedia.org/wiki/Multiprotocol_Label_Switching">what&#8217;s this?</a>)<br />
6. <a href="http://packetlife.net/media/library/14/IOS_IPv4_Access_Lists.pdf">IP Access Lists</a> <a href="http://en.wikipedia.org/wiki/Access_control_list">what&#8217;s this?</a>)<br />
7. <a href="http://packetlife.net/media/library/11/Spanning_Tree.pdf">Spanning Tree</a> (<a href="http://en.wikipedia.org/wiki/Spanning_tree_protocol">what&#8217;s this?</a>)<br />
8. <a href="http://packetlife.net/media/library/10/OSPF.pdf">OSPF</a> (<a href="http://en.wikipedia.org/wiki/Ospf">what&#8217;s this?</a>)<br />
9. <a href="http://packetlife.net/media/library/2/EIGRP.pdf">EIGRP</a> (<a href="http://en.wikipedia.org/wiki/EIGRP">what&#8217;s this?</a>)<br />
10. <a href="http://packetlife.net/media/library/1/BGP.pdf">BGP</a> (<a href="http://en.wikipedia.org/wiki/Bgp">what&#8217;s this?</a>)</p>
<p>11. <a href="http://skullbox.net/ioscheat.php">General Cisco IOS cheat sheet</a> (router/switch commands etc.)<br />
12. <a href="http://www.thenetworkadministrator.com/ciscoroutertips.htm">Cisco  Commands for Beginners</a><br />
13. <a href="http://www.madrock.net/2008/07/cisco-command-cheat-sheet/">Descriptive list of Cisco Commands</a> (fresh)<br />
14. <a href="http://www.cisco.com/en/US/prod/collateral/vpndevc/ps5708/ps5710/ps1018/product_implementation_design_guide09186a00800fd670.html">Cisco IOS Firewall Cheat Sheet</a> (Official Design Guide)<br />
15. Cisco &#8211;  Ethernet Encapsulation (in pdf)<br />
16. <a href="http://www.unixhub.com/docs/cisco/ccna.html">Mini CCNA Cheat Sheet</a><br />
17. <a href="http://www.texbuddy.com/Debug.htm">CCNA  Cheat Sheet (commands debugging)</a><br />
18. <a href="http://www.goonda.org/archive/docs/pinout.html" class="broken_link" >C</a><a href="http://www.goonda.org/archive/docs/pinout.html" class="broken_link" >onnector Pinouts Cheat Sheets </a></p>
<p>Great thanks to Jeremy Stretch (author of <a href="http://packetlife.net" target="_blank">packetlife.net</a>) for the first 10 cheat sheets from above list (to get them all just download <a href="http://packetlife.net/static/cheatsheets/cheatsheets.zip">this package</a>).</p>
<p><!-- INFOLINKS_OFF -->
<p style="padding-top: 25px; padding-bottom: 25px;"><font size="-2"><strong>Information improvisation: </strong>You can get your <a href="http://www.actualtests.com/exam-000-152.htm">000-152</a> and <a href="http://www.certkiller.com/exam-70-293.htm">70-293 exam</a> within days using latest <a href="http://www.examsheets.com/exam/642-974.htm">642-974</a> and other resources of <a href="http://www.testkingsite.com/oracle/1z0-515.html">1z0-515 exam</a> certifications; you can get a wonderful <a href="http://www.testkingprep.com/JN0-343.html">JN0-343</a> booklet.<br />
</font></p>
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.linuxscrew.com/wp-content/uploads/2008/10/cheating.JPG" title="cheat sheet" alt="cheat sheet" align="right" />Below is the link list to essential Cisco related cheat sheets (collection of notes or quick reference guides whatever). By the way, we don&#8217;t recommend to cheat anything and/or do a cheating of any sort by means of using these materials <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>1. <a href="http://packetlife.net/media/library/21/Cisco_IOS_Versions.pdf">Cisco IOS Versions</a> <a href="http://en.wikipedia.org/wiki/Cisco_IOS">what&#8217;s this?</a>)<br />
2. <a href="http://packetlife.net/media/library/22/physical-terminations.pdf">Physical Terminations/Connectors</a> (<a href="http://en.wikipedia.org/wiki/Electrical_connector">what&#8217;s this?</a>)<br />
3. <a href="http://packetlife.net/media/library/20/VLANs.pdf">VLANs</a> (<a href="http://en.wikipedia.org/wiki/Vlan">what&#8217;s this?</a>)<br />
4. <a href="http://packetlife.net/media/library/19/QoS.pdf">Quality of Service</a> (<a href="http://en.wikipedia.org/wiki/Qos">what&#8217;s this?</a>)<br />
<img src="http://www.linuxscrew.com/wp-content/uploads/2008/10/mpls_t.jpg" title="mpls cheat sheet small" alt="mpls cheat sheet small" align="right" /> 5. <a href="http://packetlife.net/media/library/18/Frame_Mode_MPLS.pdf">MPLS</a> (<a href="http://en.wikipedia.org/wiki/Multiprotocol_Label_Switching">what&#8217;s this?</a>)<br />
6. <a href="http://packetlife.net/media/library/14/IOS_IPv4_Access_Lists.pdf">IP Access Lists</a> <a href="http://en.wikipedia.org/wiki/Access_control_list">what&#8217;s this?</a>)<br />
7. <a href="http://packetlife.net/media/library/11/Spanning_Tree.pdf">Spanning Tree</a> (<a href="http://en.wikipedia.org/wiki/Spanning_tree_protocol">what&#8217;s this?</a>)<br />
8. <a href="http://packetlife.net/media/library/10/OSPF.pdf">OSPF</a> (<a href="http://en.wikipedia.org/wiki/Ospf">what&#8217;s this?</a>)<br />
9. <a href="http://packetlife.net/media/library/2/EIGRP.pdf">EIGRP</a> (<a href="http://en.wikipedia.org/wiki/EIGRP">what&#8217;s this?</a>)<br />
10. <a href="http://packetlife.net/media/library/1/BGP.pdf">BGP</a> (<a href="http://en.wikipedia.org/wiki/Bgp">what&#8217;s this?</a>)</p>
<p>11. <a href="http://skullbox.net/ioscheat.php">General Cisco IOS cheat sheet</a> (router/switch commands etc.)<br />
12. <a href="http://www.thenetworkadministrator.com/ciscoroutertips.htm">Cisco  Commands for Beginners</a><br />
13. <a href="http://www.madrock.net/2008/07/cisco-command-cheat-sheet/">Descriptive list of Cisco Commands</a> (fresh)<br />
14. <a href="http://www.cisco.com/en/US/prod/collateral/vpndevc/ps5708/ps5710/ps1018/product_implementation_design_guide09186a00800fd670.html">Cisco IOS Firewall Cheat Sheet</a> (Official Design Guide)<br />
15. Cisco &#8211;  Ethernet Encapsulation (in pdf)<br />
16. <a href="http://www.unixhub.com/docs/cisco/ccna.html">Mini CCNA Cheat Sheet</a><br />
17. <a href="http://www.texbuddy.com/Debug.htm">CCNA  Cheat Sheet (commands debugging)</a><br />
18. <a href="http://www.goonda.org/archive/docs/pinout.html" class="broken_link" >C</a><a href="http://www.goonda.org/archive/docs/pinout.html" class="broken_link" >onnector Pinouts Cheat Sheets </a></p>
<p>Great thanks to Jeremy Stretch (author of <a href="http://packetlife.net" target="_blank">packetlife.net</a>) for the first 10 cheat sheets from above list (to get them all just download <a href="http://packetlife.net/static/cheatsheets/cheatsheets.zip">this package</a>).</p>
<p><!-- INFOLINKS_OFF -->
<p style="padding-top: 25px; padding-bottom: 25px;"><font size="-2"><strong>Information improvisation: </strong>You can get your <a href="http://www.actualtests.com/exam-000-152.htm">000-152</a> and <a href="http://www.certkiller.com/exam-70-293.htm">70-293 exam</a> within days using latest <a href="http://www.examsheets.com/exam/642-974.htm">642-974</a> and other resources of <a href="http://www.testkingsite.com/oracle/1z0-515.html">1z0-515 exam</a> certifications; you can get a wonderful <a href="http://www.testkingprep.com/JN0-343.html">JN0-343</a> booklet.<br />
</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2008/10/10/15-must-have-cisco-cheat-sheets/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Dump ipcad output into sqlite3</title>
		<link>http://www.linuxscrew.com/2007/09/21/dump-ipcad-output-into-sqlite3/</link>
		<comments>http://www.linuxscrew.com/2007/09/21/dump-ipcad-output-into-sqlite3/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 21:21:14 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/2007/09/21/dump-ipcad-output-into-sqlite3/</guid>
		<description><![CDATA[ipcad is IP accounting daemon with Cisco-like ip accounting export. It runs in background, listens traffic on the specified interfaces, and records the traffic for later retrieval and analysis.
Here is a piece of shell code that allows to export ipcad output into sqlite3 database format:

echo "create table traffic (src, dst, pkt, bt);" &#124; sqlite3 /tmp/throttle.db
rsh [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.linuxscrew.com/wp-content/uploads/2007/09/sqlite.gif" title="sqlite" alt="sqlite" align="right" /><a href="http://lionet.info/ipcad/" target="_blank"><strong>ipcad</strong></a> is <strong><a href="http://www.faqs.org/docs/linux_network/x-087-2-accounting.html" target="_blank">IP accounting</a> daemon</strong> with <strong>Cisco</strong>-like ip accounting export. It runs in background, listens traffic on the specified interfaces, and records the traffic for later retrieval and analysis.</p>
<p>Here is a piece of shell code that allows to export ipcad output into <strong>sqlite3</strong> database format:<br />
<code><br />
echo "create table traffic (src, dst, pkt, bt);" | sqlite3 /tmp/throttle.db<br />
rsh 127.0.0.1 show ip accounting | grep "^ " | grep -vi source | awk \<br />
'{print"insert into traffic values (\""$1"\",\""$2"\",\""$3"\",\""$4"\");"}' \<br />
| sqlite3 /tmp/throttle.db<br />
</code></p>
<p>To make this working ipcad should be configured not to capture ports and to enable rsh service. In my case ipcad has the following settings set in ipcad.conf:</p>
<p><code>capture-ports disable;<br />
interface eth0;<br />
rsh enable at 127.0.0.1;<br />
rsh 127.0.0.1 admin;<br />
rsh ttl = 3;<br />
rsh timeout = 30;<br />
pidfile = /var/run/ipcad.pid;<br />
memory_limit = 100m;<br />
</code></p>
<p>and output (<code>rsh 127.0.0.1 show ip accouting</code>) is like:</p>
<pre>
192.168.0.7      192.168.0.1                 113241           166387462
192.168.0.1      192.168.0.7                  72117             4282846
192.168.0.77     66.235.184.245                2448              821095
66.235.184.245   192.168.0.77                  3995              697371</pre>
<p>The main problem is that it sqlite3 is rather slow and it takes eleven (11!!!) seconds to export 1000 entries of ipcad&#8217;s output into database. This was got at PC with 1.4Ghz CPU and 512Mb RAM.</p>
<p>If anybody knows how to get it faster, PLEASE LET ME KNOW! Thanks.</p>
<p><strong>Information Improvisation</strong>: <a href="http://www.bctes.com" target="_blank">Traffic Engineering Server</a> is new Solution for Bandwidth Management and QoS. It&#8217;s especially suitable for Broadband <a href="http://en.wikipedia.org/wiki/ISP" target="_blank">ISPs</a> and <a href="http://en.wikipedia.org/wiki/Small_and_medium_enterprise" target="_blank">SMEs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2007/09/21/dump-ipcad-output-into-sqlite3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

