<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AdmiNirvana &#187; Networking</title>
	<atom:link href="http://www.briandowney.net/blog/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.briandowney.net/blog</link>
	<description>Technical musings of an entrepreneur.</description>
	<lastBuildDate>Thu, 20 Aug 2009 17:53:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Firewalling brute force attempts with IPTables</title>
		<link>http://www.briandowney.net/blog/2009/08/20/firewalling-brute-force-attempts-with-iptables/</link>
		<comments>http://www.briandowney.net/blog/2009/08/20/firewalling-brute-force-attempts-with-iptables/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:53:14 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tlf]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[brute]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[force]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=124</guid>
		<description><![CDATA[Almost 24 hours per day, The Linux Fix is inundated with FTP and SSH brute force attempts to our server farm.   This has compromised a few our our customer&#8217;s accounts from time to time, and I decided it was time to come up with a solution.
The problem is tricky&#8211;we must leave FTP and SSH open [...]]]></description>
			<content:encoded><![CDATA[<p>Almost 24 hours per day, The Linux Fix is inundated with FTP and SSH brute force attempts to our server farm.   This has compromised a few our our customer&#8217;s accounts from time to time, and I decided it was time to come up with a solution.</p>
<p>The problem is tricky&#8211;we must leave FTP and SSH open to the entire world, but at the same time be selective on what we black list.   How do you make that determination?  Strictly on bad login credentials?</p>
<p>We could, but that would mean that we&#8217;d inadvertently lock out real users.  A better solution we found has to do with timing connection attempts.   With IPTables, we can keep a counter based upon source IP&#8211;and track how many new socket attempts are made within a certain span of time.     For instance, if we detect the IP address 1.2.3.4 making 5 connection attempts within 60 seconds, there is a darn good chance it isn&#8217;t someone mistyping a password.</p>
<p>Here is how we did it, based upon another script we found out in the Internets:</p>
<pre>#!/bin/bash
/sbin/iptables -N SSH
/sbin/iptables -N SSH_BLACKLIST
/sbin/iptables -A SSH_BLACKLIST -m recent --name SSH_COUNTER --set -j LOG --log-level warn --log-prefix "Blocked: "
/sbin/iptables -A SSH_BLACKLIST -j REJECT
/sbin/iptables -A SSH -m recent --name SSH_COUNTER --update --seconds 300 -j REJECT
/sbin/iptables -A SSH -m recent --name SSH --rcheck --seconds 60 --hitcount 5 -j SSH_BLACKLIST
/sbin/iptables -A SSH -m recent --name SSH --rcheck --seconds 2 -j LOG --log-level warn --log-prefix "Added: "
/sbin/iptables -A SSH -m recent --name SSH --update --seconds 2 -j REJECT
/sbin/iptables -A SSH -m recent --name SSH_COUNTER --remove -j LOG --log-level warn --log-prefix "Removed: "
/sbin/iptables -A SSH -m recent --name SSH --set -j ACCEPT
/sbin/iptables -A INPUT -m state --state NEW -p tcp -m tcp --dport 22 -j SSH</pre>
<p>This creates two new tables, SSH and SSH_BLACKLIST.   Upon the intial connection attempt, the IP is added to the SSH_COUNTER counter.   If the same IP address is seen again within 60 seconds, it is duly noted&#8211;however no action is taken until the hitcount reaches 5.   In that case, the rules jump to the SSH_BLACKLIST table, it is logged, and subsequent connections from that IP are dropped for 5 minutes until things calm down.   In order to do this for FTP, just rename the targets as appropriate and change the target port to 21 on the last line.</p>
<p>The nice thing about this set up is that it is auto-cleaning.  After 5 minutes of no activity, the counter forgets about the IP address and things return to normal.   We&#8217;ve found that this is just enough protection to drastically reduce bruteforce attempts, yet not get in the way of normal usage by our customers.  Over time, this has become our favorite technique and we&#8217;ve begun to implement it on any Internet-facing machine with open SSH ports.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2009/08/20/firewalling-brute-force-attempts-with-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trixbox, VPNs, NAT, and the 20 second dropping issue</title>
		<link>http://www.briandowney.net/blog/2008/10/24/trixbox-vpns-nat-and-the-20-second-dropping-issue/</link>
		<comments>http://www.briandowney.net/blog/2008/10/24/trixbox-vpns-nat-and-the-20-second-dropping-issue/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 16:30:14 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tlf]]></category>
		<category><![CDATA[Trixbox]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=116</guid>
		<description><![CDATA[I usually don&#8217;t like to cross-post between blogs, but this problem seems prevalent enough that it needs more exposure.   We&#8217;ve solved it at TLF, and here&#8217;s how:
http://www.thelinuxfix.com/blog/2008/10/24/trixbox-vpns-and-the-20-second-issue/
]]></description>
			<content:encoded><![CDATA[<p>I usually don&#8217;t like to cross-post between blogs, but this problem seems prevalent enough that it needs more exposure.   We&#8217;ve solved it at TLF, and here&#8217;s how:</p>
<p><a href="http://www.thelinuxfix.com/blog/2008/10/24/trixbox-vpns-and-the-20-second-issue/">http://www.thelinuxfix.com/blog/2008/10/24/trixbox-vpns-and-the-20-second-issue/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/10/24/trixbox-vpns-nat-and-the-20-second-dropping-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Machine via AFP</title>
		<link>http://www.briandowney.net/blog/2008/07/01/time-machine-via-afp/</link>
		<comments>http://www.briandowney.net/blog/2008/07/01/time-machine-via-afp/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 20:55:47 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[network share]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=109</guid>
		<description><![CDATA[I have been itching to get Time Machine to work over a (unsupported) network-shared volume since we&#8217;re unwilling to drop the cash for a Time Capsule.  I&#8217;ve seen quite a few different posts on how to get it done, including the terminal trick to tell Time Machine to use unsupported volumes, but none of them [...]]]></description>
			<content:encoded><![CDATA[<p>I have been itching to get Time Machine to work over a (unsupported) network-shared volume since we&#8217;re unwilling to drop the cash for a Time Capsule.  I&#8217;ve seen quite a few different posts on how to get it done, including the terminal trick to tell Time Machine to use unsupported volumes, but none of them quite worked.</p>
<p>The best I could get was Time Machine to begin to write the files to the share, but after a few seconds die with a vague &#8220;Backup disk could not be created error&#8221;.  This stumped me for a bit until I came <a title="TimeMachine via AFP" href="http://pastebin.com/f47499d34">across this</a>.  Apparently sometime around 10.5.2, Apple introduced a new, undocumented &#8220;feature&#8221; to Time Machine that causes it to fail over network volumes when doing the initial backup.   However, once the files are created it will work fine.</p>
<p>So, the magical combination is as follows:</p>
<ul>
<li>CentOS 5 with <a title="Netatalk" href="http://netatalk.sourceforge.net/">Netatalk-2.0.3</a> compiled, installed, and configured per <a title="Netatalk on CentOS 5" href="http://www.sharedknowhow.com/2008/05/installing-netatalk-under-centos-5-with-leopard-support/">this post</a>.  Note: I also had to modify etc/cnid_dbd/dbif.c with the same code change as specified there, but YMMV.</li>
<li>OS X Leopard, patched to 10.5.4.</li>
<li>Changes to Netatalk&#8217;s netatalk.conf file per <a title="Gentoo Wiki" href="http://gentoo-wiki.com/HOWTO_Share_Directories_via_AFP">this post</a> at the Gentoo Wiki.</li>
<li>Following the <a href="http://pastebin.com/f47499d34">post linked above</a> <strong>precisely</strong>.</li>
</ul>
<p>Once that happened, Time Machine has begun to work great over AFP to our backup volume&#8211;even for multiple Macs connecting to the same share. Behold!</p>
<p><a href="http://www.briandowney.net/blog/wp-content/uploads/2008/07/timemachine.jpg"><img class="aligncenter size-medium wp-image-110" title="timemachine" src="http://www.briandowney.net/blog/wp-content/uploads/2008/07/timemachine-300x199.jpg" alt="Time Machine working over a Net Share" width="300" height="199" /></a></p>
<p>It probably doesn&#8217;t need saying; but this is clearly an unsupported way to use Time Machine.  It has been running this way for me only about a day.    If you&#8217;re concerned about having to troubleshoot problems that may pop up down the road, especially regarding backups; picking up a <a href="http://www.apple.com/timecapsule/">Time Capsule</a> is probably a far better idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/07/01/time-machine-via-afp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building the EtherSAN: Part 2</title>
		<link>http://www.briandowney.net/blog/2008/01/25/building-the-ethersan-part-2/</link>
		<comments>http://www.briandowney.net/blog/2008/01/25/building-the-ethersan-part-2/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 18:37:00 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Clustering]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[ethersan]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2008/01/25/building-the-ethersan-part-2/</guid>
		<description><![CDATA[In the first part of “Building the EtherSan”, I outlined The Linux Fix’s business needs and reasons for building out an ethernet-based storage area network (SAN), a relatively uncommon platform.  In this part I discuss the design and products that were chosen to  prove its viability before purchasing equipment for testing.
So the time [...]]]></description>
			<content:encoded><![CDATA[<p><em>In the first part of “Building the EtherSan”, I outlined The Linux Fix’s business needs and reasons for building out an ethernet-based storage area network (SAN), a relatively uncommon platform.  In this part I discuss the design and products that were chosen to  prove its viability before purchasing equipment for testing.</em></p>
<p>So the time had come to build out a rig and see if this new idea would work.  Worries about a failure of the test were unwarranted: If I ran into a major problem while testing, I would always be able to repurpose the equipment in another fashion.</p>
<p>Here’s a crude <a href="http://www.briandowney.net/files/ethersan.jpg">diagram</a> of what I was trying to achieve.</p>
<p>As you probably notice, there is a blatant single point of failure&#8211;the ethernet switch.  Normally, intuition says implement two switches and do failover.  Problem is that would require more money in terms of a second switch and additional NICs for the client servers.  In my experience the switch would be the least likely to fail, while the servers would be the most likely&#8211;so it was a calculated and designed-in risk.  Besides, it would be trivial to add another switch and do it “right” at a later date.</p>
<p>I had no prior experience shopping for dedicated disk storage, so to get an idea of what was available I shot an email off to <a href="http://www.epowerhousepc.com">ePowerhouse PC</a>, a customer of ours.  I explained the goals we were trying to achieve as well as our need for low entry price.</p>
<p>Terry at ePC has been a great resource for getting The Linux Fix parts quickly, and uncommon ones at that.   He made a suggestion of using arrays from a company called <a href="http://infortrend.com/">Infortrend</a>, since ePC was already a reseller for that particular vendor.  After doing some more research I found an Infortrend fiber-based array that used lower-priced (but still high performing) SATA-II hard disks for storage.   After some specification digging and decision making, I chose the <a href="http://infortrend.com/main/2_product/es_a24f-r(g)2430.asp">EonStor A24F-R2430</a>, which provides dual-redundant SATA-to-3bgps Fiber controller modules with an eight-port integrated fiber switch.  A nice, elegant, all-in-one solution.  Did I mention it supports 24 hard drives? TLF’s storage needs would be solved for quite some time!  It turned out to be a great choice, a perfect blend of value and performance for us.</p>
<p>For the head-end NFS cluster servers, I chose a pair of low-end <a href="http://www.dell.com/content/products/productdetails.aspx/pedge_860?c=us&amp;cs=04&amp;l=en&amp;s=bsd">Dell PowerEdge 860</a> 1U servers.  The PowerEdge 860 has an available PCIe slot for a fiber host bus adapter (HBA), as well as an optional quad-core Xeon.  Being that these servers were going to be clustered, I was not overly concerned with individual redundancy and opted for a cheaper software-based RAID solution on each.  However, the pricey Dell Remote Access Controller was necessity because of RedHat’s <a href="http://www.redhat.com/cluster_suite/">Cluster Suite</a>.  RHCS requires a “fencing” device in order to reboot a server remotely in the event of error&#8211;and the DRAC suffices for that task (there are shortcomings to this, do your own research!).   As I had mentioned in the previous article, fiber equipment is insanely expensive; in our case the Emulex fiber HBA was 20% of the server price!  However, the lower entry price of the PowerEdge 860 offset that and we still ended up with a bargain.</p>
<p>As for the ethernet switch, I fell back to my old reliable favorite, the <a href="http://configure.us.dell.com/dellstore/config.aspx?c=us&amp;cs=04&amp;kc=6W300&amp;l=en&amp;oc=bccw1k1&amp;s=bsd">Dell PowerConnect 5324</a>.  It’s worked well for TLF in the past, is reliable, and provides plenty of bang for the buck.</p>
<p>Finally, I purchased twenty four 250 gigabyte SATA-II drives.  At the time, 250 gig hard disks were the price-to-value point, and depending on the type of RAID used on the array, we would end up with roughly 5 terabytes of usable space.  An important detail that Terry mentioned to me was to ensure the hard drive model was included on Infortrend’s compatibility list, and that made the decision on which models to purchase easier.</p>
<p>Overall price tag for the equipment came out to approximately $16,000, and broke down about like this:</p>
<p>PowerEdge 860 Servers (w/HBA):  $1,200/ea<br />
PowerConnect 5234 GigE Switch:  $800<br />
EonStor A24F-R2430: $11,000<br />
Seagate SATA HDs 250GB: $2800</p>
<p>Sounds expensive, but when pricing out equivalent storage options from a well-known vendor such as NetApp, $3.00/gb isn’t a bad deal at all.   The only thing left was to ensure I was going to get a well performing, expandable storage network.</p>
<p>All that was left to do was wait for the equipment to arrive and being my tests, which will be the topics I cover in the next post.  Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/01/25/building-the-ethersan-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cabling as an art</title>
		<link>http://www.briandowney.net/blog/2008/01/24/cabling-as-an-art/</link>
		<comments>http://www.briandowney.net/blog/2008/01/24/cabling-as-an-art/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 20:46:00 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2008/01/24/cabling-as-an-art/</guid>
		<description><![CDATA[Any true geek is impressed by a neat cabling job.  There&#8217;s something about the order that results from equally banded cables in conjunction with blinking lights that makes the heart warm.Here are a few snapshots of the cleanest cabling jobs I&#8217;ve seen.  Compare that with what I thought was a nice cabling job (sorry for [...]]]></description>
			<content:encoded><![CDATA[<p>Any true geek is impressed by a neat cabling job.  There&#8217;s something about the order that results from equally banded cables in conjunction with blinking lights that makes the heart warm.Here are a few snapshots of the <a href="http://royal.pingdom.com/?p=240">cleanest cabling jobs</a> I&#8217;ve seen.  Compare that with what I thought was a nice <a href="http://www.briandowney.net/files/tlfcabling.jpg">cabling job</a> (sorry for the poor quality, cell phone shot) from one of the <a href="http://www.briandowney.net/files/tlfrack.jpg">Linux Fix racks</a>, and I feel like a slob!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/01/24/cabling-as-an-art/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building the EtherSAN: Part 1</title>
		<link>http://www.briandowney.net/blog/2008/01/16/building-the-ethersan-part-1/</link>
		<comments>http://www.briandowney.net/blog/2008/01/16/building-the-ethersan-part-1/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 22:28:51 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Clustering]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[ethersan]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=5</guid>
		<description><![CDATA[One of the first roadblocks I ran into growing The Linux Fix was disk space.  Even a few years ago our primary storage file system was exceeding 450 gigabytes, and growing fast making a flexible storage a key point.  After some trials (and errors!) the most recent and cost effective solution has become [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first roadblocks I ran into growing The Linux Fix was disk space.  Even a few years ago our primary storage file system was exceeding 450 gigabytes, and growing fast making a flexible storage a key point.  After some trials (and errors!) the most recent and cost effective solution has become something we like to call the “Ether-SAN”.</p>
<p>When starting out, local disk storage worked just fine for us.  A few large SAS or SCSI drives behind a cached RAID controller offered plenty of performance.  Most web hosts start with a single server, and there is really no need to look any further.  In fact, that local storage sufficed for us quite a long time&#8211;three years&#8211;even with a few servers in the mix.  When we started running short on other boxes we simply exported some via NFS from the server with space.</p>
<p>Of course this didn’t work for long.  The time came when we needed more than one web server to host the same sites.  NFS still worked for that, but the problem turned into an architectural one&#8211;a “spiderweb” of servers hosting data to each other, letting available storage dictate the network design.</p>
<p>Mixing application and storage boxes is just simply not a good idea.  Though it may work at first, tuning and maintaining your installation becomes far more difficult than it needs to be&#8211;and that in turn can cause your customers grief.  Stop right there!  The time had come for us to invest in a central storage platform.  This is the first serious dive into investing that The Linux Fix needed to make, and it had dollar signs floating like sugar plums in my head.</p>
<p>Researching storage options always lead to one of two solutions:  Network based (NAS, usually over NFS) or direct-attached SAN.  First, some background on the idea behind both.</p>
<p>A NAS device sits on the network with the rest of your servers and gets an IP address&#8211;just like any other server.  Storage from the NAS is served up via the protocol of your choice (NFS for Linux/Unix) and usually doesn’t have a very large price tag.  The downside, of course, is that the network is then taxed with your storage traffic and is often limited in expansion to the device or server select to perform this duty.  Not much of an improvement over the setup of old other than delaying the inevitable.</p>
<p>Direct attached is basically just a NAS with the ability to plug servers directly into it, usually via fiber channel.  This offers fantastic performance, but isn’t really an option unless there is money to burn.   Entry level SAN disk arrays ($$$)  only offer a few direct-attach points, for which you will need fiber-HBA cards for your servers ($$$).   Then when running out of direct-attach points on your SAN, a fiber switch ($$$) is needed.  After that is said and done, spending $10,000 building out a fiber-based network isn’t unrealistic&#8211;and we had not considered the cost of disks yet.</p>
<p>While pondering the situation, an idea hit.   Why not build an ethernet-based SAN, instead of a fiber-based SAN?  This would combine the best of both worlds:   A dedicated gigabit ethernet network carrying NFS traffic.  The final rendition would be an expandable NFS cluster, direct attached to a fiber disk array with redundant controllers and cache.   The expensive part&#8211;fiber cards and disk array&#8211;would remain a fixed cost, and expansion could be done in terms of cheap methods, namely ethernet switches and NFS servers!</p>
<p>So a plan was in place, and it needed some testing before I was going to bet the business on it.   Stay tuned, and I’ll touch on the steps taken to build out and test this idea in the next articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/01/16/building-the-ethersan-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
