<?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>JulietMikeBravo &#187; computers-networking</title>
	<atom:link href="http://www.julietmikebravo.nl/index.php/category/computersnetworking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.julietmikebravo.nl</link>
	<description>keratoconus – electronica – amateur radio  - etc.</description>
	<lastBuildDate>Sun, 22 Jan 2012 20:43:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Arduino/Cacti Geiger counter update</title>
		<link>http://www.julietmikebravo.nl/index.php/2011/09/06/arduinocacti-geiger-counter-update/</link>
		<comments>http://www.julietmikebravo.nl/index.php/2011/09/06/arduinocacti-geiger-counter-update/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 18:22:24 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[computers-networking]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[wetenschap/science]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[geiger counter]]></category>
		<category><![CDATA[radioactiviteit]]></category>
		<category><![CDATA[radioactivity]]></category>

		<guid isPermaLink="false">http://www.julietmikebravo.nl/?p=921</guid>
		<description><![CDATA[My online geiger counter which I described earlier has been offline for some time. During that time I experimented with a standalone Arduino with the goal of making a dedicated board for the setup. I have now completed the board shown in the picture below. In the picture you can see the HV generator on [...]]]></description>
			<content:encoded><![CDATA[<p>My online geiger counter <a href="http://www.julietmikebravo.nl/index.php/2011/04/02/online-geiger-counter-using-arduino-and-cacti/">which I described earlier</a> has been offline for some time. During that time I experimented with a standalone Arduino with the goal of making a dedicated board for the setup. I have now completed the board shown in the picture below.</p>
<p style="text-align: center;"><a href="http://www.julietmikebravo.nl/static/images/gmcounterserial.jpg"><img class="aligncenter" title="Serial Geiger Counter" src="http://www.julietmikebravo.nl/static/images/gmcounterserial.jpg" alt="" width="387" height="258" /></a></p>
<p>In the picture you can see the HV generator on the top of the board, on the lower left the Arduino standalone parts along with a MAX232 as a level converter for easy serial hookup and on the right two tubes connected in parallel, a SI-29BG (beta and gamma) and a SI-12B for added alpha sensivity. Also shown are the USB&gt;Serial adapter and a separate USB connector to provide 5V to the board. <span id="more-921"></span></p>
<p>I have had it running for some weeks with a Russian <a href="http://www.gstube.com/data/2484/" target="_blank">SI-29BG</a> hard beta and gamma tube. These are nice, very sturdy tubes to experiment with. They easily detect natural background radiation and K-40 from a bag of Potassium Chloride.As I already explained I have connected two tubes in parallel. There wasn&#8217;t that much variation in background radiation, (see below) even after heavy rainfall so I am now going to watch whether alpha sensivity makes any difference.</p>
<p><a href="http://ruthenium.dyndns.org/graphs/graph_61.html"><img class="aligncenter" src="http://www.julietmikebravo.nl/static/images/radcacti.png" alt="" width="470" height="223" /></a></p>
<p>Also, the SI-12B is kind of useless on its own, it is not very sensitive to beta and gamma but is able to detect alpha quite well due to its mica window.</p>
<h2>Scripting</h2>
<p>I have also changed my scripting on both Linux and Arduino to make everything easier to test and make it fail gracefully when the counter stops functioning for some reason. It also now works in Cacti with a GAUGE type of data, not a counter. This prevents spikes when the counter is reset or temporarily disconnected or offline. The script is as follows:</p>
<pre>#!/bin/bash
# serial gmcounter update &amp; log script
LOGFILE=/var/log/gmcount.log

function getcounts {
# display last 5 minute counts
# check if log was updated within 6 minutes
if [ `find $LOGFILE -mmin -6` ]
then
# print last 5 minute count
tail -n 1 $LOGFILE | awk {' print $5'}
else
echo "Error - logfile too old"
fi
}

function log {
# read counts from serial and write to logfile
read LINE &lt; /dev/ttyUSB0
echo $(date) &gt;&gt; $LOGFILE
echo $LINE &gt;&gt; $LOGFILE
}

# check arguments and display or log data
if [ "$1" = "" ]
then
echo 'Use "getcounts" to display counts or "log" to log counts'
fi

if [ "$1" = "getcounts" ]
then
getcounts
fi

if [ "$1" = "log" ]
then
log
fi</pre>
<p>I have put everything in one script and created functions to log the counts over  the last 5 minutes or display the last logged 5 minute count. If the logfile wasn&#8217;t updated properly it will return an error, causing Cacti to not record a value and show the error in its logfile. The script is connected to SNMP as described in my original article.</p>
<p>The Arduino script is as follows:</p>
<pre>unsigned long counts = 0;
unsigned long fivemcount = 0;
long timer = 0;
long fivemtimer = 0;

void setup() {
Serial.begin(9600);
Serial.println("serial gm counter v1.0 starting...");
attachInterrupt(1, counter, FALLING);

}

void loop(){

if (millis() - fivemtimer &gt; 300000){
 fivemcount = counts;
 counts = 0;
 fivemtimer = millis();
}
 if (millis() - timer &gt; 10000){
 Serial.print("counts, cur: ");
 Serial.print(counts);
 Serial.print(" total: ");
 if (fivemcount == 0){
 Serial.println("n/a");
 }
 else {
 Serial.println(fivemcount);
 }
 timer = millis();
 }

}

void counter()
{
 counts++;
 tone(8,5000,1);
}</pre>
<p>Basically, it counts the pulses, outputs the last five minute count every 10 seconds using the serial port and clears the counter after 5 minutes preventing any overflows of the unsigned long value (very unlikely). It also gives a very short tone with each interrupt which results in a little clicking sound. The random clicking helps me get to sleep quicker <img src='http://www.julietmikebravo.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>BTW, the current graph can be found <a href="http://ruthenium.dyndns.org/graphs/graph_61.html" target="_blank">here</a>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.julietmikebravo.nl/index.php/2011/09/06/arduinocacti-geiger-counter-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DS1820 Temp. monitoring using Linux and Cacti</title>
		<link>http://www.julietmikebravo.nl/index.php/2010/10/04/ds1820-temp-monitoring-using-linux-and-cacti/</link>
		<comments>http://www.julietmikebravo.nl/index.php/2010/10/04/ds1820-temp-monitoring-using-linux-and-cacti/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 13:23:37 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[computers-networking]]></category>
		<category><![CDATA[Electronica]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[wetenschap/science]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[ds1820]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[temperature]]></category>

		<guid isPermaLink="false">http://www.julietmikebravo.nl/?p=772</guid>
		<description><![CDATA[This article will try to explain how to monitor and graph temperatures remotely using Dallas Semiconductor DS18xx sensors, SNMP and Cacti. DS18xx sensors are relatively cheap, accurate and multiple sensors can be connected to a single bus. This guide is based on Ubuntu, so YMMV on other Linux/Unix based systems and may need modification to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.julietmikebravo.nl/static/images/cactitemp.png"><img class="aligncenter" title="cactitemp" src="http://www.julietmikebravo.nl/static/images/cactitemp.png" alt="" width="425" height="171" /></a></p>
<p>This article will try to explain how to monitor and graph temperatures remotely using <a href="http://www.maxim-ic.com/datasheet/index.mvp/id/2815" target="_blank">Dallas Semiconductor DS18xx sensors</a>, SNMP and <a href="http://www.cacti.net/" target="_blank">Cacti</a>. DS18xx sensors are relatively cheap, accurate and multiple sensors can be connected to a single bus.</p>
<p>This guide is based on Ubuntu, so YMMV on other Linux/Unix based systems and may need modification to work properly.</p>
<p><span id="more-772"></span></p>
<h2>Interfacing and software</h2>
<p>To directly read out DS18xx sensors you need the following things:</p>
<p>- a Linux server running the software package <a href="http://www.digitemp.com/" target="_blank">digitemp </a>(available on various platforms) and <a href="http://net-snmp.sourceforge.net/" target="_blank">net-snmp</a></p>
<p>- a serial to <a href="http://en.wikipedia.org/wiki/One_wire" target="_blank">1-wire</a> adapter (DS9097 or build one yourself with the following <a href="http://www.instructables.com/image/FBRANFGG8B8VUFO/1-wire-communication-interface.jpg" target="_blank">schematic</a>)</p>
<p>- an installation of<a href="http://www.cacti.net/" target="_blank"> cacti</a> running on a remote or local server</p>
<p>Setting up the hardware of the 1-wire network is outside the scope of the article. You can find lots of  guides to cabling and building interfaces on Google.</p>
<h2>Testing and reading out sensors</h2>
<p>When everything is connected properly you can try to read out the sensors. Make sure digitemp is installed and enter the following command  (this command assumes your first serial port is /dev/ttyS0, for USB serial adapters try /dev/ttyUSB0)</p>
<pre>digitemp_DS9097 -w -s /dev/ttyS0</pre>
<p>Digitemp should search (walk, hence the &#8220;-w&#8221;) the network and find sensors if they are connected:</p>
<pre>DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU Public License v2.0 - http://www.digitemp.com
Turning off all DS2409 Couplers
..
Devices on the Main LAN
10A67CF501080074 : DS1820/DS18S20/DS1920 Temperature Sensor
10DF7DF5010800B7 : DS1820/DS18S20/DS1920 Temperature Sensor</pre>
<p>In the example above two DS18xx sensors are found. If no sensors are found, check your cabling and sensors. It is also best to run as root to make sure there are no permission issues.</p>
<p>To make digitemp remember the sensors you have to store the settings in a configuration file. You can do a walk and configuration using the following command:</p>
<pre>digitemp_DS9097 -i -s /dev/ttyS0</pre>
<p>It should report the connected devices and confirm that it wrote a configuration file:</p>
<pre>DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane</pre>
<pre>GNU Public License v2.0 - http://www.digitemp.com</pre>
<pre>Turning off all DS2409 Couplers</pre>
<pre>..</pre>
<pre>Searching the 1-Wire LAN</pre>
<pre>10A67CF501080074 : DS1820/DS18S20/DS1920 Temperature Sensor</pre>
<pre>10DF7DF5010800B7 : DS1820/DS18S20/DS1920 Temperature Sensor</pre>
<pre>ROM #0 : 10A67CF501080074</pre>
<pre>ROM #1 : 10DF7DF5010800B7</pre>
<pre>Wrote .digitemprc</pre>
<p>It is best to move the configuration file to a central location, for example I use <em>/etc/digitemp/digitemp.conf</em>.  If you have multiple sensors you might be confused which sensor is which.  A simple way to check which sensor you are measuring is to hold it in your hand and probe the sensor indexes using the following command:</p>
<pre>digitemp_DS9097 -t 1 -c /etc/digitemp/digitemp.conf</pre>
<p>In this example, the sensor with index &#8220;1&#8243; is measured. In the configuration file, the unique adresses of the sensors are listed so you can look them up or change the index of a device.</p>
<h2>Interfacing with SNMP</h2>
<p>To make interfacing with SNMP easy I wrote a script that reads out a sensor based on the index number and returns the temperature:</p>
<pre>#!/bin/bash
# digitemp readout script

CONFFILE=/etc/digitemp/digitemp.conf

digitemp_DS9097 -t $1 -c $CONFFILE  | awk {' print $7'}| tail -n 1</pre>
<p>This script takes the index as an argument and returns the temperature for that sensor, with all the other info stripped off. The <strong>awk</strong> command only prints the 7th column and that is piped to <strong>tail</strong> to only display the line the temperature was displayed on.</p>
<p>To couple this script to SNMP you have to add the following lines to <em>/etc/snmpd.conf</em>:</p>
<pre>extend .1.3.6.1.4.1.2021.2000.1 temp0 /usr/local/bin/checktemp 0
extend .1.3.6.1.4.1.2021.2000.2 temp1 /usr/local/bin/checktemp 1</pre>
<p>Shown here are two scripts coupled to different SNMP OIDs, both returning the script output for one of the connected sensors. <strong>Make sure the SNMP daemon has sufficient rights to access the serial port! </strong>On my Ubuntu 10.04 system I had to add the user &#8220;snmp&#8221; to the group &#8220;dialout&#8221; in the <em>/etc/group</em> file.</p>
<p>To test the scripts coupled to the SNMP OIDs, read them out using snmpwalk:</p>
<pre>snmpwalk -v1 -c public localhost .1.3.6.1.4.1.2021.2000.2</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.1.0 = INTEGER: 1</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.2.5.116.101.109.112.49 = STRING: "/usr/local/bin/checktemp"</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.3.5.116.101.109.112.49 = STRING: "1"</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.4.5.116.101.109.112.49 = ""</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.5.5.116.101.109.112.49 = INTEGER: 5</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.6.5.116.101.109.112.49 = INTEGER: 1</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.7.5.116.101.109.112.49 = INTEGER: 1</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.20.5.116.101.109.112.49 = INTEGER: 4</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.2.1.21.5.116.101.109.112.49 = INTEGER: 1</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.3.1.1.5.116.101.109.112.49 = STRING: "24.25"</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.3.1.2.5.116.101.109.112.49 = STRING: "24.25"</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.3.1.3.5.116.101.109.112.49 = INTEGER: 1</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.3.1.4.5.116.101.109.112.49 = INTEGER: 0</pre>
<pre>UCD-SNMP-MIB::ucdavis.2000.2.4.1.2.5.116.101.109.112.49.1 = STRING: "24.25"</pre>
<pre>End of MIB</pre>
<p>For some reason the output of the script is displayed multiple times. I always use the most unique OID (in this case the last OID on the output) and it seems to work all the time, no problems whatsoever. If SNMP is running and accessible by either the localhost or a remote server running cacti, you can read out the temperature from Cacti.</p>
<h2>Graphing the output in Cacti</h2>
<p>To graph a single temperature in Cacti is quite simple. Generate a new data source using the<em> SNMP -  Generic OID</em> template, fill in the OID and Cacti will poll the data every 5 minutes. To graph the data source, create a graph using the <em>SNMP &#8211; Generic OID</em> graph template. Under <em>Graph Item Fields</em> you can select the data source containing the SNMP data. Save the settings (Cacti could ask for a min and max value, enter something between -20 and 100 ) and the temperature should now be graphed. You can find additional Cacti documentation on this subject <a href="http://www.cacti.net/downloads/docs/html/graph_snmp_oid.html" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.julietmikebravo.nl/index.php/2010/10/04/ds1820-temp-monitoring-using-linux-and-cacti/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Ouderwetse knullige spam</title>
		<link>http://www.julietmikebravo.nl/index.php/2010/01/09/ouderwetse-knullige-spam/</link>
		<comments>http://www.julietmikebravo.nl/index.php/2010/01/09/ouderwetse-knullige-spam/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 13:19:59 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[computers-networking]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.julietmikebravo.nl/?p=570</guid>
		<description><![CDATA[De meeste spam op mijn weblog komt van grootschalige botnetspammers. Het verbaasde mij dan ook enigszins de volgende Nederlandse spam in mijn comments te vinden, compleet met verwijzingen naar een .nl domein: Beste Camera beste-camera.nl NicciBoekestijn@gmail.com 94.215.165.138 Submitted on 2010/01/01 at 11:57pm Normaal reageer ik niet op blogs, maar deze keer wil ik toch even [...]]]></description>
			<content:encoded><![CDATA[<p>De meeste spam op mijn weblog komt van grootschalige botnetspammers. Het verbaasde mij dan ook enigszins de volgende Nederlandse spam in mijn comments te vinden, compleet met verwijzingen naar een .nl domein:</p>
<p><code><br />
Beste Camera<br />
beste-camera.nl<br />
NicciBoekestijn@gmail.com<br />
94.215.165.138<br />
Submitted on 2010/01/01 at 11:57pm<br />
Normaal reageer ik niet op blogs, maar deze keer wil ik toch even aangeven dat het een mooie blog is!</code></p>
<p><span id="more-570"></span></p>
<p>Aangezien het hier een Nederlandse spammer betreft en een .nl domein ben ik maar even gaan neuzen op de Internets. Spam wordt over het algemeen wel redelijk aangepakt in Nederland, reden dus om het een en ander uit te zoeken.</p>
<p>Beste-camera.nl is geregistreerd door ene <strong>Jan van Enk</strong> met email adres <strong>folita.invest@gmail.com</strong><br />
Zoeken op deze info via Google leverde mij de volgende lijst met sites op:</p>
<p><strong>bestetv.info<br />
bestelaptop.info<br />
scooterkopen.info<br />
beste-camera.nl<br />
binnendeur.org<br />
vloertegels.biz<br />
pregnant-women.org</strong></p>
<p>Allemaal geregistreerd onder dezelfde naam, gehost bij Leaseweb, nul echte content,  en bijna allemaal zijn ze ondergeplamuurd met Google Ads meuk en andere referral links zoals bijv. Bol.com in het geval van de website die bij mij gespamd werd.</p>
<p>Nou boeien pagina&#8217;s om klikvee aan te trekken mij niet zo, maar je moet niet op mijn website gaan lopen spammen in de comments. Tijd om even wat abusemail te versturen naar de hoster en de ISP van het IP van de spammert <img src='http://www.julietmikebravo.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Update:</strong></p>
<p>Door opnieuw op de gespamde standaardzin te googelen kwam ik de spammer nogmaals tegen op: http://www.ceome.nl/?p=738 met een link naar <strong>eetkamerstoelen.info</strong>, en nog een keer op http://www.shikake.nl/2009/10/28/kattenluikje-tegen-indringers/ met een link naar de al bekende <strong>beste-camera.nl</strong>.</p>
<p><strong>En nog een update:</strong></p>
<p>Twee nieuwe domeinen gevonden, nl:</p>
<p><strong>zonneschermen.org</strong><br />
<strong>drugs-verslaving.com</strong></p>
<p>Beide weer onder dezelfde naam geregistreerd en gehost bij <a href="http://www.leaseweb.com" target="_blank">Leaseweb</a>, welke het allemaal niet zo erg vinden want na een abusemailtje blijft het doodstil.</p>
<p>Aangezien onze spammer op basis van Google Adsense zijn centjes verdient ga ik die ook maar eens een mailtje sturen. Stay tuned <img src='http://www.julietmikebravo.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>23/02/10:</p>
<p>Jippie, nog een domein:</p>
<p><strong>besteverzekering.net</strong></p>
<p>Google Adsense en Leaseweb vinden het allemaal nog steeds best. Een  dezer dagen nog maar een mailtje de deur uit denk ik&#8230;</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julietmikebravo.nl/index.php/2010/01/09/ouderwetse-knullige-spam/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PPTPD / Ubuntu troubles</title>
		<link>http://www.julietmikebravo.nl/index.php/2009/05/04/pptpd-ubuntu-troubles/</link>
		<comments>http://www.julietmikebravo.nl/index.php/2009/05/04/pptpd-ubuntu-troubles/#comments</comments>
		<pubDate>Mon, 04 May 2009 22:33:30 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[computers-networking]]></category>
		<category><![CDATA[english]]></category>

		<guid isPermaLink="false">http://chelydra.dyndns.org/?p=183</guid>
		<description><![CDATA[Another one in the series &#8220;messing around until I got it right&#8221;&#8230; I wanted to get access to the local network at my parents house to manage computers using remote desktop. Now it is quite simple to tunnel IP traffic over a SSH connection, but I wanted proper access to the network. I just want [...]]]></description>
			<content:encoded><![CDATA[<p>Another one in the series &#8220;messing around until I got it right&#8221;&#8230;</p>
<p>I wanted to get access to the local network at my parents house to manage computers using remote desktop. Now it is quite simple to <a href="http://www.ssh.com/support/documentation/online/ssh/winhelp/32/Tunneling_Explained.html" target="_blank">tunnel IP traffic over a SSH connection</a>, but I wanted proper access to the network. I just want to open <em>mstsc</em> on my own computer, enter the local IP address of the computer I want to access and be able to do my stuff.<span id="more-183"></span></p>
<p>So I installed <a href="http://www.poptop.org/" target="_blank">PPTPD</a> to enable VPN access to the network. Installed it using apt-get and webmin,  setup a PPP account, configured a connection in Windows XP and connected successfully. Tried accessing the webinterface of the modem that connects to the Internet, nothing&#8230; timeout. Curious as I am when it comes to annoying problems I tried accessing the local IP addres of my server. No problem accessing the webserver running this weblog. It seemed that the connection was established properly, but traffic from the client IP address of the PPTP connection was not forwarded to the LAN.</p>
<p>The solution was found after some googling: <a href="http://ubuntuforums.org/showthread.php?t=577734&amp;page=2" target="_blank"><strong>PPTPD: Can&#8217;t access anything but the PPTPD server when connected </strong></a></p>
<p>By editing <em>/etc/sysctl.conf</em> and removing a commenting character:</p>
<p><code># Uncomment the next line to enable packet forwarding for IPv4<br />
net.ipv4.ip_forward=1</code></p>
<p>and issuing the command:</p>
<p><code>/etc/init.d/procps restart</code></p>
<p>IPv4 forwarding is enabled permanently, and traffic from the PPTP client is properly forwarded to the rest of the network.</p>
<p>Thanks Internet and Google, if it weren&#8217;t for you I would have been messing around until the wee hours <img src='http://www.julietmikebravo.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(After finishing this post, I had to mess around for maybe twice the amount of time I put in solving this PPTP issue because of some problem with smileys messing up text on my weblog&#8230;)</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.julietmikebravo.nl/index.php/2009/05/04/pptpd-ubuntu-troubles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco SSH access and bruteforce attempts</title>
		<link>http://www.julietmikebravo.nl/index.php/2009/04/23/cisco-ssh-access-and-bruteforce-attempts/</link>
		<comments>http://www.julietmikebravo.nl/index.php/2009/04/23/cisco-ssh-access-and-bruteforce-attempts/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 18:45:31 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[computers-networking]]></category>
		<category><![CDATA[english]]></category>

		<guid isPermaLink="false">http://chelydra.dyndns.org/?p=155</guid>
		<description><![CDATA[Today I had an annoying attack on my Cisco 851W router. Some (likely) compromised computer in Laos was trying to bruteforce my SSH access wich I have open to the Internet for monitoring purposes. I noticed it because while  there was no traffic going through the router the WAN light was still flashing in a [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had an annoying attack on my Cisco 851W router. Some (likely) compromised computer in Laos was trying to bruteforce my SSH access wich I have open to the Internet for monitoring purposes. I noticed it because while  there was no traffic going through the router the WAN light was still flashing in a steady pace.<span id="more-155"></span></p>
<p>So, I tried to open an SSH session to my router to see what was going on. For some reason the router refused the connection. Since Internet access was fine I suspected that the router was running fine and had not crashed.</p>
<p>I tried logging in a couple of times more and finally I got access to the router. I looked at the logs and saw that the compromised host was being blocked by the <em>sl_def_acl </em>extended access list. This ACL is as follows:</p>
<p><code>Extended IP access list sl_def_acl<br />
10 deny tcp any any eq telnet log<br />
20 deny tcp any any eq www log<br />
30 deny tcp any any eq 22 log (74691 matches)<br />
40 permit tcp any any eq 22 log</code></p>
<p>This access list will be applied to the VTY lines 0 to 4 using the following command which does not refer to any ACL but silently creates the <em>sl_def_acl</em> access list:</p>
<p><code>login block-for 600 attempts 3 within 30</code></p>
<p>So, what basically happens is a malicious host attempts to login through SSH, tries 3 times in 30 seconds, and after that the ACL <em>sl_def_acl</em> is applied to the VTY lines. But this also blocks any host including the local network from accessing the router through SSH. So a bruteforce attack is unintentionally converted into a denial of service attack by the router itself. As long as someone tries to login and fails, you will have difficulty accessing the router from any host on any network. I don&#8217;t want that so I tried to edit the sl_def_acl access list, but due to some bug this is not possible. I had to create a new access list:</p>
<p><code>Extended IP access list block_bruteforce<br />
10 permit ip 192.168.64.0 0.0.0.255 any<br />
20 deny tcp any any eq telnet<br />
30 deny tcp any any eq www<br />
40 deny tcp any any eq 22 log</code></p>
<p>And point the router to the right ACL for blocking bruteforce attempts using:</p>
<p><code>login quiet-mode access-class block_bruteforce</code></p>
<p>Now it is still possible to access the router from my local network while some host on the Internet is trying to access it. It is also possible to permit additional hosts or networks by adding this line to the ACL:</p>
<p><code>permit ip host <em>&lt;host&gt;</em> eq 22 any</code></p>
<p>Of course, the IP of the attacking host was put in my main inbound ACL to prevent any further traffic. My router, my rules&#8230; By the way, the <em>sl_def_acl</em> list could not be removed from the configuration so I had to leave it. Likely this is also related to the bug.</p>
<p>Anyway, this is what I set up to prevent my router to be compromised, comments are always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.julietmikebravo.nl/index.php/2009/04/23/cisco-ssh-access-and-bruteforce-attempts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring the Cisco 851W Ethernet router</title>
		<link>http://www.julietmikebravo.nl/index.php/2008/11/02/configuring-the-cisco-851w-ethernet-router/</link>
		<comments>http://www.julietmikebravo.nl/index.php/2008/11/02/configuring-the-cisco-851w-ethernet-router/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 00:27:32 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[computers-networking]]></category>
		<category><![CDATA[english]]></category>

		<guid isPermaLink="false">http://chelydra.dyndns.org/?p=59</guid>
		<description><![CDATA[A couple of days ago the Cisco 851w router I ordered was delivered. I purchased this device because my old wireless router, a Netgear WGR614v6 was having a hard time with the many NAT entries caused by the increased amount of (wireless) users. I also wanted to increase my experience with configuring Cisco hardware. Some [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago the Cisco 851w router I ordered was delivered. I purchased this device because my old wireless router, a Netgear WGR614v6 was having a hard time with the many NAT entries caused by the increased amount of (wireless) users. I also wanted to increase my experience with configuring Cisco hardware.<span id="more-59"></span></p>
<p>Some months ago I got my CCNA certification, and I was surprised by the low level of knowledge and experience that was needed to pass the exams. I passed the first exam with 948 points and my second one with 825. The last exam was a lot harder, and I realised that I hadn&#8217;t studied topics like dynamic routing protocols enough. Still I passed, because of my general knowledge of networking concepts and experience with calculating subnetting.</p>
<p>Anyway, I decided not to continue studying more Cisco stuff right away, but to get some hands-on experience first, so I bought this device.</p>
<p>The Cisco 851W is a router with a 100Mbit/s Ethernet WAN port. I got an Ethernet router because I wanted to use this router at home with the existing Internet connection. In the house where I live we have an ADSL Internet connection with a subnet of 16 IP adresses. There is no need to configure port forwarding in the modem, it just assigns public IP addresses through DHCP.</p>
<p>It took me some days to properly configure the 851W. I discovered that having a CCNA certificate in no way means that you can configure Cisco devices all by yourself.  Configuration discussed in Cisco study material is often quite basic and focuses on interfaces, not on complete configurations.</p>
<p>Anyway, I found this handy Excel sheet for generating a basic configuration: <a href="http://content.techrepublic.com.com/2346-1035_11-65492-2.html" target="_blank">Configuring the Cisco 851W or 871W: Standard IOS</a>. Using this sheet I got a basic working configuration.</p>
<p>Of course this configuration needed some tweaking. I added and changed the following things:</p>
<p><span style="text-decoration: underline;">Static NAT entries and corresponding firewall rules</span></p>
<p><em><strong>ip nat inside source list 1 interface FastEthernet4 overload<br />
ip nat inside source static tcp 192.168.64.5 5597 interface FastEthernet4 5597<br />
ip nat inside source static tcp 192.168.64.237 5001 interface FastEthernet4 5001<br />
ip nat inside source static tcp 192.168.64.5 3389 interface FastEthernet4 3389<br />
ip nat inside source static tcp 192.168.64.5 8000 interface FastEthernet4 8000<br />
ip nat inside source static tcp 192.168.64.5 38515 interface FastEthernet4 38515<br />
!<br />
ip access-list extended Guest-ACL<br />
deny   ip any 192.168.64.0 0.0.0.255<br />
deny   tcp any any eq smtp<br />
permit tcp any host 217.149.192.18 eq smtp<br />
ip access-list extended Internet-inbound-ACL<br />
permit tcp any any eq 38515<br />
permit tcp any any eq 5597<br />
permit tcp any any eq 5001<br />
permit tcp any any eq 8000<br />
permit tcp any any eq 3389<br />
permit udp any eq bootps any eq bootpc<br />
permit icmp any any echo<br />
permit icmp any any echo-reply<br />
permit icmp any any traceroute<br />
permit gre any any<br />
permit esp any any<br />
permit tcp host 63.208.196.95 any established<br />
!<br />
access-list 1 permit 192.168.64.0 0.0.0.255<br />
access-list 1 permit 192.168.60.0 0.0.0.255</strong><br />
</em></p>
<p>As you can see there are some ports forwarded to my own PC for various software running on it. When entering static NAT entries you have to enter corresponding firewall rules. Dynamic NAT entries seem to overrule the firewall, static entries do not work without firewall rules.</p>
<p>This basic Excel sheet configuration also adds a firewall rule to deny &#8220;Guest&#8221; users access to my own seperate network. They will only &#8220;see&#8221; network 192.168.60.0/24. I added another firewall rule to deny access to any SMTP server except the one from the ISP, to prevent spamming from trojans which is quite likely to happen with the current users of the wireless network. Later I will also add a firewall rule to block any incoming traffic on port 25 because nobody is likely to run a mailserver on this network except for malicious purposes. I also added a firewall rule permitting any traffic from members.dyndns.org, to make Dynamic DNS work properly (more on this later).</p>
<p><span style="text-decoration: underline;">Separate WLANs for house and private use</span></p>
<p><strong><em>dot11 ssid 35bis<br />
vlan 20<br />
authentication open<br />
authentication key-management wpa<br />
guest-mode<br />
wpa-psk ascii 7 *snip*<br />
!<br />
dot11 ssid ruthenium<br />
vlan 1<br />
authentication open<br />
authentication key-management wpa<br />
wpa-psk ascii 7 *snip*</em></strong></p>
<p><strong><em>interface Dot11Radio0<br />
no ip address<br />
no dot11 extension aironet<br />
!<br />
encryption vlan 1 mode ciphers tkip<br />
!<br />
encryption vlan 20 mode ciphers tkip<br />
!<br />
ssid 35bis<br />
!<br />
ssid ruthenium<br />
!<br />
speed basic-1.0 basic-2.0 basic-5.5 6.0 9.0 basic-11.0 12.0 18.0 24.0 36.0 48.0 54.0<br />
channel 2432<br />
station-role root<br />
no cdp enable<br />
!<br />
interface Dot11Radio0.1<br />
encapsulation dot1Q 1 native<br />
bridge-group 1<br />
bridge-group 1 subscriber-loop-control<br />
bridge-group 1 spanning-disabled<br />
bridge-group 1 block-unknown-source<br />
no bridge-group 1 source-learning<br />
no bridge-group 1 unicast-flooding<br />
!<br />
interface Dot11Radio0.20<br />
description Guest wireless LAN &#8211; routed WLAN<br />
encapsulation dot1Q 20<br />
ip address 192.168.60.1 255.255.255.0<br />
ip access-group Guest-ACL in<br />
ip inspect MYFW out<br />
ip nat inside<br />
ip virtual-reassembly<br />
!<br />
interface Vlan1<br />
description Internal Network<br />
no ip address<br />
ip nat inside<br />
ip virtual-reassembly<br />
bridge-group 1<br />
bridge-group 1 spanning-disabled</em></strong></p>
<p>This part of the configuration defines two SSID&#8217;s and two Dot11Radio0 subinterfaces that are attached to respectively Vlan1 and Vlan20. You can also see the access list attached to the Guest VLAN.<br />
One thing I discovered was that Cisco calls broadcasting a SSID &#8220;guest mode&#8221;. On most routers with a wireless interface, only one SSID can be set to guest mode. That means that my own WLAN is not visible, which is only a small annoyance.</p>
<p><span style="text-decoration: underline;">Dynamic DNS configuration</span></p>
<p>Dynamic DNS using Dyndns.org is a little bit hard to setup, but after some googling I got it to work. Following is the configuration used for dynamic dns:</p>
<p><strong><em>ip host members.dyndns.org 63.208.196.95<br />
ip ddns update method myupdate<br />
HTTP<br />
add http://vagevuur:&lt;snip&gt;@members.dyndns.org/nic/update?system=dyndns&amp;hostname=&lt;h&gt;&amp;myip=&lt;a&gt;<br />
remove http://vagevuur:&lt;snip&gt;@members.dyndns.org/nic/update?system=dyndns&amp;hostname=&lt;h&gt;&amp;myip=&lt;a&gt;<br />
interval maximum 28 0 0 0<br />
!</em></strong></p>
<p>To properly setup dynamic DNS you need to add the IP address of <strong><em>members.dyndns.org</em></strong> to the host list, because most routers are not set up to lookup domain names for security reasons. This breaks the dynamic dns settings.<br />
You also have to add a firewall rule that allows the Dyndns site to connect to the routers WAN ip address on any established port. The router does not use NAT to connect to the site, so there are no NAT entries that overrule the firewall. By entering <strong><em>permit tcp host 63.208.196.95 any established</em></strong> in an access list applied to the WAN interface the connection is allowed because the firewall notices that Dyndns connects on the port requested in the outgoing connection.</p>
<p>By the way, entering the <em><strong>add</strong></em> and <em><strong>remove</strong></em> lines can only be done by entering half of the command before the question mark, then pressing <strong>CTRL-V</strong> on your keyboard, entering the question mark, and then the rest of the line. Entering a ? directly will cause the IOS help to appear, which breaks the command.</p>
<p>Well, this concludes my post about configuring my Cisco router. The complete configuration is available for viewing on: <a href="http://chelydra.dyndns.org/static/851wcfg.txt" target="_blank">http://chelydra.dyndns.org/static/851wcfg.txt</a> Enjoy and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.julietmikebravo.nl/index.php/2008/11/02/configuring-the-cisco-851w-ethernet-router/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

