<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Linux * Screw</title>
	
	<link>http://www.linuxscrew.com</link>
	<description />
	<lastBuildDate>Fri, 04 Nov 2011 14:19:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=4538</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/linuxscrew" /><feedburner:info uri="linuxscrew" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>linuxscrew</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/linuxscrew" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Phone call as Nagios notification</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/I10fu4SR0hM/</link>
		<comments>http://www.linuxscrew.com/2011/09/13/nagios-notification-by-phone-call/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 06:51:27 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1407</guid>
		<description>Some time ago I found it pretty useful to configure Nagios monitoring system to send me a phone call in case of some critical problem. If some mission critical application goes down at night most probably you&amp;#8217;ll miss an e-mail or sms notifying about that but won&amp;#8217;t miss a telephone call to your cell phone. [...]</description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxscrew.com/wp-content/uploads/2008/04/smalllogo7nagios.jpg"><img src="http://www.linuxscrew.com/wp-content/uploads/2008/04/smalllogo7nagios.jpg" alt="" title="nagios logo" width="150" height="40" class="alignright size-full wp-image-497" /></a>Some time ago I found it pretty useful to configure Nagios monitoring system to send me a phone call in case of some critical problem. If some mission critical application goes down at night most probably you&#8217;ll miss an e-mail or sms notifying about that but won&#8217;t miss a telephone call to your cell phone. Honestly a telephone call is much more notorious rather than IM message notification or, again, e-mail/sms. You&#8217;re welcome to see below how to configure your Nagios for that.</p>
<p>First of all you need to have account at some SIP voip service provider like www.voiptalk.org or similar (Skype is not an option so far). Once registered you will get SIP username/password and SIP gateway&#8217;s IP address which will be used to make outgoing calls by Nagios.</p>
<p>1. Download and install pjsua console caller from pjsip.</p>
<pre>cd /usr/src/
wget http://www.pjsip.org/release/1.10/pjproject-1.10.tar.bz2
tar -xvjf pjproject-1.10.tar.bz2
cd /usr/src/pjproject-1.10
./configure --disable-sound
make
sudo cp pjsip-apps/bin/pjsua-i686-pc-linux-gnu /usr/bin/pjsua
</pre>
<p>2. Configure pjsua.</p>
<p>Create /etc/pjsuarc configuration file with the following contents (depends on details provided by SIP provider):</p>
<pre>
--null-audio
--registrar sip:<SIP gateway IP>:5060
--realm=*
--id sip:&#060;username&#062;@&#060;SIP gateway IP&#062;:5060
--username &#060;username&#062;
--password &#060;password&#062;
</pre>
<p>From that point you can try calling yourself by command:</p>
<pre>/usr/bin/pjsua --config-file=/etc/pjsuarc sip:&#060;your phone number&#062;@&#060;SIP gateway IP&#062;</pre>
<p>3. Configure Nagios to notify you by sending you a telephone call:</p>
<p>Add the following block to Nagios&#8217; commands.cfg:</p>
<pre>define command{
        command_name  notify-host-by-sip
        command_line  (sleep 30 &#038;&#038; echo q) | /usr/bin/pjsua --config-file=/etc/pjsuarc sip:$CONTACTEMAIL$
}</pre>
<p>Add below contact to Nagios&#8217; contact.cfg:</p>
<pre>
define contact{
        contact_name  user_sip
        alias  useralias
        service_notification_period  24x7
        host_notification_period  24x7
        service_notification_options  c
        host_notification_options  d
        service_notification_commands  notify-service-by-sip
        host_notification_commands  notify-host-by-sip
        email  &#060;your phone number&#062;@&#060;SIP gateway IP&#062;
}
</pre>
<p>That&#8217;s it, from this point Nagios will call you in case of critical problem and won&#8217;t bother you with warnings.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/gVJVwuRjKjYzQiqDXCrv4dsONUg/0/da"><img src="http://feedads.g.doubleclick.net/~a/gVJVwuRjKjYzQiqDXCrv4dsONUg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/gVJVwuRjKjYzQiqDXCrv4dsONUg/1/da"><img src="http://feedads.g.doubleclick.net/~a/gVJVwuRjKjYzQiqDXCrv4dsONUg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=I10fu4SR0hM:HPp0nE5OY0I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=I10fu4SR0hM:HPp0nE5OY0I:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=I10fu4SR0hM:HPp0nE5OY0I:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=I10fu4SR0hM:HPp0nE5OY0I:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=I10fu4SR0hM:HPp0nE5OY0I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=I10fu4SR0hM:HPp0nE5OY0I:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=I10fu4SR0hM:HPp0nE5OY0I:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/I10fu4SR0hM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/09/13/nagios-notification-by-phone-call/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2011/09/13/nagios-notification-by-phone-call/</feedburner:origLink></item>
		<item>
		<title>The Implementing Cisco IP Routing (CCNP Route 642-902). Materials for efficient preparation to the exam.</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/WRcHrUoxy7o/</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>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>

<p><a href="http://feedads.g.doubleclick.net/~a/8VhvBxNnj2miOBZeUtK1pMQkCk0/0/da"><img src="http://feedads.g.doubleclick.net/~a/8VhvBxNnj2miOBZeUtK1pMQkCk0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8VhvBxNnj2miOBZeUtK1pMQkCk0/1/da"><img src="http://feedads.g.doubleclick.net/~a/8VhvBxNnj2miOBZeUtK1pMQkCk0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=WRcHrUoxy7o:LGUzrnY3qmw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=WRcHrUoxy7o:LGUzrnY3qmw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=WRcHrUoxy7o:LGUzrnY3qmw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=WRcHrUoxy7o:LGUzrnY3qmw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=WRcHrUoxy7o:LGUzrnY3qmw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=WRcHrUoxy7o:LGUzrnY3qmw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=WRcHrUoxy7o:LGUzrnY3qmw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/WRcHrUoxy7o" height="1" width="1"/>]]></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>
		<feedburner:origLink>http://www.linuxscrew.com/2011/07/07/the-implementing-cisco-ip-routing-ccnp-route-642-902-materials-for-efficient-preparation-to-the-exam/</feedburner:origLink></item>
		<item>
		<title>Cisco Load Balancing with Failover setup example</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/ZBUy4XNtziI/</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>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&amp;#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>

<p><a href="http://feedads.g.doubleclick.net/~a/tIK-G6iX1u4sT83Nw8C21dGuI4M/0/da"><img src="http://feedads.g.doubleclick.net/~a/tIK-G6iX1u4sT83Nw8C21dGuI4M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tIK-G6iX1u4sT83Nw8C21dGuI4M/1/da"><img src="http://feedads.g.doubleclick.net/~a/tIK-G6iX1u4sT83Nw8C21dGuI4M/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=ZBUy4XNtziI:VysJQFgbb-U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=ZBUy4XNtziI:VysJQFgbb-U:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=ZBUy4XNtziI:VysJQFgbb-U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=ZBUy4XNtziI:VysJQFgbb-U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=ZBUy4XNtziI:VysJQFgbb-U:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=ZBUy4XNtziI:VysJQFgbb-U:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=ZBUy4XNtziI:VysJQFgbb-U:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/ZBUy4XNtziI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/27/cisco-load-balancing-failover-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2011/02/27/cisco-load-balancing-failover-example/</feedburner:origLink></item>
		<item>
		<title>Install nfdump and nfsen netflow tools in Linux</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/q01dJKXDnbQ/</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>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&amp;#8217;ve configured nfsen and nfdump to monitor traffic on certain Linux server or router you&amp;#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>

<p><a href="http://feedads.g.doubleclick.net/~a/tddTTSkq_7UeuKZa_caPTwkcY2I/0/da"><img src="http://feedads.g.doubleclick.net/~a/tddTTSkq_7UeuKZa_caPTwkcY2I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tddTTSkq_7UeuKZa_caPTwkcY2I/1/da"><img src="http://feedads.g.doubleclick.net/~a/tddTTSkq_7UeuKZa_caPTwkcY2I/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=q01dJKXDnbQ:1UgXIQI5sYw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=q01dJKXDnbQ:1UgXIQI5sYw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=q01dJKXDnbQ:1UgXIQI5sYw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=q01dJKXDnbQ:1UgXIQI5sYw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=q01dJKXDnbQ:1UgXIQI5sYw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=q01dJKXDnbQ:1UgXIQI5sYw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=q01dJKXDnbQ:1UgXIQI5sYw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/q01dJKXDnbQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/</feedburner:origLink></item>
		<item>
		<title>Quick Tip: Increase port range available for applications</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/l7eKVXTazPI/</link>
		<comments>http://www.linuxscrew.com/2011/02/15/quick-tip-port-range/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 20:05:00 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1172</guid>
		<description>By default an average Linux distribution allows applications to use the following TCP port range for outgoing connections: 32,786-65,536. That&amp;#8217;s why your system can handle up to 28,232 TCP sessions at time. Notice, this is more than enough if your Linux system is installed on the laptop or desktop and you just use it for [...]</description>
			<content:encoded><![CDATA[<p>By default an average Linux distribution allows applications to use the following TCP port range for outgoing connections: 32,786-65,536. That&#8217;s why your system can handle up to 28,232 TCP sessions at time. Notice, this is more than enough if your Linux system is installed on the laptop or desktop and you just use it for occasional visits to facebook.com, gmail.com and linuxscrew.com (yeah!). But if you run proxy/webcache like squid or some other services which open a lot of outgoing TCP connections you will likely hit ceiling of 28,232 soon.</p>
<p>First of all, let&#8217;s see current port range available for TCP sessions:</p>
<p><code>cat /proc/sys/net/ipv4/ip_local_port_range</code></p>
<p>Most likely the output will show something like this one &#8220;32786  65536&#8243;. In order to expand this range you can either echo modified range into above file in /proc filesystem (temporary solution) or add corresponding line into /etc/sysctl.conf (constant solution).</p>
<p>To temporarily expand port range from 28,232 to 40,000 do the following:</p>
<p><code>sudo -s<br />
echo "25000 65000" > /proc/sys/net/ipv4/ip_local_port_range</code></p>
<p>To make sure new port range will be applied after reboot add the following line to /etc/sysctl.conf:</p>
<p><code>net.ipv4.ip_local_port_range="25000 65000"</code></p>
<p>or just execute this:</p>
<p><code>sudo sysctl -n net.ipv4.ip_local_port_range="25000 65000"</code></p>

<p><a href="http://feedads.g.doubleclick.net/~a/nj-2nT0G0AtOCNlSrvVuOdLd1Fw/0/da"><img src="http://feedads.g.doubleclick.net/~a/nj-2nT0G0AtOCNlSrvVuOdLd1Fw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/nj-2nT0G0AtOCNlSrvVuOdLd1Fw/1/da"><img src="http://feedads.g.doubleclick.net/~a/nj-2nT0G0AtOCNlSrvVuOdLd1Fw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=l7eKVXTazPI:aR6oH0pVqVw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=l7eKVXTazPI:aR6oH0pVqVw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=l7eKVXTazPI:aR6oH0pVqVw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=l7eKVXTazPI:aR6oH0pVqVw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=l7eKVXTazPI:aR6oH0pVqVw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=l7eKVXTazPI:aR6oH0pVqVw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=l7eKVXTazPI:aR6oH0pVqVw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/l7eKVXTazPI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/15/quick-tip-port-range/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2011/02/15/quick-tip-port-range/</feedburner:origLink></item>
		<item>
		<title>Sendmail for virtual users with procmail, spamassassin and dovecot</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/KNu9adRNE30/</link>
		<comments>http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 07:40:05 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1163</guid>
		<description>Today I&amp;#8217;d like to describe setup of sendmail that allows to establish receiving of e-mails for certain domain and sort incoming messages between virtual users. Those users must be able to fetch received e-mails via POP3 or IMAP protocols with or without TLS encryption. The key aspect of this kind of setup is that we [...]</description>
			<content:encoded><![CDATA[<p>Today I&#8217;d like to describe setup of <a href="http://www.sendmail.org">sendmail</a> that allows to establish receiving of e-mails for certain domain and sort incoming messages between virtual users. Those users must be able to fetch received e-mails via POP3 or IMAP protocols with or without TLS encryption. The key aspect of this kind of setup is that we will make sendmail working with virtual users which aren&#8217;t present in <em>/etc/passwd</em> so once it&#8217;s necessary to create new mailbox it&#8217;s not required to add new Unix/Linux account into system. Also, unlike similar configurations based on postfix we will not run <a href="http://www.mysql.org">mysql</a> or <a href="http://www.postgresql.org/">postgres</a> databases to store list of users, their settings, mail routing etc. &#8212; everything is stored in text files.</p>
<p>Whole setup relies on the following components: <strong>sendmail</strong> &#8211; receives mails from MTAs around the Web and sorts incoming mails between users of mail system, <strong><a href="http://www.procmail.org">procmail</a></strong> makes it possible to apply various custom configurations for selected users e.g. set up autoresponder, filter e-mails etc., <strong><a href="http://spamassassin.apache.org">spamassassin</a></strong> is well known spam filter, <strong><a href="http://www.dovecot.org">dovecot</a></strong> &#8212; POP3 and IMAP service daemon.</p>
<p>1. Sendmail installation procedure depends on your Linux distribution but in most cases it is enough to install corresponding binary package e.g. <code>sudo yum install sendmail</code> or <code>sudo apt-get install sendmail</code>. But it is also natural idea to compile sendmail from sources to get the most fresh version &#8212; this is perfectly covered at <a href="http://www.sendmail.org/documentation/installGuide">sendmail.org</a>.</p>
<p>2. If you run one of major Linux distributions you should just execute something like below in command line to get all other required components installed:</p>
<p><code>sudo apt-get install procmail spamassassin dovecot</code><br />
or<br />
<code>sudo yum install procmail spamassassin dovecot</code></p>
<p>The possibility to install all the components from sources is still open [for geeks only].</p>
<p>3. Sendmail&#8217;s configuration is stored in <em>/etc/mail</em> directory and by default it is configured not to receive mails for any domain. We should change by adding &#8216;example.com&#8217; domain to <i>/etc/mail/local-host-names</i> file. Please notice that <a href="http://en.wikipedia.org/wiki/MX_record">MX DNS entry</a> for your domain e.g. &#8220;example.com&#8221; should point to server where you&#8217;re trying to set up sendmail.</p>
<p>4. There is another key configuration file <em>/etc/mail/virtusertable</em> that holds all mail routing information, e.g. below line tells sendmail that all incoming mails to test@example.com should go to user &#8216;user1.virtual&#8217;:</p>
<p><em>test@example.com        user1.virtual</em></p>
<p>The following line routes rest incoming mails to user2.virtual:</p>
<p><em>@example.com            user2.virtual</em></p>
<p>5. As it comes from their names <em>user1.virtual</em> and <em>use2.virtual</em> are virtual so they shouldn&#8217;t be present in <em>/etc/passwd</em>. In order to make sendmail to deliver mails to virtual users it is required to specify them in <em>/etc/alias</em> file. E.g. if we plan to route mails destined to <em>test@example.com</em> to <em>user1.virtual</em> we should add the following line to <em>/etc/alias</em>:</p>
<p><em>user1.virtual: |/etc/smrsh/user1.virtual</em></p>
<p>This line tells sendmail that it should execute script <em>/etc/smrsh/user1.virtual</em> to deliver mail to <em>user1.virtual</em>. Please notice that if you place the script to ther directory than <em>/etc/smrsh</em> setup wont&#8217; work. Now let&#8217;s see the contents of <em>/etc/smrsh/user1.virtual</em>, it contains one line including the path to procmail binary and procmailrc script for <em>user1.virtual</em> user:</p>
<p><code>[root@server ~]# cat /etc/smrsh/user1.virtual<br />
/usr/bin/procmail /etc/procmail.d/user1.virtual</code></p>
<p><em>/etc/procmail.d/user1.virtual</em> file includes all custom settings for <em>user1.virtual</em> virtual user, e.g. below is an example that will receive mails to <em>test@example.com</em>, check them for spam and store into user1.virtual&#8217;s inbox:</p>
<p><code>[root@server ~]# cat /etc/procmail.d/user1.virtual<br />
PATH=/bin:/usr/bin:/usr/contrib/bin:/usr/sbin:/usr/local/bin:/sbin<br />
MONTHYEAR=^Date +%y%m<br />
VHOME=/var/spool/virtual/example.com/mail/user1.virtual<br />
LOGFILE=/var/spool/virtual/example.com/logs/user1.virtual/log<br />
LOGABSTRACT=all<br />
VERBOSE=on</p>
<p># Spam filter<br />
:0fw<br />
| /usr/bin/spamc</p>
<p>:0:<br />
* ^X-Spam-Status: Yes<br />
$VHOME/spam</p>
<p>:0:<br />
$VHOME/inbox</code></p>
<p>As you can see spam mails will be stored in inbox while spam e-mails will be forwarded to file named &#8217;spam&#8217;. Later on you will be able to access inbox using POP3 and spam using IMAP service. In order to prepare user1.virtual&#8217;s inbox you should do the following:</p>
<p><code>mkdir -p /var/spool/virtual/example.com/mail/user1.virtual<br />
mkdir -p /var/spool/virtual/example.com/logs/user1.virtual<br />
chown mail.mail /var/spool/virtual/example.com/mail/user1.virtual -R<br />
chown mail.mail /var/spool/virtual/example.com/logs/user1.virtual -R</code></p>
<p>As for spamassassin, it is comes configured by default so in order to start it you should start spamd daemon e.g. by command <code>service spamd start</code> or <code>/etc/init.d/spamd start</code>. You can get more information about how to configure it at <a href="http://spamassassin.apache.org">SA&#8217;s website</a>.</p>
<p>From this point you may try sending mails to <em>test@example.com</em> and see log entries in <em>/var/spool/virtual/example.com/logs/user1.virtual/log</em> and incoming mails in <em>/var/spool/virtual/example.com/mail/user1.virtual/inbox</em>. If something goes wrong it makes sense to look into <em>/var/log/maillog</em> sendmail&#8217;s main log file.</p>
<p>5. Default configuration of dovecot is rather useful and makes it possible to establish POP3 and IMAP services for virtual users in seconds. Let&#8217;s imagine you&#8217;re running dovecot 2.x version, here are some configuration keys you should add into dovecot&#8217;s config, e.g. <em>/etc/dovecot/dovecot.conf</em>:</p>
<p><code>protocols = pop3 imap</p>
<p>service pop3-login {<br />
    inet_listener pop3 {<br />
	port = 110<br />
    }<br />
}</p>
<p>service imap-login {<br />
    inet_listener imap {<br />
	port = 143<br />
    }<br />
}</p>
<p>ssl = yes<br />
ssl_cert = &lt;/etc/dovecot/keys/server.crt        #server's self signed certificate generated by openssl<br />
ssl_key = &lt;/etc/dovecot/keys/server.key      # server's private key generated by openssl</p>
<p>default_login_user = mail<br />
default_internal_user = mail</p>
<p>first_valid_uid=8 #this is UID of mail user that you can see in /etc/passwd<br />
auth_mechanisms = plain login cram-md5 digest-md5</p>
<p>mail_location = mbox:/var/spool/virtual/example.com/mail/%u/</p>
<p>  userdb {<br />
    driver = passwd-file<br />
    args = username_format=%n /etc/dovecot/passwd<br />
  }<br />
  passdb {<br />
    driver = passwd-file<br />
    args = username_format=%n /etc/dovecot/passwd<br />
  }</p>
<p>log_path = /var/log/dovecot.log<br />
info_log_path = /var/log/dovecot-info.log<br />
debug_log_path = /var/log/dovecot-debug.log</code></p>
<p>Once you make sure your dovecot&#8217;s configuration includes mentioned lines you&#8217;re welcome to try starting dovecot either by <code>service dovecot start</code> or by just &#8216;dovecot&#8217;. In case of success you will see 110 and 143 ports in output <code>netstat -lnp</code> or errors in dovecot&#8217;s log file <em>/var/log/dovecot.log</em>. Let&#8217;s imagine it started without problems <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now it&#8217;s time to set up the password for <em>user1.virtual</em> user, according to dovecot&#8217;s configuration suggested above the passwords are stored in <em>/etc/dovecot/passwd</em>. This is a text file, here is example line from it:</p>
<p><code>user1.virtual:{PLAIN}pass123:8:12</code></p>
<p>In this example <em>user1.virtual</em> has password pass123 stored in plain text, 8 is UID of mail user in your <em>/etc/passwd</em>, 12 is GID of mail group (you can also check this in <em>/etc/passwd</em>).</p>
<p>Fin.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/et1gFscGlA6HyP_aLS8RUSxf88U/0/da"><img src="http://feedads.g.doubleclick.net/~a/et1gFscGlA6HyP_aLS8RUSxf88U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/et1gFscGlA6HyP_aLS8RUSxf88U/1/da"><img src="http://feedads.g.doubleclick.net/~a/et1gFscGlA6HyP_aLS8RUSxf88U/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=KNu9adRNE30:Jj6yPTfI8RE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=KNu9adRNE30:Jj6yPTfI8RE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=KNu9adRNE30:Jj6yPTfI8RE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=KNu9adRNE30:Jj6yPTfI8RE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=KNu9adRNE30:Jj6yPTfI8RE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=KNu9adRNE30:Jj6yPTfI8RE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=KNu9adRNE30:Jj6yPTfI8RE:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/KNu9adRNE30" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/</feedburner:origLink></item>
		<item>
		<title>Namebench: cross-platform DNS benchmarking tool</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/rR9qo2TcCNc/</link>
		<comments>http://www.linuxscrew.com/2011/01/15/namebench-cross-platform-dns-benchmarking-tool/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 20:47:56 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1157</guid>
		<description>It was long time ago when I wrote here last time but today I&amp;#8217;d like to share the link to an application that would be appreciated by everyone starting from Linux starter wishing to speed up his/her Internet connection and ending with system administrators who may want to run benchmarks and run stress tests against [...]</description>
			<content:encoded><![CDATA[<p>It was long time ago when I wrote here last time but today I&#8217;d like to share the link to an application that would be appreciated by everyone starting from Linux starter wishing to speed up his/her Internet connection and ending with system administrators who may want to run benchmarks and run stress tests against certain DNS service(s). I am talking about <a href="http://code.google.com/p/namebench/"><strong>Namebench</strong></a>. This is cross platform tool written in Python that makes it possible to easily select the fastest DNS available in your area as well as to run benchmark tests directed to DNS entries.</p>
<p>All what you need to have to start using namebench is Python and Tk library, e.g. if you use Ubuntu or Debian just run the following command to meet namebench library requirements:</p>
<p><code>sudo apt-get install python python-tk -y</code></p>
<p>When done go to <a href="http://code.google.com/p/namebench/">namebench&#8217;s official website</a> and download the latest tarball from there. For example 1.3.1 is the latest version for today so you can download it directly from <a href="http://code.google.com/p/namebench/downloads/detail?name=namebench-1.3.1-source.tgz">here</a>. Or you can just take below steps:</p>
<p><code>cd /usr/src<br />
sudo -s<br />
wget http://code.google.com/p/namebench/downloads/detail?name=namebench-1.3.1-source.tgz<br />
tar -xvzf namebench-1.3.1-source.tgz<br />
cd namebench-1.3.1<br />
./namebench.py<br />
</code></p>
<p>Here you go:</p>
<p><img src="http://www.linuxscrew.com/wp-content/uploads/2011/01/namebench_001.png" alt="namebench screenshot" title="namebench screenshot" width="716" height="396" class="aligncenter size-full wp-image-1158" /></p>
<p>The application has the only button so I believe it won&#8217;t bring any problems even to Linux newbies <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><a href="http://feedads.g.doubleclick.net/~a/AQl1yePgYDryWOjBjGA3Yf6hOTE/0/da"><img src="http://feedads.g.doubleclick.net/~a/AQl1yePgYDryWOjBjGA3Yf6hOTE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/AQl1yePgYDryWOjBjGA3Yf6hOTE/1/da"><img src="http://feedads.g.doubleclick.net/~a/AQl1yePgYDryWOjBjGA3Yf6hOTE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=rR9qo2TcCNc:kZIiLWROwqk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=rR9qo2TcCNc:kZIiLWROwqk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=rR9qo2TcCNc:kZIiLWROwqk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=rR9qo2TcCNc:kZIiLWROwqk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=rR9qo2TcCNc:kZIiLWROwqk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=rR9qo2TcCNc:kZIiLWROwqk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=rR9qo2TcCNc:kZIiLWROwqk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/rR9qo2TcCNc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/01/15/namebench-cross-platform-dns-benchmarking-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2011/01/15/namebench-cross-platform-dns-benchmarking-tool/</feedburner:origLink></item>
		<item>
		<title>How to assign range of IP addresses in Linux?</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/vRyHF5GJqJk/</link>
		<comments>http://www.linuxscrew.com/2010/11/26/how-to-assign-range-of-ip-addresses-to-one-network-interface/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 17:04:32 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[distros]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1136</guid>
		<description>As we know Linux allows to assign almost unlimited number of IP addresses to its interfaces. Such additional IPs applied to the same NIC are known as secondary IP addresses or just secondaries. Some time ago i faced a problem on how to apply about 500 IP addresses to one Linux box and then ensure [...]</description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxscrew.com/wp-content/uploads/2010/11/fig1_ip_address.png"><img src="http://www.linuxscrew.com/wp-content/uploads/2010/11/fig1_ip_address.png" alt="ip address example" title="ip address example" width="300" height="90" class="alignright size-full wp-image-1150" /></a>As we know Linux allows to assign almost unlimited number of IP addresses to its interfaces. Such additional IPs applied to the same NIC are known as secondary IP addresses or just secondaries. Some time ago i faced a problem on how to apply about 500 IP addresses to one Linux box and then ensure that all of them get online after Linux reboots. There are several ways to accomplish this taks so i would like to share them all.</p>
<h4>Shell script with ifconfig commands</h4>
<p>This is one of the most inefficient ways to get many IP addresses applied to one network interface. Anyways it allows to create as many aliases for the interface as you like so you should create shell script and execute it every time Linux boots.</p>
<pre>touch /path/to/script.sh
chmod +x /path/to/script.sh
vi /path/to/script.sh
</pre>
<p>Now you should add there shell lines which will apply IP addresses, e.g. the following one applies 60 IP addresses to <em>eth0</em> interface:</p>
<pre>for n in {3..63};  do ifconfig eth0:${n} 10.10.10.${n} netmask 255.255.255.0 up; done</pre>
<p>If you type &#8216;ifconfig&#8217; now you will very long output like this one:</p>
<pre>
eth0:3  Link encap:Ethernet  HWaddr 00:50:8D:D1:24:DB
          inet addr:10.10.10.3  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000 

eth0:4  Link encap:Ethernet  HWaddr 00:50:8D:D1:24:DB
          inet addr:10.10.10.4  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000

...

eth0:63  Link encap:Ethernet  HWaddr 00:50:8D:D1:24:DB
          inet addr:10.10.10.63  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000
</pre>
<p>If you decide to delete those IPs you can run the following line as a remedy:</p>
<pre>for n in {3..63};  do ifconfig eth0:${n} 0.0.0.0 &#038;> /dev/null; done</pre>
<p>Once you finished editing <em>/path/to/script.sh</em> script you should add it to startup, so put the line <em>/path/to/script.sh</em> into <em>/etc/rc.local</em> file that Linux executes every time it boots. Please notice that in various distributions this file may be missing so consult with distro&#8217;s docs to get where it is stored.</p>
<h4>Redhat/Centos/Fedora network scripts</h4>
<p>Users of these Linux distributions can apply ranges of IP addresses using <em>ifcfg-eth0-range0</em> files which are read during initialization of network interfaces during boot up process. The following example will make Linux to apply 200 IP addresses to <em>eth1</em> during booting:</p>
<pre>[root ~]#cat /etc/sysconfig/network-scripts/ifcfg-eth1-range0

IPADDR_START=192.168.1.1
IPADDR_END=192.168.1.200
CLONENUM_START=10</pre>
<p><em>CLONENUM_START</em> value specifies starting identifier of alias that will be applied to eth1 interface, in above example the first <em>192.168.1.1</em> will be assigned to <em>eth1:10</em> alias. The last IP of the range <em>192.168.1.200</em> will be applied to <em>eth:210</em> sub-interface. This is totally easy approach.</p>
<pre>Loopback interface</pre>
<p>Did you know that by one line presented below you assign 1022 virtual IP addresses to your Linux system? Here it is:</p>
<pre>ifconfig lo:0 10.0.0.1/22</pre>
<p>Now you can make sure of this by pinging IPs from that range (10.0.0.1 &#8211; 10.0.3.254).</p>
<pre>[root ~]#ping 10.0.0.1 -c 1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.063 ms

--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.063/0.063/0.063/0.000 ms

...

[root ~]#[root@whitehorse /]# ping 10.0.3.254 -c 1
PING 10.0.0.1 (10.0.3.254) 56(84) bytes of data.
64 bytes from 10.0.3.254: icmp_seq=1 ttl=64 time=0.063 ms

--- 10.0.3.254 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.063/0.063/0.063/0.000 ms</pre>
<p>If you still feel that the first suggested way meets your requirements better than the third one please read more about <a href="http://en.wikipedia.org/wiki/Loopback">loopback interface at wikipedia</a> &#8212; loopbacks are much more useful than aliases in most cases.</p>
<p>Hope it helps!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/wYFq4SdILSfLJl9oOLpFfbLsLpo/0/da"><img src="http://feedads.g.doubleclick.net/~a/wYFq4SdILSfLJl9oOLpFfbLsLpo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wYFq4SdILSfLJl9oOLpFfbLsLpo/1/da"><img src="http://feedads.g.doubleclick.net/~a/wYFq4SdILSfLJl9oOLpFfbLsLpo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=vRyHF5GJqJk:tgm9Dbyjqvc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=vRyHF5GJqJk:tgm9Dbyjqvc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=vRyHF5GJqJk:tgm9Dbyjqvc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=vRyHF5GJqJk:tgm9Dbyjqvc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=vRyHF5GJqJk:tgm9Dbyjqvc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=vRyHF5GJqJk:tgm9Dbyjqvc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=vRyHF5GJqJk:tgm9Dbyjqvc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/vRyHF5GJqJk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/11/26/how-to-assign-range-of-ip-addresses-to-one-network-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2010/11/26/how-to-assign-range-of-ip-addresses-to-one-network-interface/</feedburner:origLink></item>
		<item>
		<title>How to monitor traffic at Cisco router using Linux (Netflow)</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/riTks_My6tA/</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>By default Cisco IOS doesn&amp;#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>

<p><a href="http://feedads.g.doubleclick.net/~a/CblloptjBzFBrrJ80fYRdLRgAU8/0/da"><img src="http://feedads.g.doubleclick.net/~a/CblloptjBzFBrrJ80fYRdLRgAU8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CblloptjBzFBrrJ80fYRdLRgAU8/1/da"><img src="http://feedads.g.doubleclick.net/~a/CblloptjBzFBrrJ80fYRdLRgAU8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=riTks_My6tA:RzeFOpLX-e4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=riTks_My6tA:RzeFOpLX-e4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=riTks_My6tA:RzeFOpLX-e4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=riTks_My6tA:RzeFOpLX-e4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=riTks_My6tA:RzeFOpLX-e4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=riTks_My6tA:RzeFOpLX-e4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=riTks_My6tA:RzeFOpLX-e4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/riTks_My6tA" height="1" width="1"/>]]></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>
		<feedburner:origLink>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/</feedburner:origLink></item>
		<item>
		<title>The easiest way to split and merge pdf files in Ubuntu</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/RU6hUSz-6Vg/</link>
		<comments>http://www.linuxscrew.com/2010/06/18/the-easiest-way-to-split-and-merge-pdf-files-in-ubuntu/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 06:09:17 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1087</guid>
		<description>The easiest way to split, merge or edit pdf files in Ubuntu is to use pdftk utility. This rather old (latest version was released in 2006) but still simple and powerful program can be installed in Ubuntu (Debian or any deb-family Linux distribution) by the following command in terminal:
sudo aptitude install pdftk
(if you run Fedora, [...]</description>
			<content:encoded><![CDATA[<p>The easiest way to split, merge or edit pdf files in Ubuntu is to use <a href="http://www.accesspdf.com/pdftk/">pdftk utility</a>. This rather old (latest version was released in 2006) but still simple and powerful program can be installed in Ubuntu (Debian or any deb-family Linux distribution) by the following command in terminal:</p>
<p><code>sudo aptitude install pdftk</code><br />
(if you run Fedora, RedHat or CentOS use this one: <code>sudo yum install pdftk</code>)</p>
<p><strong>Split large pdf into many one-page files:</strong></p>
<p><code>pdftk largepdfile.pdf burst</code></p>
<p>(as the result you will get many small files like pg_0001.pdf, pg_0002.pdf and so on).</p>
<p><strong>Merge files into one PDF file:</strong></p>
<p><code>pdftk *.pdf cat output onelargepdfile.pdf</code></p>
<p>pdftk is extremely powerful and makes it possible to do almost anything with input pdf files. Thus above two commands are just examples showing how to split and merge pdf files in Ubuntu easily.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/s0juGdj88j-mEL6n0JhdGPLNn0k/0/da"><img src="http://feedads.g.doubleclick.net/~a/s0juGdj88j-mEL6n0JhdGPLNn0k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/s0juGdj88j-mEL6n0JhdGPLNn0k/1/da"><img src="http://feedads.g.doubleclick.net/~a/s0juGdj88j-mEL6n0JhdGPLNn0k/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=RU6hUSz-6Vg:bFDqv-1H34o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=RU6hUSz-6Vg:bFDqv-1H34o:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=RU6hUSz-6Vg:bFDqv-1H34o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=RU6hUSz-6Vg:bFDqv-1H34o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=RU6hUSz-6Vg:bFDqv-1H34o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=RU6hUSz-6Vg:bFDqv-1H34o:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=RU6hUSz-6Vg:bFDqv-1H34o:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/RU6hUSz-6Vg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/06/18/the-easiest-way-to-split-and-merge-pdf-files-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2010/06/18/the-easiest-way-to-split-and-merge-pdf-files-in-ubuntu/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.388 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-01-30 03:40:45 -->

