<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Pierky's Blog</title>
	<atom:link href="http://pierky.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pierky.wordpress.com</link>
	<description>mostly a system and network engineer's repository</description>
	<lastBuildDate>Tue, 24 Jan 2012 16:52:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='pierky.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Pierky's Blog</title>
		<link>http://pierky.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://pierky.wordpress.com/osd.xml" title="Pierky&#039;s Blog" />
	<atom:link rel='hub' href='http://pierky.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Zabbix: send SMS using gammu-smsd</title>
		<link>http://pierky.wordpress.com/2011/10/28/zabbix-send-sms-using-gammu-smsd/</link>
		<comments>http://pierky.wordpress.com/2011/10/28/zabbix-send-sms-using-gammu-smsd/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:00:40 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[NMS]]></category>
		<category><![CDATA[Zabbix]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=882</guid>
		<description><![CDATA[Recently I needed to setup a Zabbix distribution with SMS notifications. I had a Momo Design MD-@ USB Internet key to be used as GSM modem, with a BT Italia (Vodafone) SIM card. I used the 1.8.5 version of Zabbix, installed using the apt tool on a Ubuntu 11.10. The Zabbix built-in SMS notification system [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=882&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to setup a Zabbix distribution with SMS notifications. I had a <b>Momo Design MD-@</b> USB Internet key to be used as GSM modem, with a <b>BT Italia</b> (Vodafone) SIM card. I used the 1.8.5 version of Zabbix, installed using the <b>apt</b> tool on a <b>Ubuntu 11.10</b>.</p>
<p>The Zabbix built-in SMS notification system seemed to have a bug, which cause a triple notification to be sent on every trigger action (bug ID <a href="https://support.zabbix.com/browse/ZBX-3507" target="_blank">ZBX-3507</a>), so I preferred to use an external (custom) script and a third party tool: <b>gammu-smsd</b>.</p>
<p>This daemon connects to the GSM modem and listens for an outgoing queue; when you need to send a message, you just have to &#8220;inject&#8221; it into its queue, then it does the rest.</p>
<h1>Installation</h1>
<p>As soon as I plugged the USB key into the server, Ubuntu recognized it:</p>
<pre>Oct 27 13:57:08 MyMachineName kernel: [764858.260009] usb 4-1: new full speed USB device number 2 using uhci_hcd
Oct 27 13:57:08 MyMachineName kernel: [764858.481158] cdc_acm 4-1:1.0: ttyACM0: USB ACM device
Oct 27 13:57:08 MyMachineName kernel: [764858.484118] usbcore: registered new interface driver cdc_acm
Oct 27 13:57:08 MyMachineName kernel: [764858.484121] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters</pre>
<p>Then I installed <b>gammu-smsd</b> and edited its configuration file:</p>
<pre>apt-get install gammu-smsd</pre>
<pre>cat /etc/gammu-smsdrc

# Configuration file for Gammu SMS Daemon

# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
<b>port = /dev/ttyACM0</b>
connection = at
# Debugging
logformat = textall

# SMSD configuration, see gammu-smsdrc(5)
[smsd]
service = files
<b>logfile = /var/log/gammu-smsd</b>
# Increase for debugging information
debuglevel = 0
<b>ReceiveFrequency = 300</b>
# Paths where messages are stored
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/</pre>
<p>The <b>port</b> parameter is the device where the modem is mapped. This may change on other system.</p>
<p>I changed the <b>logfile</b> parameter also, because by default it is configured to log to syslog. You need to give the right permissions to it:</p>
<pre>chmod a+rw /var/log/gammu-smsd</pre>
<p>The <b>ReceiveFrequency</b> is used to tell <b>gammu-smsd</b> how often to check for incoming SMS; by default it is every 1 second, but in my case I didn&#8217;t need to receive SMS, so I raised it to 5 minutes.</p>
<p>An important parameter is <b>PIN</b> on the <b>[smsd]</b> section: in my case I removed the PIN check from my SIM card, so I didn&#8217;t use it in the configuration file.</p>
<p>In order to avoid &#8220;Cannot open file&#8221; errors, I also granted access to the device to everyone:</p>
<pre>chmod a+rw /dev/ttyACM0</pre>
<p>At this time I reloaded <b>gammu-smsd</b> and tested the configuration:</p>
<pre>/etc/init.d/gammu-smsd restart
echo "Test message" | gammu-smsd-inject TEXT 335123456</pre>
<p>(replace 335123456 with your mobile phone number!)</p>
<p>The <b>gammu-smsd-monitor</b> utility let you to check your modem status too.</p>
<p>In order to rotate <b>gammu-smsd</b> log file, I wrote a <b>logrotate.d</b> configuration file too:</p>
<pre>cat /etc/logrotate.d/gammu-smsd
/var/log/gammu-smsd {
    daily
    rotate 7
    compress
    missingok
    notifempty
}</pre>
<h1>Zabbix configuration</h1>
<p>As first I configured a new media type using the Zabbix administration front-end:</p>
<p><b>Administration / Media types</b> -&gt; <b>Create Media Type</b></p>
<pre>Description: SMS-via-gammu
Type: Script
Script name: sendsms</pre>
<p><b>sendsms</b> is the name of the external script I used for my custom notification system.</p>
<p>Then I configured the new media type for my Zabbix user:</p>
<p><b>Administration / Users</b> -&gt; select <b>Users</b> in the top right corner &#8211; edit your user <b>Media: Add</b></p>
<pre>Type: SMS-via-gammu
Send to: 335123456
When active, Use if severity: as you wish
Status: Enabled</pre>
<p>Of course, I had an <b>Action</b> configured too, but for more information I suggest you to read about it on the <a href="http://www.zabbix.com/documentation/1.8/manual/config/actions" target="_blank">official documentation page</a>.</p>
<p>In order to configure Zabbix to use external notification scripts, I verified that the <b>AlertScriptsPath</b> was present in the configuration file:</p>
<pre>cat /etc/zabbix/zabbix_server.conf | grep AlertScriptsPath
AlertScriptsPath=/etc/zabbix/alert.d/</pre>
<p><b>/etc/zabbix/alert.d</b> is the directory where notifications script have to be.</p>
<p>Then I added the <b>zabbix</b> user to the <b>gammu</b> group, in order to give it the right permissions to inject messages into the outgoing gammu queue&#8230;</p>
<pre>adduser zabbix gammu</pre>
<p>&#8230; then I restarted Zabbix:</p>
<pre>/etc/init.d/zabbix-server restart</pre>
<p>This is the script I used to inject Zabbix notifications into the gammu outgoing queue (/etc/zabbix/alert.d/sendsms):</p>
<pre>#!/bin/sh

# $1    recipient
# $2    subject
# $3    message

TMPFILE=`mktemp -t`

echo "$3" &gt;&gt; $TMPFILE

cat $TMPFILE | gammu-smsd-inject TEXT $1

rm $TMPFILE</pre>
<pre>chmod a+x /etc/zabbix/alert.d/sendsms</pre>
<p>At this time I tested it by creating a new trigger with fake values (temperature &lt; 100 °C, or everything else could let an action to be raised).</p>
<h1>References</h1>
<p>Zabbix.com: <a href="http://www.zabbix.com/documentation/1.8/manual/config" target="_blank">Configuration page on the official documentation site</a></p>
<p>gammu-smsd: <a href="http://wammu.eu/smsd/" target="_blank">Gammu SMSD</a></p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/systems-administration/'>Systems Administration</a> Tagged: <a href='http://pierky.wordpress.com/tag/howto/'>HowTo</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/nms/'>NMS</a>, <a href='http://pierky.wordpress.com/tag/zabbix/'>Zabbix</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/882/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=882&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2011/10/28/zabbix-send-sms-using-gammu-smsd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>
	</item>
		<item>
		<title>Remember the &#8220;vlan dot1q tag native&#8221; command: untagged ingress frames are dropped!</title>
		<link>http://pierky.wordpress.com/2011/09/22/remember-the-vlan-dot1q-tag-native-command-untagged-ingress-frames-are-dropped/</link>
		<comments>http://pierky.wordpress.com/2011/09/22/remember-the-vlan-dot1q-tag-native-command-untagged-ingress-frames-are-dropped/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 11:55:25 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[802 DOT1Q]]></category>
		<category><![CDATA[802.1q]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[VLAN]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=865</guid>
		<description><![CDATA[Today I got crazy with a pair of switches dropping traffic on a 802.1q trunk. Finally, I realized the real problem was a leak in my brain, which led me to forgot how things work! The scenario I worked on had two switches, a 3560 and a 2960, with a 802.1q (etherchannel) trunk between them; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=865&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I got crazy with a pair of switches dropping traffic on a 802.1q trunk. Finally, I realized the real problem was a leak in my brain, which led me to forgot how things work!</p>
<p>The scenario I worked on had two switches, a 3560 and a 2960, with a 802.1q (etherchannel) trunk between them; the 3560 was the gateway for the VLAN 100 while on the 2960 I only had some access ports and the management interface.</p>
<p><b>3560:</b></p>
<pre>! Port-channel toward 2960, 802.1q trunk carrying VLAN 100
interface Port-channel1
 description 3560-to-2960
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 100
 switchport trunk allowed vlan 100
 switchport mode trunk
 switchport nonegotiate
end
!
! Native VLAN tagging
vlan dot1q tag native
!
! VLAN 100 declaration
vlan 100
!
! Layer3 interface for VLAN 100
interface Vlan100
 description SVI100
 ip address 10.0.100.1 255.255.255.0
end</pre>
<p><b>2960:</b></p>
<pre>! Port-channel toward 3560, 802.1q trunk carrying VLAN 100
interface Port-channel1
 description 2960-to-3560
 switchport trunk native vlan 100
 switchport trunk allowed vlan 200
 switchport mode trunk
 switchport nonegotiate
end
!
! VLAN 100 declaration
vlan 100
!
! Default management interface is shutdown
interface Vlan1
 no ip address
 no ip route-cache
 shutdown
end
!
! Management interface
interface Vlan100
 ip address 10.0.100.2 255.255.255.0
 no ip route-cache
end</pre>
<p>A ping from the 3560 toward the 2960 (where I ran a <b>debug ip icmp</b>) showed that ICMP echo requests was coming to the switch, replies were crafted by 2960 but they never arrived to 3560.</p>
<p>When I focused on the native VLANs topic, I found they were aligned on both switches: I thought that frames leaving 2960 toward 3560 were untagged (because of the <b>switchport trunk native vlan 100</b> command) but on 3560 side they should be accepted thanks to the same command. Here I was wrong! I missed the <b>vlan dot1q tag native</b> full behaviour, which means that every untagged ingress frame is dropped, even if it matches the configured native VLAN.</p>
<p>In order to get this configuration to work properly, I had to ensure that every 2960 egress frame was tagged, but <a href="https://supportforums.cisco.com/message/550900#550900" target="_blank">it seems 2960s don&#8217;t support native VLAN tagging</a>: here I had not the <b>vlan dot1q tag native</b> global configuration capability, nor the <b>switchport trunk native vlan tag</b> interface command, so I removed the <b>switchport trunk native vlan 100</b> command and everything worked.</p>
<h1>References</h1>
<p>Cisco.com: <a href="http://tools.cisco.com/Support/CLILookup/cltSearchAction.do" target="_blank">Command Lookup Tool</a></p>
<p>Cisco Support Community: <a href="https://supportforums.cisco.com/message/550886" target="_blank">cat2960 native vlan tagged on trunk</a> discussion</p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a> Tagged: <a href='http://pierky.wordpress.com/tag/802-dot1q/'>802 DOT1Q</a>, <a href='http://pierky.wordpress.com/tag/8021q/'>802.1q</a>, <a href='http://pierky.wordpress.com/tag/cisco/'>Cisco</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/switching/'>Switching</a>, <a href='http://pierky.wordpress.com/tag/vlan/'>VLAN</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/865/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/865/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/865/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/865/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/865/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/865/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/865/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/865/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=865&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2011/09/22/remember-the-vlan-dot1q-tag-native-command-untagged-ingress-frames-are-dropped/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>
	</item>
		<item>
		<title>One single route-map for both IPv4 and IPv6 BGP prefixes</title>
		<link>http://pierky.wordpress.com/2011/02/04/one-single-route-map-for-both-ipv4-and-ipv6-bgp-prefixes/</link>
		<comments>http://pierky.wordpress.com/2011/02/04/one-single-route-map-for-both-ipv4-and-ipv6-bgp-prefixes/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 19:29:13 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[BGP]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[route-map]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=835</guid>
		<description><![CDATA[I just want to share here a note-to-myself about route-maps and IPv4/IPv6 BGP prefixes matching. R1 and R2 were BGP speakers, R1 was announcing both IPv4 and IPv6 prefixes to R2 and I wanted to set, let&#8217;s say, different weights on those prefixes: weight = 4 to the IPv4 prefix and weight = 6 to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=835&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just want to share here a note-to-myself about route-maps and IPv4/IPv6 BGP prefixes matching.</p>
<p>R1 and R2 were BGP speakers, R1 was announcing both IPv4 and IPv6 prefixes to R2 and I wanted to set, let&#8217;s say, different <strong>weight</strong>s on those prefixes: <strong>weight</strong> = 4 to the IPv4 prefix and <strong>weight</strong> = 6 to the IPv6 prefix. It&#8217;s stupid, of course, but it&#8217;s just to simplify the real task I had to face. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://pierky.files.wordpress.com/2011/01/ipv4-ipv6-route-map.png"><img class="aligncenter size-full wp-image-838" title="IPv4/IPv6 route-map" src="http://pierky.files.wordpress.com/2011/01/ipv4-ipv6-route-map.png?w=800" alt=""   /></a></p>
<p>My goal was to have a single route-map for both IPv6 and IPv4 routes manipulation: a single route-map applied to the two <b>neighbor</b> statements in <b>ipv4</b> and <b>ipv6</b> <b>address-family</b>:</p>
<p>So, on R2 I wrote the route-map and applied it to the <strong>neighbor</strong> statement:</p>
<p><strong>R2:</strong></p>
<pre>ip prefix-list IPv4 seq 5 permit 192.168.1.1/32
!
ipv6 prefix-list IPv6 seq 5 permit 2001:DB8:1::/64
!
route-map RouteMapIN permit 10
 match ip address prefix-list IPv4
 set weight 4
!
route-map RouteMapIN permit 20
 match ipv6 address prefix-list IPv6
 set weight 6
!
route-map RouteMapIN permit 100
!
router bgp 65535
 address-family ipv4
  neighbor 192.168.0.1 route-map RouteMapIN in
 exit-address-family
 !
 address-family ipv6
  neighbor 2001:DB8::1 route-map RouteMapIN in
 exit-address-family
!</pre>
<p>This is what I expected:</p>
<p><a href="http://pierky.files.wordpress.com/2011/02/ipv4-ipv6-route-map-2.png"><img src="http://pierky.files.wordpress.com/2011/02/ipv4-ipv6-route-map-2.png?w=800" alt="" title="IPv4 / IPv6 route-map"   class="aligncenter size-full wp-image-850" /></a></p>
<p>I thought it was fine to match only the IPv4 prefix on sequence number 10, and only the IPv6 prefix on sequence number 20, but that was incorrect:</p>
<pre>R2#<strong>clear bgp all 65535</strong>
R2#<strong>show bgp all</strong>
For address family: IPv4 Unicast
BGP table version is 6, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*&gt;i192.168.1.1/32   192.168.0.1              0    100      4 i

For address family: IPv6 Unicast
BGP table version is 6, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*&gt;i2001:DB8:1::/64  2001:DB8::1              0    100      4 i</pre>
<p>Both prefixes had <strong>weight</strong> = 4!</p>
<p>So I tried to exchange the route-map entries&#8217; position to confirm my doubt:</p>
<p><strong>R2:</strong></p>
<pre>no route-map RouteMapIN
!
route-map RouteMapIN permit 10
 match ipv6 address prefix-list IPv6
 set weight 6
!
route-map RouteMapIN permit 20
 match ip address prefix-list IPv4
 set weight 4
!
route-map RouteMapIN permit 100</pre>
<pre>R2#<strong>clear bgp all 65535</strong>
R2#<strong>show bgp all</strong>
For address family: IPv4 Unicast
BGP table version is 8, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*&gt;i192.168.1.1/32   192.168.0.1              0    100      6 i

For address family: IPv6 Unicast
BGP table version is 8, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*&gt;i2001:DB8:1::/64  2001:DB8::1              0    100      6 i</pre>
<p>As supposed, both prefixes had <strong>weight</strong> = 6!</p>
<p>Finally, I decided to use more restrictive statements, by matching the specific prefix I wanted to match and explicitly denying the other&#8230;</p>
<p><strong>R2:</strong></p>
<pre>! Here I deny every IPv4 prefix
ip prefix-list NoIPv4 seq 5 deny 0.0.0.0/0 le 32
!
! Here I deny every IPv6 prefix
ipv6 prefix-list NoIPv6 seq 5 deny ::/0 le 128
!
no route-map RouteMapIN
!
route-map RouteMapIN permit 10
 ! Match the IPv4 prefix...
 match ip address prefix-list IPv4
 ! ... but not IPv6 prefixes.
 match ipv6 address prefix-list NoIPv6
 set weight 4
!
route-map RouteMapIN permit 20
 ! Do not match IPv4 prefixes...
 match ip address prefix-list NoIPv4
 ! ... but match only the wanted IPv6 prefix.
 match ipv6 address prefix-list IPv6
 set weight 6
!
route-map RouteMapIN permit 100</pre>
<p>&#8230; and I got the right result:</p>
<pre>R2#<strong>clear bgp all 65535</strong>
R2#<strong>show bgp all</strong>
For address family: IPv4 Unicast
BGP table version is 10, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*&gt;i192.168.1.1/32   192.168.0.1              0    100      4 i

For address family: IPv6 Unicast
BGP table version is 10, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*&gt;i2001:DB8:1::/64  2001:DB8::1              0    100      6 i</pre>
<p>The IPv4 prefix had <strong>weight</strong> = 4, and the IPv6 one <strong>weight</strong> = 6!</p>
<p>What did I miss? Any suggestion is strongly appreciated!</p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a> Tagged: <a href='http://pierky.wordpress.com/tag/bgp/'>BGP</a>, <a href='http://pierky.wordpress.com/tag/cisco/'>Cisco</a>, <a href='http://pierky.wordpress.com/tag/ipv6/'>IPv6</a>, <a href='http://pierky.wordpress.com/tag/isp/'>ISP</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/route-map/'>route-map</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/835/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=835&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2011/02/04/one-single-route-map-for-both-ipv4-and-ipv6-bgp-prefixes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>

		<media:content url="http://pierky.files.wordpress.com/2011/01/ipv4-ipv6-route-map.png" medium="image">
			<media:title type="html">IPv4/IPv6 route-map</media:title>
		</media:content>

		<media:content url="http://pierky.files.wordpress.com/2011/02/ipv4-ipv6-route-map-2.png" medium="image">
			<media:title type="html">IPv4 / IPv6 route-map</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple GRE Tunnels with the same source address</title>
		<link>http://pierky.wordpress.com/2010/12/20/multiple-gre-tunnels-with-the-same-source-address/</link>
		<comments>http://pierky.wordpress.com/2010/12/20/multiple-gre-tunnels-with-the-same-source-address/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 18:21:32 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[GRE]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=817</guid>
		<description><![CDATA[Post off-line. Please see comments for more details. Filed under: Networking Tagged: Cisco, GRE, LinkedIn, VPN<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=817&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Post off-line. Please see comments for more details.</p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a> Tagged: <a href='http://pierky.wordpress.com/tag/cisco/'>Cisco</a>, <a href='http://pierky.wordpress.com/tag/gre/'>GRE</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/vpn/'>VPN</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/817/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/817/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/817/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/817/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/817/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/817/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/817/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/817/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=817&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/12/20/multiple-gre-tunnels-with-the-same-source-address/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>
	</item>
		<item>
		<title>Hosts Subnets Monitor (HSM): get notified when hosts&#8217; subnets change</title>
		<link>http://pierky.wordpress.com/2010/11/30/hosts-subnets-monitor-hsm-get-notified-when-hosts-subnets-change/</link>
		<comments>http://pierky.wordpress.com/2010/11/30/hosts-subnets-monitor-hsm-get-notified-when-hosts-subnets-change/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 19:03:58 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[BGP]]></category>
		<category><![CDATA[HSM]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RIPE]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Team Cymru]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=785</guid>
		<description><![CDATA[In the recent past I have been tasked to block traffic from a LAN segment toward some public websites by blackholing their subnets. While this approach may be not fully convincing, it is easy to implement and with few impacts on the infrastructure. The real problem is the management overhead it introduces, since websites may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=785&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the recent past I have been tasked to block traffic from a LAN segment toward some public websites by blackholing their subnets.</p>
<p>While this approach may be not fully convincing, it is easy to implement and with few impacts on the infrastructure. The real problem is the management overhead it introduces, since websites may change the IP subnet they are run on.</p>
<h1>How does it work?</h1>
<p>In order to ease this task I wrote a little script which, given a hosts list, resolves IP addresses and gets the most specific subnet they fall on. Public whois databases are used to acquire subnet information: <a href="http://www.ripe.net/" target="_blank"><b>RIPE</b></a> <a href="http://www.ripe.net/ris/" target="_blank"><b>RIS</b></a>, <a href="http://www.team-cymru.org/" target="_blank"><b>TeamCymru</b></a> <a href="http://www.team-cymru.org/Services/ip-to-asn.html" target="_blank"><b>IP to ASN Mapping</b></a>, RIRs databases. Some of them (RIPE RIS and TeamCymru IP-to-ASN) are based on BGP feeds collected around the world, others (RIRs databases) are based on LIRs allocations and assignments; the configuration section of the script allows to set which databases have to be used and how.</p>
<h1>Requirements</h1>
<p>The script is written in Linux Bash and uses some basic programs and an optional (but really recommended) Perl addition (implemented in the <b>hsm-utils.pl</b> file).</p>
<p>The programs used by the script are <b>dig</b> (to resolve hostnames in IP addresses), <b>whois</b> (the <a href="http://www.linux.it/~md/software/" target="_blank">improved Whois client</a> by <a href="http://www.linux.it/~md/" target="_blank">Marco D&#8217;Itri</a>, to get data from whois databases) and <b>sendmail</b>, alias of <b>exim4</b> (to send email notifications when subnets change).</p>
<p>The <b>hsm-utils.pl</b> script needs the <a href="http://search.cpan.org/perldoc?NetAddr::IP::Lite" target="_blank">NetAddr::IP::Lite</a> module, which can be installed using the CPAN installer:</p>
<pre>LINUX:~#<b>perl -MCPAN -e shell</b>
cpan&gt;<b>install NetAddr::IP::Lite</b></pre>
<h1>How to use it</h1>
<p>To be used it just needs the &#8220;hosts&#8221; file in the working directory (/var/local/hsm by default) containing a list of hosts to be monitored:</p>
<pre>LINUX:/var/local/hsm#<b>cat hosts</b>
www.facebook.com
www.blogspot.com
www.youtube.com
www.twitter.com</pre>
<p>In order to receive email notifications the <b>EMAIL_TO</b> parameter has to be set with a working email address.</p>
<h1>The script</h1>
<p>Following is an excerpt from the script, I suggest you to read it since it contains some (I think) useful notes and configuration options; in the bottom of this post you may find the link to download it.</p>
<p><pre class="brush: bash;">##################################################################################
# HOW DOES IT WORK?
# --------------------------------------------------------------------------------
#
# Everything is done in the DATA_DIR directory (default to /var/local/hsm); HSM
# reads a list of hosts to monitor from the 'hosts' file and, for each of them, it
# resolves the IP address and gets its subnet.
#
# In order to identify the subnet, it queries public databases using the whois
# client: it may be configured to use the following sources (see CONFIGURATION):
#
# - RIPE RIS database: http://www.ripe.net/ris/
# - TeamCymru IP to ASN Mapping: http://www.team-cymru.org/Services/ip-to-asn.html
# - general RIRs databases
#
# Subnets are stored in the 'subnets' file; at the end of the execution, if there
# are new subnets HSM notifies them in the output. It also notifies expired
# subnets, that is subnets appeared in the past which seem to be not binded to
# hosts anymore.
#
# Output is written to the 'output' file; you may let HSM to send the output by
# email too.
#
# The script may be scheduled to be run periodically through the crontab file.

##################################################################################
# REQUIREMENTS AND DEPENDENCIES
# --------------------------------------------------------------------------------
#
# dig           Used to resolve hostnames
#
# whois         I used the improved Whois client by Marco D'Itri:
#               http://www.linux.it/~md/software/
#
# sendmail      Used as alias of exim4; optional, only if EMAIL_TO is set
#
# awk, grep,    Some basic utilities
# tail, sed
#
# Highly Recommended:
#
# Perl with NetAddr::IP::Lite module, in order to execute the hsm-utils.pl script.
# Please see CHANGE LOG &amp; KNOWN ISSUES and USEHSMUTILS in the CONFIGURATION
# section for more details about it.
#
# Developed and tested under Debian GNU/Linux 4.0 (Etch).

##################################################################################
# CHANGE LOG &amp; KNOWN ISSUES
# --------------------------------------------------------------------------------
#
# Date          Ver.    Note
# 2010-11-15    0.1     First release
#
# If you configure HSM to not use the hsm-utils.pl script (see CONFIGURATION for
# more details) you have to consider the following issues:
#
# - subnets are stored as they appear on the whois output; that is
# &quot;192.168.0.0/24&quot; is different from &quot;192.168.0.0 - 192.168.0.255&quot;. This may lead
# to a wrong behaviour when the same IP address is queried against a whois
# database which returns information in a format different from the previous one.
#
# - when GENERAL whois is used, or when GETLONGESTMATCH = 1, there are no
# guarantees that the more specific subnet is choosen among those returned.

##################################################################################
# CONFIGURATION
# --------------------------------------------------------------------------------

# USEHSMUTILS
# ------------------------------------
# If USEHSMUTILS = 1 then HSM uses the hsm-utils.pl file.
# It is a Perl script which implements some functions
# performing subnets normalization and selection. It is
# needed to solve some issues reported in the CHANGE LOG
# &amp; KNOWN ISSUES section. If you can't run a Perl script
# or you prefer to avoid it you may set USEHSMUTILS to 0.

USEHSMUTILS=1
HSMUTILSPATH=`dirname $0`/hsm-utils.pl

# DATA_DIR
# ------------------------------------
# Where files are stored:
# - the file containing the input hosts list ('hosts')
# - one file for each IP address resolved by hostnames
# - the subnets file ('subnets'), where subnets information are stored
# - the output file ('output')
# - temporary files
# No trailing slash.

DATA_DIR=/var/local/hsm

# USECACHE and CACHE_TIME
# ------------------------------------
# If USECACHE = 1 then IP addresses resolved by hostnames
# are checked against whois databases only if they were
# checked before CACHE_TIME days ago.

USECACHE=1
CACHE_TIME=3

# DNS_QUERIES
# ------------------------------------
# HSM sends this number of DNS queries in order to resolve
# hostnames IP addresses. It may be useful to discover IP
# address of hostnames with round-robin records.

DNS_QUERIES=3

# SUBNET_EXPIRY
# ------------------------------------
# When a subnet is not seen for more than SUBNET_EXPIRY days
# it is removed from the subnets file and a notification
# is written in the output.

SUBNET_EXPIRY=15

# WHOIS_LIST and GETLONGESTMATCH
# ------------------------------------
# WHOIS_LIST contains a list of sources to be used to get
# subnets information from IP addresses.
# The following sources are allowed:
# TEAMCYMRU, RIPERIS, GENERAL.
# Sources are used in the order they appear in the list.
# If GETLONGESTMATCH = 0, as soon as HSM succeds to obtain
# the subnet it stops searching.
# If a source is not working properly it uses the next one.
# If GETLONGESTMATCH = 1 HSM grabs results from all the
# listed sources, then uses the most specific one.

WHOIS_LIST=&quot;RIPERIS TEAMCYMRU GENERAL&quot;
GETLONGESTMATCH=1

# EMAIL
# ------------------------------------
# Set EMAIL_TO with your email address if you want the output
# to be sent by email. The other parameters are optional.

EMAIL_TO=
EMAIL_FROM=
EMAIL_SUBJECT=</pre></p>
<h1>Download and installation</h1>
<p>Here you can <a href="http://www.mediafire.com/?y7z3fx2wnoucamg" target="_blank"><b>download the script</b></a> &#8211; <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">Licensed under the terms of the GNU General Public License</a>.</p>
<p>To run it:</p>
<pre>LINUX:/usr/local/bin#<b>tar -xf hsm.tar</b> # extract it
LINUX:/usr/local/bin#<b>nano hsm</b> # do your configuration
LINUX:/usr/local/bin#<b>nano /var/local/hsm/hosts</b> # edit hosts you want to monitor
LINUX:/usr/local/bin#<b>./hsm</b> # run it</pre>
<p>You may also schedule it using crontab:</p>
<pre>LINUX:/usr/local/bin#<b>cat /etc/crontab</b>
# /etc/crontab: system-wide crontab

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
53 22   * * *   root    /usr/local/bin/hsm
#</pre>
<p>Any feedback, comment or suggestion is appreciated! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a>, <a href='http://pierky.wordpress.com/category/systems-administration/'>Systems Administration</a> Tagged: <a href='http://pierky.wordpress.com/tag/bgp/'>BGP</a>, <a href='http://pierky.wordpress.com/tag/hsm/'>HSM</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/linux/'>Linux</a>, <a href='http://pierky.wordpress.com/tag/ripe/'>RIPE</a>, <a href='http://pierky.wordpress.com/tag/script/'>Script</a>, <a href='http://pierky.wordpress.com/tag/team-cymru/'>Team Cymru</a>, <a href='http://pierky.wordpress.com/tag/whois/'>whois</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/785/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/785/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/785/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=785&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/11/30/hosts-subnets-monitor-hsm-get-notified-when-hosts-subnets-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>
	</item>
		<item>
		<title>Quando la funzione non funziona&#8230;</title>
		<link>http://pierky.wordpress.com/2010/08/31/quando-la-funzione-non-funziona/</link>
		<comments>http://pierky.wordpress.com/2010/08/31/quando-la-funzione-non-funziona/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 13:41:44 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=753</guid>
		<description><![CDATA[Filed under: Uncategorized Tagged: Fun<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=753&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://pierky.files.wordpress.com/2010/08/paypal-fail.png"><img src="http://pierky.files.wordpress.com/2010/08/paypal-fail.png?w=800&#038;h=456" alt="" title="PayPal-Fail" width="800" height="456" class="aligncenter size-full wp-image-754" /></a></p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/uncategorized/'>Uncategorized</a> Tagged: <a href='http://pierky.wordpress.com/tag/fun/'>Fun</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/753/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=753&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/08/31/quando-la-funzione-non-funziona/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>

		<media:content url="http://pierky.files.wordpress.com/2010/08/paypal-fail.png" medium="image">
			<media:title type="html">PayPal-Fail</media:title>
		</media:content>
	</item>
		<item>
		<title>sudppipe: a simple UDP proxy / port forwarder</title>
		<link>http://pierky.wordpress.com/2010/07/26/sudppipe-a-simple-udp-proxy-port-forwarder/</link>
		<comments>http://pierky.wordpress.com/2010/07/26/sudppipe-a-simple-udp-proxy-port-forwarder/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:01:18 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[UDP]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=748</guid>
		<description><![CDATA[I spent long time on Google looking for a simple Windows utility which let me take UPD packets on a host and forward them to another, and back. How to call it? A proxy? A port forwarder? Not a tunnel&#8230; A datapipe? A NAT or NAPT software? Well, yes, I&#8217;m listing here all the keywords [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=748&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I spent long time on Google looking for a simple Windows utility which let me take UPD packets on a host and forward them to another, and back. How to call it? A proxy? A port forwarder? Not a tunnel&#8230; A datapipe? A NAT or NAPT software? Well, yes, I&#8217;m listing here all the keywords I used to search it!</p>
<p>Something like this:</p>
<pre>CLIENT -&gt; HOST_A (proxy) -&gt; HOST_B (real server)</pre>
<p>Finally I found <a href="http://aluigi.altervista.org/mytoolz.htm" target="_blank"><b>sudppipe</b></a>, by Luigi Auriemma, and I want to share it, with the hope this post could raise its visibility and lower others&#8217; search time.</p>
<p>Here is the author&#8217;s description:</p>
<blockquote><p>advanced UDP proxy/datapipe/packets forwarder and modifier with multiple functions.<br />
a datapipe is like a minimalistic proxy which acts as a bridge for connecting to a specific host, so the input connection can be any UDP client while the output is ever the same IP:port (clients-&gt;stcppipe-&gt;target).<br />
it supports multiple clients allowed, creation of tcpdump capture files (like a sniffer), packets forwarding (chat style, each packet is forwarded to all the other clients and server connected), packets injection (the tool opens a specific UDP port to which is possible to send the customized packets that will be sent to the server), support for multiple target hosts plus some interesting options for controlling the outgoing sockets, hexadecimal visualization and plugins support for the modification and visualization of the packets (supports also the mysendto and myrecvfrom functions of the plugins of Proxocket).<br />
in the package there are also some example plugins: Zdaemon huffman, Doom huffman, Half-life decoding and one for the replacement of the text strings.<br />
the plugins (which work on both Windows and Linux) are very basic to create and use, just take a look at example_sudp.c for more informations.</p></blockquote>
<p>Thanks Luigi! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a>, <a href='http://pierky.wordpress.com/category/systems-administration/'>Systems Administration</a> Tagged: <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/nat/'>NAT</a>, <a href='http://pierky.wordpress.com/tag/proxy/'>Proxy</a>, <a href='http://pierky.wordpress.com/tag/udp/'>UDP</a>, <a href='http://pierky.wordpress.com/tag/utilities/'>Utilities</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/748/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=748&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/07/26/sudppipe-a-simple-udp-proxy-port-forwarder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>
	</item>
		<item>
		<title>Book review: Zabbix 1.8 Network Monitoring</title>
		<link>http://pierky.wordpress.com/2010/05/06/book-review-zabbix-1-8-network-monitoring/</link>
		<comments>http://pierky.wordpress.com/2010/05/06/book-review-zabbix-1-8-network-monitoring/#comments</comments>
		<pubDate>Thu, 06 May 2010 16:47:54 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[NMS]]></category>
		<category><![CDATA[Zabbix]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=731</guid>
		<description><![CDATA[Zabbix is a good Network Monitoring System, recently grown up to version 1.8. The book I was pleased to review is an easy guide to go deep into its mechanisms and to discover its many features. The book covers every aspect of Zabbix, from the installation process to distributed monitoring, with a in-depth coverage of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=731&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://pierky.files.wordpress.com/2010/05/zabbix-1-8-network-monitoring.jpg"><img class="alignleft size-thumbnail wp-image-732" title="Zabbix 1.8 Network Monitoring - by Rihards Olups" src="http://pierky.files.wordpress.com/2010/05/zabbix-1-8-network-monitoring.jpg?w=121&#038;h=150" alt="" width="121" height="150" /></a><a href="http://www.zabbix.com/" target="_blank">Zabbix</a> is a good <strong>Network Monitoring System</strong>, recently grown up to version 1.8. The book I was pleased to review is an easy guide to go deep into its mechanisms and to discover its many features.</p>
<p>The book covers every aspect of Zabbix, from the <strong>installation process</strong> to <strong>distributed monitoring</strong>, with a in-depth coverage of hosts monitoring techniques and user notification system. Many <strong>practical examples</strong> and <strong>screenshots</strong> help the reader to configure the system and have a fully working setup in a few minutes.</p>
<p>A whole chapter is dedicated to the <strong>SNMP integration</strong>, with a good explaination of the protocol and very practical tips about the use of <strong>Net-SNMP</strong> suite and <strong>MIBs</strong>. The author also included a good tutorial about the setup of a <strong>traps handling procedure</strong> with hosts binding.</p>
<p>Two more noteworthy chapters are about the use of <strong>templates and macros</strong> to simplify the configuration of Zabbix, and advanced monitoring, such as using <strong>external scripts</strong> or data already gathered by other systems.</p>
<p>If you plan to use Zabbix and you are starting from scratch, or even if you already use it but you want to deepen some aspects, I really suggest you to have a look at this book! In the meantime, here you can find a sample chapter: <a href="https://www.packtpub.com/sites/default/files/7689_Zabbix_SampleChapter.pdf" target="_blank">Getting your first Notification</a> (PDF).</p>
<p>My two pennies worth <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h4>Details</h4>
<p><strong>Title</strong>: Zabbix 1.8 Network Monitoring<br />
<strong>Language</strong>: English<br />
<strong>Paperback</strong>: 428 pages [ 235mm x 191mm ]<br />
<strong>Release Date</strong>: March 2010<br />
<strong>ISBN</strong>: 184719768X<br />
<strong>ISBN 13</strong>: 978-1-847197-68-9<br />
<strong>Author(s)</strong>: Rihards Olups<br />
<strong>More info</strong>: <a href="https://www.packtpub.com/zabbix-1-8-network-monitoring/book" target="_blank">Packt Publishing web site</a></p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/systems-administration/'>Systems Administration</a> Tagged: <a href='http://pierky.wordpress.com/tag/books/'>Books</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/nms/'>NMS</a>, <a href='http://pierky.wordpress.com/tag/zabbix/'>Zabbix</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/731/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=731&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/05/06/book-review-zabbix-1-8-network-monitoring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>

		<media:content url="http://pierky.files.wordpress.com/2010/05/zabbix-1-8-network-monitoring.jpg?w=121" medium="image">
			<media:title type="html">Zabbix 1.8 Network Monitoring - by Rihards Olups</media:title>
		</media:content>
	</item>
		<item>
		<title>GNS-3 Lab: 4-byte Autonomous System Number &#8211; interactions between 32 and 16 bit speaking BGP routers</title>
		<link>http://pierky.wordpress.com/2010/05/02/gns-3-lab-4-byte-autonomous-system-number-interactions-between-32-and-16-bit-speaking-bgp-routers/</link>
		<comments>http://pierky.wordpress.com/2010/05/02/gns-3-lab-4-byte-autonomous-system-number-interactions-between-32-and-16-bit-speaking-bgp-routers/#comments</comments>
		<pubDate>Sun, 02 May 2010 08:35:57 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Networking Labs]]></category>
		<category><![CDATA[4-byte ASN]]></category>
		<category><![CDATA[BGP]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[GNS3]]></category>
		<category><![CDATA[GNS3 Lab]]></category>
		<category><![CDATA[GNS3 Topology]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Provider]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=713</guid>
		<description><![CDATA[Such as IPv4 addresses, 2-byte pool of Autonomous System (AS) Numbers is going to be exhausted soon. By the time I&#8217;m writing, it seems Internet will run out of 16-bit AS Number on 26-Sep-2012. To prevent this situation, IANA extended the AS Number field to 32 bits and, on 2007, RIRs started assigning them&#8230; or, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=713&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Such as IPv4 addresses, 2-byte pool of Autonomous System (AS) Numbers is going to be exhausted soon. By the time I&#8217;m writing, it seems <a href="http://www.potaroo.net/tools/asns/" target="_blank">Internet will run out of 16-bit AS Number</a> on <strong>26-Sep-2012</strong>. To prevent this situation, IANA extended the AS Number field to 32 bits and, on 2007, RIRs started assigning them&#8230; or, at least, to offer them!<br />
Of course, in order to let 4-byte ASN to work properly, a little adjustement was needed in the BGP protocol. Enter <a href="http://www.ietf.org/rfc/rfc4893.txt" target="_blank">RFC 4893</a>, <strong>BGP Support for Four-octet AS Number Space</strong>.</p>
<p><a href="http://pierky.files.wordpress.com/2010/05/4-byte-asn1.png"><img class="alignright size-full wp-image-719" title="4-byte ASN" src="http://pierky.files.wordpress.com/2010/05/4-byte-asn1.png?w=800" alt="4-byte ASN - Lab topology"   /></a>In this post I don&#8217;t want to cover the mechanisms of this protocol extension, if you want to understand them I please you to follow some links in the <strong>References</strong> section; I prefer to show some interactions between <em>OLD</em> 2-byte ASN and <em>NEW</em> 4-byte ASN BGP speakers. I built a little GNS3/Dynamips lab using a couple of 7200s with IOS 12.2(33)SRE as NEW speakers, and a couple of 3640s as OLD peers.</p>
<p>In the topology every router announces any subnet to the others; BGP peering sessions follow the physical topology. Green ASs support 4-byte AS, while gray do not.<br />
For the sake of readibility I&#8217;ll use <strong>asdot notation</strong> in this post, with the exception of some configuration blocks where I&#8217;ll use <strong>asplain</strong> just to show both notation usage.</p>
<p>I also uploaded two packet captures on <a href="http://packetlife.net/captures/protocol/bgp/" target="_blank">PacketLife.net</a>: they show BGP UPDATES with and without the <strong>NEW_AS_PATH</strong> attributes. They are <b>4-byte_AS_numbers_Full_Support.cap</b> and <b>4-byte_AS_numbers_Mixed_Scenario.cap</b>.</p>
<h1>Partial 4-byte ASN support: A-B routers</h1>
<p>Router <strong>A</strong> is on AS 10.1 / 655361 (asdot / asplain notation):</p>
<pre>A#<strong>sh run | sec bgp</strong>
router bgp 655361
 no synchronization
 bgp log-neighbor-changes
 network 10.0.0.0
 neighbor 172.16.3.2 remote-as 2
 no auto-summary
B#<strong>sh run | sec bgp</strong>
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 network 20.0.0.0
 neighbor 172.16.3.1 remote-as 23456
 no auto-summary</pre>
<p>As you can see, on router <strong>B</strong> <strong>neighbor</strong> statement we can&#8217;t use the real ASN to peer with <b>A</b>, so we have to use the <strong>AS_TRANS</strong> (23456). Let&#8217;s wait until our sessions come up, then show BGP neighbors and tables:</p>
<pre>A#<strong>sh ip bgp neighbors 172.16.3.2</strong>
BGP neighbor is 172.16.3.2,  remote AS 2, external link
  BGP version 4, remote router ID 20.0.0.1
  BGP state = Established, up for 00:00:27
  Last read 00:00:27, last write 00:00:27, hold time is 180, keepalive interval is 60 seconds
  Neighbor sessions:
    1 active, is not multisession capable
  Neighbor capabilities:
    Route refresh: advertised and received(new)
    <strong>Four-octets ASN Capability: advertised</strong>
    Address family IPv4 Unicast: advertised and received
    Multisession Capability: advertised
...</pre>
<p>Please note the <strong>Four-octets ASN Capability: advertised</strong> line: <strong>A</strong> advertised this capability but did not receive it back from <strong>B</strong>.</p>
<pre>A#<strong>sh ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 10.0.0.0         0.0.0.0                  0         32768 i
*&gt; 20.0.0.0         172.16.3.2               0             0 2 i</pre>
<p>As expected, <strong>A</strong> receives the <strong>B</strong>&#8216;s route but&#8230;</p>
<pre>B#<strong>sh ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 10.0.0.0         172.16.3.1               0             0 23456 i
*&gt; 20.0.0.0         0.0.0.0                  0         32768 i</pre>
<p>&#8230; <strong>B</strong> only sees <strong>A</strong>&#8216;s subnet as from <strong>AS_TRANS</strong> (23456).</p>
<p>This is because <strong>B</strong> does not support 4-byte ASN, and router <strong>A</strong> knows this (capabilities exchange during session setup), so it just sends <strong>AS_PATH</strong> attributes containing the 16-bit <strong>AS_TRANS</strong> in place of the real 32-bit AS number.</p>
<p>You can find a similar UPDATE on the first capture I sent on <a href="http://packetlife.net/captures/protocol/bgp/" target="_blank">PacketLife.net</a> (4-byte_AS_numbers_Mixed_Scenario.cap), packet number 2.</p>
<h1>Full 4-byte ASN support: A-D routers</h1>
<p>Let&#8217;s setup the BGP session between routers <strong>A</strong> and <strong>D</strong>; they both support 4-byte ASN.</p>
<pre>A#<strong>sh run | sec bgp</strong>
router bgp 655361
 no synchronization
 bgp log-neighbor-changes
 network 10.0.0.0
 <strong>neighbor 172.16.1.2 remote-as 2621441</strong>
 neighbor 172.16.3.2 remote-as 2
 no auto-summary
D#<strong>sh run | sec bgp</strong>
router bgp 2621441
 no synchronization
 bgp log-neighbor-changes
 network 40.0.0.0
 neighbor 172.16.1.1 remote-as 655361
 no auto-summary</pre>
<p>When sessions come up&#8230;</p>
<pre>A#<strong>sh ip bgp neighbors 172.16.1.2</strong>
BGP neighbor is 172.16.1.2,  remote AS 40.1, external link
  BGP version 4, remote router ID 40.0.0.1
  BGP state = Established, up for 00:04:04
  Last read 00:00:46, last write 00:00:53, hold time is 180, keepalive interval is 60 seconds
  Neighbor sessions:
    1 active, is multisession capable
  Neighbor capabilities:
    Route refresh: advertised and received(new)
    <strong>Four-octets ASN Capability: advertised and received</strong>
    Address family IPv4 Unicast: advertised and received
    Multisession Capability: advertised and received
...</pre>
<p>Here <strong>A</strong> both sent and received the 4-byte ASN capability to/by <strong>B</strong>, because it supports this feature.</p>
<pre>A#<strong>sh ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 10.0.0.0         0.0.0.0                  0         32768 i
*&gt; 20.0.0.0         172.16.3.2               0             0 2 i
*&gt; 40.0.0.0         172.16.1.2               0             0 2621441 i
D#<strong>sh ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 10.0.0.0         172.16.1.1               0             0 655361 i
*&gt; 20.0.0.0         172.16.1.1                             0 655361 2 i
*&gt; 40.0.0.0         0.0.0.0                  0         32768 i</pre>
<p>Both <strong>A</strong> and <strong>D</strong> have subnets with the full 32-bit AS number.</p>
<p>You can see the capture on the file <b>4-byte_AS_numbers_Full_Support.cap</b> on <a href="http://packetlife.net/captures/protocol/bgp/" target="_blank">PacketLife.net</a>.</p>
<p>As I already said, let&#8217;s switch to <strong>asdot notation</strong> now, just to improve readibility:</p>
<pre>D#<strong>conf t</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
D(config)#<strong>router bgp 40.1</strong>
D(config-router)#<strong>bgp asnotation dot</strong>
D(config-router)#<strong>do show ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 10.0.0.0         172.16.1.1               0             0 10.1 i
*&gt; 20.0.0.0         172.16.1.1                             0 10.1 2 i
*&gt; 40.0.0.0         0.0.0.0                  0         32768 i
A#<strong>conf t</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
A(config)#<strong>router bgp 10.1</strong>
A(config-router)#<strong>bgp asnotation dot</strong></pre>
<p>Ok, 10.1 is better than 655361, and 40.1 than 2621441!! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h1>Mixed scenario: D-B routers</h1>
<p>Let&#8217;s have more fun now and bring <strong>D-B</strong> session up!</p>
<pre>D(config-router)#<strong>neighbor 172.16.2.1 remote-as 2</strong>
B(config-router)#<strong>neighbor 172.16.2.2 remote-as 23456</strong></pre>
<p>As we already saw, <strong>B</strong> doesn&#8217;t support 4-byte ASN, so we have to use <strong>AS_TRANS</strong> to peer with <strong>D</strong>.</p>
<pre>D#<strong>show ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
<strong>*  10.0.0.0         172.16.2.1                             0 2 10.1 i</strong>
*&gt;                  172.16.1.1               0             0 10.1 i
*&gt; 20.0.0.0         172.16.2.1               0             0 2 i
*                   172.16.1.1                             0 10.1 2 i
*&gt; 40.0.0.0         0.0.0.0                  0         32768 i</pre>
<p>The interesting thing we can see now on <strong>D</strong> is the presence of <strong>A</strong>&#8216;s subnet (10.0.0.0) advertised by <strong>B</strong>: even if <strong>B</strong> does not support 4-octect ASN, <strong>D</strong> receives it with the real 32-bit path. When <strong>A</strong> advertises the subnet to <strong>B</strong> it makes the <strong>AS_PATH</strong> attribute up using <strong>AS_TRANS</strong>, but it also adds the transitive attribute <strong>NEW_AS_PATH</strong>, containing the full 32-bit AS numbers; when <strong>B</strong> advertises the subnet to <strong>D</strong> it adds this attribute and so <strong>D</strong> can rebuild the real 32-bit path.</p>
<p>As before, you can find a similar UPDATE on the capture I sent on <a href="http://packetlife.net/captures/protocol/bgp/" target="_blank">PacketLife.net</a>; the file is <b>4-byte_AS_numbers_Mixed_Scenario.cap</b>, packet number 3.</p>
<p>Another interesting aspect of 4-byte AS lack of support can be seen in the following table:</p>
<pre>B#<strong>sh ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*  10.0.0.0         172.16.2.2                             0 23456 23456 i
*&gt;                  172.16.3.1               0             0 23456 i
*&gt; 20.0.0.0         0.0.0.0                  0         32768 i
*&gt; 40.0.0.0         172.16.2.2               0             0 23456 i
*                   172.16.3.1                             0 23456 23456 i</pre>
<p>Here <strong>B</strong> has two entries for the 10.0.0.0 subnet: they both seem to be originated from the same AS, but that&#8217;s not true: the first comes from <strong>D</strong> (AS 40.1), while the second (the selected one) comes directly from <strong>A</strong>.</p>
<p>Similar behaviour is for the 40.0.0.0 subnet. Of course, this is not a really big problem, but may lead to false assumptions and compromise traffic patterns analysis.</p>
<h1>16-bit stub router</h1>
<p>Just to complete all the possible scenarios, here is <strong>C</strong> configuration:</p>
<pre>B#<strong>conf t</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
B(config)#<strong>router bgp 2</strong>
B(config-router)#<strong>neighbor 172.16.4.2 remote-as 3</strong>
C#<strong>sh run | sec bgp</strong>
router bgp 3
 no synchronization
 bgp log-neighbor-changes
 network 30.0.0.0
 neighbor 172.16.4.1 remote-as 2
 no auto-summary
C#<strong>sh ip bgp | beg Network</strong>
   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 10.0.0.0         172.16.4.1                             0 2 23456 i
*&gt; 20.0.0.0         172.16.4.1               0             0 2 i
*&gt; 30.0.0.0         0.0.0.0                  0         32768 i
*&gt; 40.0.0.0         172.16.4.1                             0 2 23456 i</pre>
<p>It has no idea of what 4-byte ASN are, so it sees both 10.0.0.0 and 40.0.0.0 subnets as originated from the same AS.</p>
<h1>Thanks</h1>
<p>I have to say thanks to <strong>Marco Rizzi</strong> for his kind support on helping me to build this lab! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  And, of course, I suggest you to visit <a href="http://rizzitech.blogspot.com/" target="_blank">his blog: Marco Rizzi Blog &#8211; networking with passion</a>!!!</p>
<h1>Download the lab</h1>
<p>To download the lab and configuration files <a href="http://www.mediafire.com/file/nvrxnzmuwni/C%3A%5Cfakepath%5C4-byte%20ASN.zip" target="_blank">click here</a>.</p>
<h1>References</h1>
<p>Report on consumption of AS Numbers: <a href="http://www.potaroo.net/tools/asns/" target="_blank">http://www.potaroo.net/tools/asns/</a></p>
<p>BGP Support for Four-octet AS Number Space: <a href="http://www.ietf.org/rfc/rfc4893.txt" target="_blank">RFC 4893</a></p>
<p>APRICOT 2007: <a href="http://www.apricot.net/apricot2007/presentation/conference/Plenary3-Huston.pdf" target="_blank">4-Byte AS Numbers</a> (PDF)</p>
<p>Cisco.com: <a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6554/ps6599/datasheet_c78_516825.html" target="_blank">Migration Guide for Explaining 4-Byte Autonomous System</a></p>
<p>Cisco.com: <a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6554/ps6599/data_sheet_C78-521821.html" target="_blank">Cisco IOS BGP 4-Byte ASN Support</a></p>
<p>Cisco.com: <a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6554/ps6599/white_paper_c11_516829.html" target="_blank">Explaining 4-Byte Autonomous System (AS) ASPLAIN and ASDOT Notation for Cisco IOS</a></p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a>, <a href='http://pierky.wordpress.com/category/networking-labs/'>Networking Labs</a> Tagged: <a href='http://pierky.wordpress.com/tag/4-byte-asn/'>4-byte ASN</a>, <a href='http://pierky.wordpress.com/tag/bgp/'>BGP</a>, <a href='http://pierky.wordpress.com/tag/cisco/'>Cisco</a>, <a href='http://pierky.wordpress.com/tag/gns3/'>GNS3</a>, <a href='http://pierky.wordpress.com/tag/gns3-lab/'>GNS3 Lab</a>, <a href='http://pierky.wordpress.com/tag/gns3-topology/'>GNS3 Topology</a>, <a href='http://pierky.wordpress.com/tag/isp/'>ISP</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/provider/'>Provider</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/713/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=713&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/05/02/gns-3-lab-4-byte-autonomous-system-number-interactions-between-32-and-16-bit-speaking-bgp-routers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>

		<media:content url="http://pierky.files.wordpress.com/2010/05/4-byte-asn1.png" medium="image">
			<media:title type="html">4-byte ASN</media:title>
		</media:content>
	</item>
		<item>
		<title>NetFlow: installation and configuration of NFDUMP and NfSen on Debian</title>
		<link>http://pierky.wordpress.com/2010/03/29/netflow-installation-and-configuration-of-nfdump-and-nfsen-on-debian/</link>
		<comments>http://pierky.wordpress.com/2010/03/29/netflow-installation-and-configuration-of-nfdump-and-nfsen-on-debian/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 08:02:37 +0000</pubDate>
		<dc:creator>pierky</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[NetFlow]]></category>
		<category><![CDATA[NFDUMP]]></category>
		<category><![CDATA[NfSen]]></category>
		<category><![CDATA[NMS]]></category>
		<category><![CDATA[Provider]]></category>

		<guid isPermaLink="false">http://pierky.wordpress.com/?p=681</guid>
		<description><![CDATA[After the brief overview about the installation of flow-tools and FlowViewer, in this post I&#8217;d like to share my experience about the setup of a basic solution based on another pair of tools: NFDUMP and NfSen. As always on my posts, the starting point is a fresh Debian 5.0 setup. Components used in the solution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=681&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After the <a href="http://pierky.wordpress.com/2010/03/06/netflow-how-to-install-and-configure-flow-tools-and-flowviewer-on-a-fresh-debian-setup/">brief overview about the installation of flow-tools and FlowViewer</a>, in this post I&#8217;d like to share my experience about the setup of a basic solution based on another pair of tools: <b>NFDUMP</b> and <b>NfSen</b>. As always on my posts, the starting point is a fresh Debian 5.0 setup.</p>
<h1>Components used in the solution</h1>
<p>As it was for the previous solution, two main components are involved, one to acquire NetFlow data, the other to analyze them in an easy way.</p>
<p><b>NFDUMP</b> is a suite of tools composed by many programs; <b>nfcapd</b> is one of them and it is the daemon which listens for incoming NetFlow data. It is launched by <b>NfSen</b>.</p>
<p><b>NfSen</b> is the web based front end we use to analyze <b>NFDUMP</b> NetFlow data. It is splitted up in two parts: a Perl program which runs in the background and launches <b>nfcapd</b>, and some PHP web pages.</p>
<p>The biggest difference between a <b>NFDUMP/NfSen</b> based solution and a <b>flow-tools/FlowViewer</b> solution is that the former does support <a href="http://www.cisco.com/en/US/products/ps6645/products_ios_protocol_option_home.html" target="_blank">NetFlow v9</a>, while the latter may result in a simpler and easier tool to work with. Anyway, there is not one perfect solution for all the needs!</p>
<p>In this post I&#8217;ll use <b>NFDUMP</b> 1.6.1 and <b>NfSen</b> 1.3.2, the latest stable releases I can find on SourceForge while I&#8217;m writing this blog entry; you can find their web pages in the <b>References</b> section of this post. I&#8217;ll build them from source code.</p>
<h1>NFDUMP</h1>
<p>Let&#8217;s add some tools we&#8217;ll need to build the package:</p>
<p><pre class="brush: bash;">apt-get install gcc flex librrd-dev make</pre></p>
<p>We are ready to start! The steps are very simple: download source code and extract the tar:</p>
<p><pre class="brush: bash;">cd /usr/local/src/
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.1/nfdump-1.6.1.tar.gz/download
gzip -dc nfdump-1.6.1.tar.gz | tar -xf -
cd nfdump-1.6.1</pre></p>
<p>In order to use <b>NFDUMP</b> with <b>NfSen</b> we need to enable <b>nfprofile</b> in the <em>configure</em> step; then we have to make &amp;&amp; make install it:</p>
<p><pre class="brush: bash;">./configure --enable-nfprofile 
make
make install</pre></p>
<p>Now it is ready to be ran.</p>
<p>If we want to use it without <b>NfSen</b> we can stop here and create a simple init.d script to launch <b>NFDUMP</b> at startup; it will acquire NetFlow data and we can use command line tools (such as <b>nfdump</b>) to analyze them. You can find a basic init.d script at the end of this post (&#8220;Annex A: stand-alone NFDUMP&#8221;).</p>
<p>But that&#8217;s not our goal, we want <b>NfSen</b>!</p>
<h1>NfSen</h1>
<p>As said, NfSen has a PHP front-end so it needs a web server with PHP support in order to be used. It also uses RRD to store data and paint nice graphs and some Perl modules to produce alerts: let&#8217;s satisfy its prerequisites:</p>
<p><pre class="brush: bash;">apt-get install apache2 libapache2-mod-php5 php5-common libmailtools-perl rrdtool librrds-perl</pre></p>
<p>Now it&#8217;s time to download and configure the program:</p>
<p><pre class="brush: bash;">cd /usr/local/src/
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.2/nfsen-1.3.2.tar.gz/download
gzip -dc nfsen-1.3.2.tar.gz | tar -xf -
cd nfsen-1.3.2</pre></p>
<p>Once extracted, we have to copy the config file into /etc and modify it: </p>
<p><pre class="brush: bash;">cp etc/nfsen-dist.conf /etc/nfsen.conf
nano /etc/nfsen.conf</pre></p>
<p>As you can see from the <a href="http://nfsen.sourceforge.net/" target="_blank">support web page</a> it presents a lot of parameters, but many of them may be left unchanged; in this example I chose to leave as many parameters as possible at their default settings, so we have all the files in a single directory: <b>/data/nfsen</b>. Here the parameters I changed:</p>
<pre>$USER    = "www-data";
$WWWUSER  = "www-data";
$WWWGROUP = "www-data";

%sources = (
    'MYROUTER'    =&gt; { 'port'    =&gt; '9995', 'col' =&gt; '#0000ff', 'type' =&gt; 'netflow' },
);

$MAIL_FROM   = 'MYEMAIL@MYDOMAIN.COM';
$SMTP_SERVER = 'MY.SMTPSERVER.COM';</pre>
<p>For a better setup I suggest you to read the configuration guide on the project&#8217;s web site.</p>
<p>Let&#8217;s make the destination directory and complete the installation by running the <b>install.pl</b> script:</p>
<p><pre class="brush: bash;">mkdir -p /data/nfsen
./install.pl /etc/nfsen.conf</pre></p>
<p>We are ready to run the <b>nfsen</b> program and let it executes <b>nfcapd</b> daemon:</p>
<p><pre class="brush: bash;">cd /data/nfsen/bin
./nfsen start</pre></p>
<p>We can also schedule it to be ran at startup:</p>
<p><pre class="brush: bash;">ln -s /data/nfsen/bin/nfsen /etc/init.d/nfsen
update-rc.d nfsen defaults 20</pre></p>
<p>It&#8217;s ready: point your browser at http://YOUR_IP_ADDRESS/nfsen/nfsen.php and enjoy! Of course, this is just a very basic setup, both <b>NFDUMP</b> and <b>NfSen</b> have many options you can set and use to have better performances and to improve stability and scalability. If you want to go deep into their configuration I suggest you to use the links you can find at the end of this post.</p>
<p>P.S.: Don&#8217;t forget to configure your routers to export NetFlow data! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h1>Annex A: stand-alone NFDUMP</h1>
<p>As said, <b>NFDUMP</b> may be used in a stand-alone way, without the help of <b>NfSen</b>.</p>
<p>We just have to build a destination directory for NetFlow data&#8230;</p>
<p><pre class="brush: bash;">mkdir -p /var/flows/MYROUTER
mkdir -p /var/flows/MYSECONDROUTER</pre></p>
<p>and add an init.d script like the following one:</p>
<p><pre class="brush: bash;">#! /bin/sh
### BEGIN INIT INFO
# Provides:          nfcapd
# Required-Start:    $network
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: netflow capture daemon
# Description:       nfcapd is the netflow capture daemon of the nfdump tools.
### END INIT INFO

# Author: Erik Wenzel &lt;erik@debian.org&gt;
# Edited by Pierky for the blog post &quot;NetFlow: installation and configuration of 
# NFDUMP and NfSen on Debian&quot; on http://pierky.wordpress.com

# Do NOT &quot;set -e&quot;

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC=&quot;netflow capture daemon&quot;
NAME=nfcapd
DAEMON=/usr/local/bin/$NAME
DATA_BASE_DIR=&quot;/var/flows&quot;
PIDFILE=/var/run/$NAME.pid
DAEMON_ARGS=&quot;-D -w -S 1 -P $PIDFILE -n MYROUTER,192.168.0.1,$DATA_BASE_DIR/MYROUTER&quot;
SCRIPTNAME=/etc/init.d/nfdump

# Exit if the package is not installed
[ -x &quot;$DAEMON&quot; ] || exit 0

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (&gt;= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test &gt; /dev/null \
                || return 1
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                $DAEMON_ARGS \
                || return 2
        # Add code here, if necessary, that waits for the process to be ready
        # to handle requests from services started subsequently which depend
        # on this one.  As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
        RETVAL=&quot;$?&quot;
        [ &quot;$RETVAL&quot; = 2 ] &amp;&amp; return 2
        # Wait for children to finish too if this is a daemon that forks
        # and if the daemon is only ever run from this initscript.
        # If the above conditions are not satisfied then add some other code
        # that waits for the process to drop all resources that could be
        # needed by services started subsequently.  A last resort is to
        # sleep for some time.
        #
        # Disabled second call, because is kills nfsen controlled nfcapd
        #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
        #[ &quot;$?&quot; = 2 ] &amp;&amp; return 2
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
        return &quot;$RETVAL&quot;
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
        #
        # If the daemon can reload its configuration without
        # restarting (for example, when it is sent a SIGHUP),
        # then implement that here.
        #
        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
        return 0
}

case &quot;$1&quot; in
  start)
        [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Starting $DESC&quot; &quot;$NAME&quot;
        do_start
        case &quot;$?&quot; in
                0|1) [ q&quot;$VERBOSE&quot; != qno ] &amp;&amp; log_end_msg 0 ;;
                2)   [ p&quot;$VERBOSE&quot; != pno ] &amp;&amp; log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Stopping $DESC&quot; &quot;$NAME&quot;
        do_stop
        case &quot;$?&quot; in
                0|1) [ &quot;r$VERBOSE&quot; != rno ] &amp;&amp; log_end_msg 0 ;;
                2) [ &quot;s$VERBOSE&quot; != sno ] &amp;&amp; log_end_msg 1 ;;
        esac
        ;;
  #reload|force-reload)
        #
        # If do_reload() is not implemented then leave this commented out
        # and leave 'force-reload' as an alias for 'restart'.
        #
        #log_daemon_msg &quot;Reloading $DESC&quot; &quot;$NAME&quot;
        #do_reload
        #log_end_msg $?
        #;;
  restart|force-reload)
        #
        # If the &quot;reload&quot; option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg &quot;Restarting $DESC&quot; &quot;$NAME&quot;
        do_stop
        case &quot;$?&quot; in
          0|1)
                do_start
                case &quot;$?&quot; in
                        0|1) log_end_msg 0 ;;
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        #echo &quot;Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}&quot; &gt;&amp;2
        echo &quot;Usage: $SCRIPTNAME {start|stop|restart|force-reload}&quot; &gt;&amp;2
        exit 3
        ;;
esac
exit 0</pre></p>
<p>I edited this script starting from the one included in the <a href="http://packages.debian.org/en/source/lenny/nfdump" target="_blank">Debian&#8217;s package</a>.</p>
<p>Please note the <b>DATA_BASE_DIR</b> and the <b>DAEMON_ARGS</b> variables. The first contains the base destination directory for our NetFlow data. The second represents arguments we want to use when launching <b>nfcapd</b>; you can add as many <b>-n</b> options as you want, one for each NetFlow source you want to collect data from. Remember: <b>man nfcapd</b> is your friend! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Finally:</p>
<p><pre class="brush: bash;">chmod a+x /etc/init.d/nfdump
update-rc.d nfdump defaults 20
/etc/init.d/nfdump start</pre></p>
<h1>References</h1>
<p>Cisco.com: <a href="http://www.cisco.com/en/US/products/ps6645/products_ios_protocol_option_home.html" target="_blank">NetFlow version 9</a></p>
<p>NFDUMP: <a href="http://nfdump.sourceforge.net/" target="_blank">http://nfdump.sourceforge.net/</a></p>
<p>NfSen: <a href="http://nfsen.sourceforge.net/" target="_blank">http://nfsen.sourceforge.net/</a></p>
<br />Filed under: <a href='http://pierky.wordpress.com/category/networking/'>Networking</a>, <a href='http://pierky.wordpress.com/category/networking/security/'>Security</a>, <a href='http://pierky.wordpress.com/category/systems-administration/'>Systems Administration</a> Tagged: <a href='http://pierky.wordpress.com/tag/cisco/'>Cisco</a>, <a href='http://pierky.wordpress.com/tag/howto/'>HowTo</a>, <a href='http://pierky.wordpress.com/tag/isp/'>ISP</a>, <a href='http://pierky.wordpress.com/tag/linkedin/'>LinkedIn</a>, <a href='http://pierky.wordpress.com/tag/netflow/'>NetFlow</a>, <a href='http://pierky.wordpress.com/tag/nfdump/'>NFDUMP</a>, <a href='http://pierky.wordpress.com/tag/nfsen/'>NfSen</a>, <a href='http://pierky.wordpress.com/tag/nms/'>NMS</a>, <a href='http://pierky.wordpress.com/tag/provider/'>Provider</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pierky.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pierky.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pierky.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pierky.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pierky.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pierky.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pierky.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pierky.wordpress.com/681/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pierky.wordpress.com&amp;blog=6344305&amp;post=681&amp;subd=pierky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pierky.wordpress.com/2010/03/29/netflow-installation-and-configuration-of-nfdump-and-nfsen-on-debian/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pierky</media:title>
		</media:content>
	</item>
	</channel>
</rss>
