<?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>My brain is here &#187; openwrt</title>
	<atom:link href="http://casa.apertus.es/blog/tag/openwrt/feed/" rel="self" type="application/rss+xml" />
	<link>http://casa.apertus.es/blog</link>
	<description>I hope you like it.</description>
	<lastBuildDate>Tue, 03 Jan 2012 19:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>how to remote syslog using openwrt</title>
		<link>http://casa.apertus.es/blog/2010/11/17/how-to-remote-syslog-using-openwrt/</link>
		<comments>http://casa.apertus.es/blog/2010/11/17/how-to-remote-syslog-using-openwrt/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 22:56:47 +0000</pubDate>
		<dc:creator>Juan Jose Pablos</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://casa.apertus.es/blog/?p=554</guid>
		<description><![CDATA[<p>If you need to keep an eye and history about what is going on on your router enable remote login with this command:</p> <p>echo &#8220;option &#8216;log_ip&#8217; &#8217;192.168.1.2&#8242;&#8221;>> /etc/config/system</p> <p>Change 192.168.1.2 to your server. Then on your server (linux debian as example) check /etc/default/rsyslog and add &#8220;-r&#8221; to the default options. you would start getting [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to keep an eye and history about what is going on on your router enable remote login with this command:</p>
<blockquote><p>echo &#8220;option &#8216;log_ip&#8217; &#8217;192.168.1.2&#8242;&#8221;>> /etc/config/system</p></blockquote>
<p>Change 192.168.1.2 to your server. Then on your server (linux debian as example) check <code>/etc/default/rsyslog</code> and add &#8220;-r&#8221; to the default options. you would start getting messages on your system.<br />
Maybe you need to comment it out on this file /etc/rsyslog.conf those options:<br />
# $ModLoad imudp<br />
# $UDPServerRun 514</p>
]]></content:encoded>
			<wfw:commentRss>http://casa.apertus.es/blog/2010/11/17/how-to-remote-syslog-using-openwrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to keep P2P users out of your network with openwrt</title>
		<link>http://casa.apertus.es/blog/2010/10/29/how-to-keep-p2p-users-out-of-your-network-with-openwrt/</link>
		<comments>http://casa.apertus.es/blog/2010/10/29/how-to-keep-p2p-users-out-of-your-network-with-openwrt/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 16:54:13 +0000</pubDate>
		<dc:creator>Juan Jose Pablos</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://casa.apertus.es/blog/?p=412</guid>
		<description><![CDATA[<p>Say that you have a open wireless network connection and you have some users that use P2P programs to download stuff. The main problem with P2P programs is the number o connections that try to open on the ADSL router so the NAT table gets full pretty quickly. #!/bin/sh # Ban. Add mac to [...]]]></description>
			<content:encoded><![CDATA[<p>Say that you have a open wireless network connection and you have some users that use P2P programs to download stuff. The main problem with P2P programs is the number o connections that try to open on the ADSL router so the NAT table gets full pretty quickly.<br />
<code><br />
#!/bin/sh<br />
# Ban. Add mac to the forward table if the number of connecions get 100</p>
<p>for ip in $(grep "br-lan" /proc/net/arp | awk '{print $1}'); do</p>
<p>cont=$(grep -c "$ip" /proc/net/ip_conntrack);<br />
mac=$(grep "$ip" /proc/net/arp| awk '{print $4}');</p>
<p>if [ "$cont" -gt "100" ] ;then<br />
echo iptables -A forwarding_rule -m mac --mac-source $mac  -j DROP;<br />
fi<br />
logger "$ip $mac $cont";<br />
done<br />
</code><br />
so create a entry on /etc/crontabs/root<br />
<code><br />
# run this script every hour<br />
0,10,20,30,40,50 * * * * /etc/ban &gt; /dev/null<br />
0 * * * * /etc/unban &gt; /dev/null<br />
</code><a href='http://casa.apertus.es/blog/2010/10/29/how-to-keep-p2p-users-out-of-your-network-with-openwrt/ban/' rel='attachment wp-att-660'>ban</a></p>
]]></content:encoded>
			<wfw:commentRss>http://casa.apertus.es/blog/2010/10/29/how-to-keep-p2p-users-out-of-your-network-with-openwrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>unable to change config flash write error OpenWrt</title>
		<link>http://casa.apertus.es/blog/2010/07/31/untable-to-change-config-flash-write-error-openwrt/</link>
		<comments>http://casa.apertus.es/blog/2010/07/31/untable-to-change-config-flash-write-error-openwrt/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 07:17:03 +0000</pubDate>
		<dc:creator>Juan Jose Pablos</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[Router]]></category>

		<guid isPermaLink="false">http://casa.apertus.es/blog/?p=425</guid>
		<description><![CDATA[<p>Just in case you hit a problem if, you are usin 10.03, the router shutdown by an upgrade, power off, whatever&#8230; your partition is read only, and you are not able to modify anything on the router. Login on the console and type dmesg. If complains about</p> Write of 186 bytes at 0x0015a680 failed. [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case you hit a problem if, you are usin 10.03, the router shutdown by an upgrade, power off, whatever&#8230; your partition is read only, and you are not able to modify anything on the router. Login on the console and type <code>dmesg</code>. If complains about</p>
<pre class="wiki">Write of 186 bytes at 0x0015a680 failed. returned -30, retlen 0</pre>
<p>Just type:<br />
<code>mtd unlock rootfs_data</code></p>
<p><a href="https://dev.openwrt.org/ticket/7298">#7298 (Cannot edit files in /etc/config due to flash write error) – OpenWrt</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://casa.apertus.es/blog/2010/07/31/untable-to-change-config-flash-write-error-openwrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitor command line output from openwrt backfire using snmp</title>
		<link>http://casa.apertus.es/blog/2010/07/27/monitor-command-line-output-from-openwrt-backfire-using-snmp/</link>
		<comments>http://casa.apertus.es/blog/2010/07/27/monitor-command-line-output-from-openwrt-backfire-using-snmp/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 08:54:39 +0000</pubDate>
		<dc:creator>Juan Jose Pablos</dc:creator>
				<category><![CDATA[Español]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://casa.apertus.es/blog/?p=377</guid>
		<description><![CDATA[<p>I have been using snmp to monitor Input and Output traffict from my router base on openwrt . but I want to know if if my users have a virus spamer or they use P2P on my network?, how do you find out over the time?. I can run this command any time to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using snmp to monitor Input and Output traffict from my router base on openwrt . but I want to know if <strong>if my  users have a virus spamer or they use P2P on my network?</strong>, how do you find out over the time?. I can run this command any time to find out how many connections there is on the router:<br />
<code>root@OpenWrt:/jffs/etc#  cat /proc/net/ip_conntrack | wc -l<br />
1</code><br />
So far so good, but i want to have historical data that can give me an idea of when the connections go up or down. Here comes the power of SNMP. First we need <strong>iptables-snmp &#8211; An snmpd plugin to access iptables rules</strong>:</p>
<p><code>opkg install iptables-snmp</code></p>
<p>Now we need to created the executable,  I put files under /etc/snmp but it is a matter of taste :<br />
<code>root@OpenWrt:/etc/snmp# cat conntrack-count </code></p>
<blockquote><p>#!/bin/sh<br />
exit `cat /proc/net/ip_conntrack | wc -l`</p></blockquote>
<p>Now this needs to be called from the snmpd daemon. So I added on the configuration file:<br />
<code>/etc/config/snmpd:</code></p>
<blockquote><p>config exec conntrack_count<br />
option execname conntrack_count<br />
option miboid <strong>1.3.6.1.3.19811018.30</strong><br />
option prog &#8216;/etc/snmp/conntrack-count&#8217;</p></blockquote>
<p>Reload the snmp daemon <code>/etc/init.d/snmpd reload</code> (you did install it did nt you? <code>opkg install snmpd</code>). So now if you call <strong>1.3.6.1.3.19811018.30</strong> from a snmp client, you can see the number of connections, I use MRTG to create the graphic.</p>
<blockquote><p>Title[router]: ip_conntrack<br />
Target[router]: <strong>1.3.6.1.3.19811018.30.100.1&amp;1.3.6.1.3.19811018.30.100.1</strong>:public@your.ip:<br />
MaxBytes[router]: 100</p></blockquote>
<p>Here is the output:<br />
<img class="alignnone" src="http://casa.apertus.es/mrtg/tcpcurrestab_calleja-day.png" alt="" width="500" height="135" /></p>
<p>Before you create an exec you maybe check a ready to go snmp variables in this page: <a href="http://glr81.free.fr/pages/openwrt-snmp-oid.htm">SNMP OIDs for OpenWrt</a> and here <a href="http://www.mibdepot.com/cgi-bin/vendor_index.cgi?r=linux">46 SNMP SMIv1 and v2 MIBs ( 10 SMIv1, 36 SMIv2 ) for Linux</a></p>
]]></content:encoded>
			<wfw:commentRss>http://casa.apertus.es/blog/2010/07/27/monitor-command-line-output-from-openwrt-backfire-using-snmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QOS under openwrt 10.03</title>
		<link>http://casa.apertus.es/blog/2010/07/24/qos-under-openwrt-10-03/</link>
		<comments>http://casa.apertus.es/blog/2010/07/24/qos-under-openwrt-10-03/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 14:24:39 +0000</pubDate>
		<dc:creator>Juan Jose Pablos</dc:creator>
				<category><![CDATA[Español]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://casa.apertus.es/blog/?p=369</guid>
		<description><![CDATA[<p>Only a few commands are needed to use Quality Of Service (QOS), just login on theconsole as root@ip.of.router and then: opkg update; opkg install qos-scripts; /etc/init.d/qos enable; /etc/init.d/qos start; You would find the config file under /etc/config/qos, I mostly only modify the download value so I limit the amount of bandwidth that I share [...]]]></description>
			<content:encoded><![CDATA[<p>Only a few commands are needed to use Quality Of Service (QOS),  just login on theconsole as root@ip.of.router and then:<br />
<code><br />
opkg update;<br />
opkg install qos-scripts;<br />
 /etc/init.d/qos enable;<br />
 /etc/init.d/qos start;<br />
</code><br />
You would find the config file under <code>/etc/config/qos</code>, I mostly only modify the download value so I limit the amount of bandwidth that I share with others so they do not collapse my connection. If you want to check that qos is working just run this command <code>qos-stat</code></p>
]]></content:encoded>
			<wfw:commentRss>http://casa.apertus.es/blog/2010/07/24/qos-under-openwrt-10-03/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

