<?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>Projects</title>
	<atom:link href="http://ip6.com/projects/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ip6.com/projects</link>
	<description>Home, Garage and Hangar Project</description>
	<lastBuildDate>Tue, 15 May 2012 14:11:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Nagios and NagVis</title>
		<link>http://ip6.com/projects/?p=569</link>
		<comments>http://ip6.com/projects/?p=569#comments</comments>
		<pubDate>Mon, 07 May 2012 10:08:25 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=569</guid>
		<description><![CDATA[Nagios and NagVis are powerful public domain monitoring tools. Post coming soon! Have fun!]]></description>
			<content:encoded><![CDATA[<p><a title="Nagios" href="http://www.nagios.org/" target="_blank">Nagios</a> and <a title="NagVis" href="http://www.nagvis.org/" target="_blank">NagVis</a> are powerful public domain monitoring tools.</p>
<p>Post coming soon!</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=569</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Radius Server High Availability</title>
		<link>http://ip6.com/projects/?p=557</link>
		<comments>http://ip6.com/projects/?p=557#comments</comments>
		<pubDate>Sat, 21 Apr 2012 18:43:10 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=557</guid>
		<description><![CDATA[In a previous post I explained how to obtain high availability using RSTP and VRRP. When you run VRRP between two servers, VRRP creates a VIP (Virtual IP) address that is impersonated by one of the two servers (the one &#8230; <a href="http://ip6.com/projects/?p=557">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In a <a title="High Availability with RSTP and VRRP" href="http://ip6.com/projects/?p=501">previous post</a> I explained how to obtain high availability using RSTP and VRRP. When you run VRRP between two servers, VRRP creates a VIP (Virtual IP) address that is impersonated by one of the two servers (the one with the highest VRRP priority). If that server fails, the other server takes over the VIP. This works well for many protocols like HTTP, SSH, FTP, etc. and with some attention it can be used for DHCP, but I was not able to use it with the <a title="FreeRadius Server" href="http://ip6.com/projects/?p=336">freeradius server</a>. The reason is that by default the freeradius server receives packets on the VIP, but it sends the reply using the real IP address of the interface. Many Radius clients get confused and discard the reply.</p>
<p><span id="more-557"></span>Reading the <a title="Freeradius FAQ" href="http://wiki.freeradius.org/FAQ" target="_blank">freeradius documentation</a> there is a standard fix to this issue:</p>
<p>I<em>t may happen that the server does not respond with the right source ip address. Thus the client will likely ignore the server&#8217;s response. On Linux and FreeBSD you can solve this by specifying ./configure &#8211;with-udpfromto during compilation.</em></p>
<p>Unfortunately I was not in the position to recompile the code, since I use a specific version provided by a commercial company.</p>
<p>In the attempt to solve this issues I have tried many approach including:</p>
<ul>
<li>iptables on the radius server &#8211; Trying to NAT the physical IP address to the VIP. It works fine for all the other protocols, but not with Radius. I am suspicious that Radius interface the protocol stack below the IP tables</li>
<li>creating an extra loopback interface on the server and routing the frame to it. It works, but again Radius replies with the physical address</li>
</ul>
<p>If someone have more ideas please send them to me.</p>
<p>Eventually I discovered that the <a title="Mikrotik Routers" href="http://ip6.com/projects/?p=459" target="_blank">Mikrotik Routers</a> that I use support defining a secondary radius server, that is used only if the query to the primary radius servers timesouts, something like:</p>
<pre>&gt; radius print
Flags: X - disabled
 #   SERVICE  CALLED-ID  DOMAIN  ADDRESS         SECRET                      
 0   ppp                         10.49.49.205    xxxyyy                   
 1   ppp                         10.49.49.206    xxxyyy</pre>
<p>Where 10.49.49.205 is the primary server and 206 is the backup server.</p>
<p>Sometime the simpler solutions are the more effective !</p>
<p>Have fun!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=557</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ethernet errors &#8211; full/half duplex negotiation</title>
		<link>http://ip6.com/projects/?p=538</link>
		<comments>http://ip6.com/projects/?p=538#comments</comments>
		<pubDate>Tue, 03 Apr 2012 18:13:54 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=538</guid>
		<description><![CDATA[It seems that sometime one of my Ethernet card does not come up correctly and it starts to get a lot of CRCs and other errors. Tried to swap card, cable and switch port with no success, so it must &#8230; <a href="http://ip6.com/projects/?p=538">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It seems that sometime one of my Ethernet card does not come up correctly and it starts to get a lot of CRCs and other errors. Tried to swap card, cable and switch port with no success, so it must not be an hardware issue.</p>
<p><span id="more-538"></span></p>
<p><span style="color: #ff0000;"><strong>Warning: I am going to upgrade drivers/kernel module. This can make your system unusable. You have been warned, now. No responsibility is assumed for anything at all.</strong></span></p>
<p>First you want to be sure of what is installed in your system, Type:</p>
<pre>lspci -vv</pre>
<p>From there you get the driver name. To have more info on the driver (e.g. assuming driver name is igb):</p>
<pre>modinfo igb</pre>
<p>I started to browse around and discovered <a title="Ethtool" href="http://en.wikipedia.org/wiki/Ethtool" target="_blank">ethtool</a>. It was installed by default on my CentOS system, but you can also download it from <a title="ethtool kernel.org" href="http://www.kernel.org/pub/software/network/ethtool/" target="_blank">here</a>.</p>
<p>with it you can have a closer look at how your card is configured:</p>
<pre>ethtool eth0</pre>
<p>at the errors</p>
<pre>ethtool -S eth0</pre>
<p>and see what driver version it runs</p>
<pre>ethtool -i eth0</pre>
<p>If you have a very old driver version, it is probably a good idea to upgrade it. I have an Intel card and I started <a title="Intel Drivers" href="http://http://downloadmirror.intel.com/9180/eng/README.txt" target="_blank">here</a>.</p>
<p>The process is in four steps</p>
<ol>
<li>download the kit and unpack it (e.g. wget, untar)</li>
<li>build it (e.g. make install)</li>
<li>remove the old driver (e.g. rmmod e1000e)</li>
<li>install the new driver (e.g. modprobe e1000e)</li>
</ol>
<p>Read the README file that is contained in your driver kit. When you are done reboot and check the result with:</p>
<pre>ethtool -i eth0</pre>
<p>If the problem has not disappeared, as in my case <img src='http://ip6.com/projects/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> , you may want to start force some parameters with ethtool. A good guide is <a title="Ethernet Duplex Mismatch" href="http://noahdavids.org/self_published/duplex_mismatch.html" target="_blank">here</a>.</p>
<p>My issue was that the switch port was set to full-duplex and the server port was set to autonegotiate. This is not a valid configuration. I decided to  set everything full duplex at 1 Gb/s with this command:</p>
<pre>ethtool -s eth3 speed 100 autoneg off duplex full</pre>
<p>That solved the issue.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=538</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux High Availability with RSTP and VRRP</title>
		<link>http://ip6.com/projects/?p=501</link>
		<comments>http://ip6.com/projects/?p=501#comments</comments>
		<pubDate>Wed, 28 Mar 2012 01:04:20 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=501</guid>
		<description><![CDATA[If you have an host that is important in your network, you want to connect it to two different network switches, so that if a switch/link goes down your host is still accessible. When you have a service that is &#8230; <a href="http://ip6.com/projects/?p=501">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have an host that is important in your network, you want to connect it to two different network switches, so that if a switch/link goes down your host is still accessible. When you have a service that is very important in your network, you want to run it in two hosts and assign to them a &#8220;virtual IP address&#8221;. In this post I will try both at the same time.</p>
<p><span id="more-501"></span>There are several <a title="Link Aggregation" href="http://en.wikipedia.org/wiki/Link_aggregation" target="_blank">link-aggregation techniques</a> that are possible, probably the best known being <a title="Bonding" href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding" target="_blank">Bonding</a> on Unix and NIC-teaming on Windows.</p>
<p>Following the recommendation of my friend <a title="Piero Nicoletti" href="http://www.studioreti.it/azienda/Nicoletti.html" target="_blank">Piero</a> I went a different path, I used <a title="Bridging" href="http://en.wikipedia.org/wiki/Bridging_%28networking%29" target="_blank">bridging</a>.</p>
<p><span style="color: #ff0000;"><strong>DISCLAIMER: don&#8217;t attempt this on a production network! Folks who have seen a Spanning Tree loop don&#8217;t want to see a second one! Test on a small separate testing environment and be ready for packet storms, network crashes, server crashes, etc.! You have been warned, now. No responsibility is assumed for anything at all.</strong></span></p>
<p><strong>1) Bridging with STP</strong></p>
<p>Piero sent me this synthetic, but complete description of what to do on a generic server:</p>
<pre>ifconfig eth0 0.0.0.0
ifconfig eth3 0.0.0.0
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth3
brctl stp br0 on
ifconfig br0  up
ifconfig br0 10.49.48.205 netmask 255.255.255.0</pre>
<p>There are some excellent tutorials on bridging in Linux, for example:</p>
<ul>
<li><a title="Linux Bridging HowTo" href="http://www.tldp.org/HOWTO/Ethernet-Bridge-netfilter-HOWTO-3.html#ss3.1" target="_blank">http://www.tldp.org/HOWTO/Ethernet-Bridge-netfilter-HOWTO-3.html#ss3.1</a></li>
<li><a title="Linux Bridging" href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge" target="_blank">http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge</a></li>
</ul>
<p>The first thing is to draw the network diagram of what you are trying to achieve:<a href="http://ip6.com/projects/wp-content/uploads/2012/03/rstp1.jpg"><img class="aligncenter size-medium wp-image-511" title="rstp" src="http://ip6.com/projects/wp-content/uploads/2012/03/rstp1-300x129.jpg" alt="" width="300" height="129" /></a>This is an example of a config file for server-2</p>
<pre>#!/bin/bash
PATH="/sbin:/usr/sbin:/usr/local/sbin";
cmd="$1";
[ -z "$cmd" ] &amp;&amp; cmd="start";
case "$cmd" in
  start)
    brctl addbr br0;
    brctl stp br0 on;
    brctl setbridgeprio br0 40960; ### We don't want to be route
    brctl addif br0 eth0;
    brctl addif br0 eth3;
    brctl setportprio br0 eth3 100; ### by defaukt we want to bock eth3
    ifconfig eth0 down;
    ifconfig eth3 down;
    ifconfig eth0 0.0.0.0 up;
    ifconfig eth3 0.0.0.0 up;
    ifconfig br0 10.49.48.206 netmask 255.255.255.0 up
    route add default gw 10.49.48.209;
    echo "nameserver 10.49.48.210" &gt; /etc/resolv.conf
    echo "nameserver 10.49.48.211" &gt;&gt; /etc/resolv.conf
    ;;
  stop)
    brctl delif br0 eth0;
    brctl delif br0 eth3;
    ifconfig br0 down;
    brctl delbr br0;
    ifup eth0;
    echo "nameserver 10.49.48.210" &gt; /etc/resolv.conf
    echo "nameserver 10.49.48.211" &gt;&gt; /etc/resolv.conf
    ;;
  restart)
    $0 stop;
    sleep 3;
    $0 start;
    ;;
  status)
        route
        ;;
  *)
	echo "Usage: bridge-rstp {start|stop|restart|status}"
	exit 1
	;;
esac;</pre>
<p>A cleaner way to do this can be achieved in two steps. First create using the GUI a network interface named br0 and assign there the IP address, netmask, the default gateway, and nameservers. The file in CentOS will be called <em>/etc/sysconfig/network-scripts/ifcfg-br0</em>.These files are read by a service called NetworkManager.</p>
<p>At this point you can simplify the previous script to something like</p>
<pre>#!/bin/bash
PATH="/sbin:/usr/sbin:/usr/local/sbin";
cmd="$1";
[ -z "$cmd" ] &amp;&amp; cmd="start";
case "$cmd" in
  start)
    brctl addbr br0;
    brctl stp br0 on;
    brctl setbridgeprio br0 40960; ### We don't want to be route
    brctl addif br0 eth0;
    brctl addif br0 eth3;
    brctl setportprio br0 eth3 100; ### by default we want to bock eth3
    ifconfig eth0 down;
    ifconfig eth3 down;
    ifconfig eth0 0.0.0.0 up;
    ifconfig eth3 0.0.0.0 up;
    ifuo br0;
    ;;
  stop)
    brctl delif br0 eth0;
    brctl delif br0 eth3;
    ifconfig br0 down;
    brctl delbr br0;
    ifup eth0;
    ;;
  restart,reload)
    $0 stop;
    sleep 3;
    $0 start;
    ;;
  status)
        route
        ;;
  *)
	echo "Usage: bridge-rstp {start|stop|restart|status}"
	exit 1
	;;
esac;</pre>
<p>You can further simplify the script and at the end get rid of it if you use <a title="bridge-utils" href="http://web.iesrodeira.com/cgi-bin/man/man2html?bridge-utils-interfaces+5" target="_blank">bridge-utils.</a>  I haven&#8217;t tested it, but my understanding is that bridge-utils move all the bridge configuration inside the file <em>/etc/sysconfig/network-scripts/ifcfg-br0</em>.</p>
<p>I haven&#8217;t tested it! and as a matter of fact I went the opposite direction and removed deinstalled NetworkManager</p>
<pre># yum delete NetworkManager</pre>
<p>This works, it is robust and it has a convergence time of around 30 seconds, to which you will need to add the convergence time of VRRP (see note at the end of this post) for a total of approximately 1 minute. Probably good enough in most cases.</p>
<p><strong>2) Bridging with RSTP</strong></p>
<p><strong></strong>At this point I decided to do something that I rarely do: improve Piero&#8217;s solution. It is the same, but with<a title="RSTP" href="http://en.wikipedia.org/wiki/Rapid_Spanning_Tree_Protocol#Rapid_Spanning_Tree_Protocol_.28RSTP.29" target="_blank"> RSTP (Rapid STP)</a> instead of STP. The goal is to reduce the convergence time to few seconds.</p>
<p><em>Warning: don&#8217;t attempt this if not all your bridges are configured with RSTP. Use wireshark to verify that there are no classical STP BPDUs on the network.</em></p>
<p>I searched extensively in March 2012 and found reference to the possibility that in the future RSTP will be supported in the kernel, but I was not able to find any kernel implementation. So I decided to use a user space implementation available in the Fedora repository and I installed it on CentOS.</p>
<p>If you run Fedora, it should be pretty simple, just do:</p>
<pre>yum install rstp</pre>
<p>For your reference this is the <a title="Fedora RSTP" href="http://pkgs.org/fedora-rawhide/fedora-i386/rstp-04012009git-7.fc17.i686.rpm.html" target="_blank"> Fedora repository</a>.</p>
<p>There are two <strong>alternative</strong> way you can do this in CentOS, since CentOS uses a slightly older version of glibc and I don&#8217;t think it is wise trying to upgrade glibc that is a crucial library.</p>
<p><em>a) either download an earlier version of rstp</em></p>
<p><a href="http://rpm.pbone.net/index.php3/stat/4/idpl/15479839/dir/fedora_14/com/rstp-04012009git-4.fc14.i686.rpm.html">http://rpm.pbone.net/index.php3/stat/4/idpl/15479839/dir/fedora_14/com/rstp-04012009git-4.fc14.i686.rpm.html</a></p>
<p>and install the rpm with:</p>
<pre>rpm -i <a href="http://rpm.pbone.net/index.php3/stat/4/idpl/15479839/dir/fedora_14/com/rstp-04012009git-4.fc14.i686.rpm.html">rstp-04012009git-4.fc14.i686.rpm.html</a></pre>
<p><em>b) or download the source code and recompile</em></p>
<p>The source code is at:<br />
<a href="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/source/SRPMS/r/rstp-04012009git-7.fc17.src.rpm">http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/source/SRPMS/r/rstp-04012009git-7.fc17.src.rpm</a></p>
<p>You will need to apply the two patches contained in the root directory before recompiling.</p>
<pre>patch &lt; rstp-type-punning.patch
patch &lt; rstp-unused-fix.patch
make
make install</pre>
<p>After installing you will need to understand how to enable RSTP instead of STP.</p>
<p>Unfortunately the software only documentation is reading this email thread starting at: <a title="rstpd thread" href="http://www.mail-archive.com/bridge@lists.linux-foundation.org/msg00432.html" target="_blank">http://www.mail-archive.com/bridge@lists.linux-foundation.org/msg00432.html</a></p>
<p>The key point in understanding the role of the file <em><strong>/sbin/bridge-stp</strong></em></p>
<p>From the previous email thread:</p>
<pre>When you do "brctl stp &lt;bridge_name&gt; on", the kernel runs
"/sbin/bridge-stp &lt;bridge_name&gt; start" and waits for the exit code. If
the exit code is 0, the kernel sets stp_state to 2, and assumes that
userspace will take care of STP and does not do any STP actions. (This
state is different from STP disabled, since during STP disabled, the
kernel still brings up ports from learning to forwarding using a
timeout, and also, the bridge forwards BPDUs too in that state.) If
the exit code is non-zero, stp_state is set to 1 and kernel STP is
activated.</pre>
<p>Depending on how you installed the software /sbin/bridge-stp may be present or not, but I highly recommend to replace it with this simple file.</p>
<pre>  #!/bin/bash
  exit 0</pre>
<p>Remember</p>
<pre>chmod 755 /sbin/bridge-stp</pre>
<p>At this point you have disabled STP in the kernel and created the condition to use RSTP in user space. Now you need to start things in the correct order, I used this script (name it bridge-rstp)</p>
<pre>#!/bin/bash
#set -x
#
### BEGIN INIT INFO
# Provides: RSTP
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog d
# Default-Stop: 0 1 6
# Short-Description: Reconfigure the ports to support bridging and RSTP
# Description: RSTP has faster convergence than STP
### END INIT INFO
#
PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/bin";
cmd="$1";
[ -z "$cmd" ] &amp;&amp; cmd="start";
case "$cmd" in
  start)
    brctl addbr br0;
    brctl addif br0 eth0;
    brctl addif br0 eth3;
    brctl stp br0 on;
    ifconfig eth0 down;
    ifconfig eth3 down;
    ifconfig eth0 0.0.0.0 up;
    ifconfig eth3 0.0.0.0 up;
    ifconfig br0 10.49.48.206 netmask 255.255.255.0 up;
    route add default gw 10.49.48.209;
    rstpd
    rstpctl rstp br0 on
    rstpctl setbridgeprio br0 40960
    rstpctl setportpathcost br0 eth3 40000
    echo "nameserver 10.49.48.209" &gt; /etc/resolv.conf
    ;;
  stop)
    route del default
    ifconfig br0 down
    rstpctl rstp br0 off
    brctl delif br0 eth0;
    brctl delif br0 eth3;
    brctl delbr br0;
    killall -9 rstpd
    ifconfig eth0 10.49.48.206 netmask 255.255.255.0 up;
    route add default gw 10.49.48.209;
    echo "nameserver 10.49.48.209" &gt; /etc/resolv.conf
    ;;
  restart,reload)
    $0 stop;
    sleep 3;
    $0 start;
    ;;
  status)
	ps ax | grep rstpd
        rstpctl showport br0
        route
        ;;
  *)
	echo "Usage: bridge-rstp {start|stop|restart|status}"
	exit 1
	;;
esac;</pre>
<p>Try multiple time</p>
<pre>./bridge-rstp start
./bridge-rstp stp</pre>
<p>After starting rstp check it with commands like</p>
<pre>rstpctl showport br0</pre>
<p>Be careful that NetworkManager is running in the backgroud and may try to manipulate interfaces that you are using for bridging. NetworkManager reads the files in /ets/sysconfig/network-scripts, you may want to erase the one that you don&#8217;t need at boot or at least edit them and set boot=off. As I told you before I removed NetworkManager</p>
<p>If you are satisfied by the result achieved, you can make it permanent:</p>
<pre>cp bridge-stp /etc/init.d/bridge-rstp
chown root:root /etc/init.d/bridge-rstp
chmod 755 /etc/init.d/bridge-rstp
chkconfig --add bridge-rstp
chkconfig bridge-rstp on</pre>
<p>From this point on it will automatically start at boot. You can start and stop it manually with:</p>
<pre>service bridge-rstp start
service bridge-rstp stop</pre>
<p>Since reliability is very important for me, I decided to run a 5 hours RSTP stress test on my servers by bringing up and down interfaces continuously. I used this perl script.</p>
<pre>#!/usr/bin/perl -w
use strict;
use warnings;
#
# This script brings up and down the interfaces in a bridge group
# to stress test RSTP
#
# Set these parameters correctly
#
my @interfaces = ("eth0", "eth3");
my $maxpostdelay = 10; # in seconds
my $maxdowndelay = 10; # in seconds
my $interactions = 1800;
#
# variables used by the script
#
my $interface;
my $downdelay;
my $postdelay;
#
 open LOG, "&gt;", "rstp.log" or die $!;
 print LOG "RSTP stress test started at: ";
 print LOG localtime() ."\n";
 while ($interactions) {
   $downdelay=int(rand($maxdowndelay));
   $postdelay=int(rand($maxpostdelay));
   $interface=$interfaces[int(rand(@interfaces))];
   print LOG localtime() ." - ";
   print LOG "Interface = $interface - Down = $downdelay - Post = $postdelay\n";
   print LOG "$interactions interacions to go - " . localtime() ." - Interface $interface down\n";
   print "\n---------------------------------------------\n";
   print "$interactions interacions to go - " . localtime() ." - Interface $interface down\n\n";
   system("ifconfig $interface down");
   system("ifconfig $interface");
   sleep ($downdelay);
   system("rstpctl showport br0");
   print "\n";
   print LOG localtime() ." - Interface $interface up\n";
   system("ifconfig $interface up");
   system("ifconfig $interface");
   sleep ($postdelay);
   system("rstpctl showport br0");
   $interactions--;
 }
close LOG;</pre>
<p>During this test and other tests done manually I noticed that the worst case was a 5 seconds convergence time, with many cases in which the convergence time was subsecond. This implies that in most cases not a single ping was lost!</p>
<p><strong>3) VRRP</strong></p>
<p>The next step is to get a VIP (Virtual IP) address, using <a title="VRRP" href="http://en.wikipedia.org/wiki/VRRP" target="_blank">VRRP (Virtual Router Redundancy Protocol)</a>: don&#8217;t get confused, even if VRRP has &#8220;Router&#8221; in its name, it can be used on hosts.</p>
<p><span style="color: #ff0000;"><strong>Be careful, firewalls on the hosts like to drop VRRP frames, be sure that it is not happening.</strong></span></p>
<p><span style="color: #000000;">Unfortunately VRRP does not run on TCP or UDP, but directly over IP, so you cannot simply open a TCP/UDP port. Test with the firewall disable, when it works close the firewall and add to your IPTABLES something like:</span></p>
<pre> iptables -I INPUT -p vrrp -j ACCEPT</pre>
<p>You can do it in bridge-rstp immediately before starting VRRP.</p>
<p>You can see the result by typing:</p>
<pre>iptables --list -v</pre>
<p>There are also discussion on how to do this at:</p>
<ul>
<li><a title="VRRP and IPTABLES" href="http://archive.linuxvirtualserver.org/html/lvs-users/2006-10/msg00021.html" target="_blank">http://archive.linuxvirtualserver.org/html/lvs-users/2006-10/msg00021.html</a></li>
<li><a title="VRRP and IPTABLES" href="http://www.cyberciti.biz/faq/linux-unix-verify-keepalived-working-or-not/" target="_blank">http://www.cyberciti.biz/faq/linux-unix-verify-keepalived-working-or-not/</a></li>
</ul>
<p>There are implementations of VRRP available at <a title="VRRP sourceforce" href="http://sourceforge.net/projects/vrrpd/" target="_blank">sourceforce</a> and at <a title="VRRPD" href="http://off.net/~jme/vrrpd/" target="_blank">http://off.net/~jme/vrrpd/</a>. I was able to use  the sourceforce implementation over an ethernet interface with a command like:</p>
<pre>vrrpd -i eth0 -v 2 -p 200 10.49.48.2</pre>
<p>which start vrrpd over eth0, on group 2, with priority 200 and VIP = 10.49.48.2.</p>
<p>Unfortunately, I was not able to make it work on a bridge interface like br0. So i decided to go another path and installed <a title="Keepalived" href="http://www.keepalived.org/ " target="_blank">keepalived</a> that comes precompiled for CentOS.</p>
<pre># yum install keepalived</pre>
<p>Keepalived is a very powerful package that contains many things, I just enabled only VRRP following the instruction <a title="VRRP with keepalived" href="http://www.cyberciti.biz/faq/rhel-centos-fedora-keepalived-lvs-cluster-configuration/ " target="_blank">contained here.</a></p>
<p>I edited the file /etc/keepalived/keepalived.conf to look like:</p>
<pre>! Configuration File for keepalived

vrrp_instance VI_1 {
    state MASTER
    interface br0
    virtual_router_id 10
    priority 200
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1234
    }
    virtual_ipaddress {
        10.49.48.2/24
    }
}</pre>
<p>On the backup server use state BACKUP and priority 100.</p>
<p>At the end I put all together in /etc/init.d/bridge-rstp</p>
<div lang="x-unicode">
<pre>#!/bin/bash
#set -x
#
### BEGIN INIT INFO
# Provides: RSTP
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog d
# Default-Stop: 0 1 6
# Short-Description: Reconfigure the ports to support bridging and RSTP
# Description: RSTP has faster convergence than STP
### END INIT INFO
#
PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/bin";
cmd="$1";
[ -z "$cmd" ] &amp;&amp; cmd="start";
case "$cmd" in
  start)
    brctl addbr br0;
    brctl addif br0 eth0;
    brctl addif br0 eth3;
    brctl stp br0 on;
    ifconfig eth0 down;
    ifconfig eth3 down;
    ifconfig eth0 0.0.0.0 up;
    ifconfig eth3 0.0.0.0 up;
    ifconfig br0 10.49.48.205 netmask 255.255.255.0 up;
    rstpd
    rstpctl rstp br0 on
    rstpctl setbridgeprio br0 40960
    rstpctl setportpathcost br0 eth3 40000
    route add default gw 10.49.48.208;
    iptables -I INPUT -p vrrp -j ACCEPT
    service keepalived start
    echo "nameserver 10.49.48.208" &gt; /etc/resolv.conf
    ;;
  stop)
    service keepalived stop
    route del default
    ifconfig br0 down;
    rstpctl rstp br0 off
    brctl delif br0 eth1;
    brctl delif br0 eth3;
    brctl delbr br0;
    killall -9 rstpd
    ifconfig eth0 10.49.48.205 netmask 255.255.255.0 up;
    route add default gw 10.49.48.208;
    echo "nameserver 10.49.48.208" &gt; /etc/resolv.conf
     ;;
  restart)
    $0 stop;
    sleep 3;
    $0 start;
    ;;
  status)
	ps ax | grep rstpd
        rstpctl showport br0
        route
        ;;
  *)
	echo "Usage: bridge-rstp {start|stop|restart|status}"
	exit 1
	;;
esac;</pre>
</div>
<p>Piero also warned me that I need to slow down the convergence of VRRP to let the<a title="Spanning Tree Protocol" href="http://en.wikipedia.org/wiki/Spanning_tree_protocol" target="_blank"> STP (Spanning Tree Protocol) </a>converge first (otherwise both servers can become VRRP masters in the transient ;-( ). not so much an issue if you use RSTP,  but classical STP takes 50 seconds to converge! So you will need to increase the convergence time of VRRP to let STP converge first. With RSTP the convergence was fast enough that I used the default timers of VRRP.</p>
<p>This is left for you to experiment <img src='http://ip6.com/projects/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=501</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DOCSIS for dummies</title>
		<link>http://ip6.com/projects/?p=484</link>
		<comments>http://ip6.com/projects/?p=484#comments</comments>
		<pubDate>Sun, 25 Mar 2012 16:48:07 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=484</guid>
		<description><![CDATA[like me A good DOCSIS description is on Wikipedia Good pointers are: DOCSIS (Data Over Cable Service Interface Specification) docsis.org cablelabs Docsis components: cable modem (CM) cable modem termination system (CMTS) the customer PC and associated peripherals are termed Customer-premises &#8230; <a href="http://ip6.com/projects/?p=484">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>like me <img src='http://ip6.com/projects/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<div>
<p>A good DOCSIS description is on <a title="DOCSIS" href="http://en.wikipedia.org/wiki/DOCSIS" target="_blank">Wikipedia</a></p>
<p><span id="more-484"></span></p>
<p>Good pointers are:</p>
<ul>
<li><a title="DOCSIS" href="http://www.tech-faq.com/docsis.html" target="_blank">DOCSIS (Data Over Cable Service Interface Specification)</a></li>
<li><a title="docsis.org" href="http://docsis.org/" target="_blank">docsis.org</a></li>
<li><a title="Cablelabs" href="http://www.cablelabs.com/cablemodem/" target="_blank">cablelabs</a></li>
</ul>
<p>Docsis components:</p>
<ul>
<li><a title="Cable modem" href="http://en.wikipedia.org/wiki/Cable_modem">cable modem</a> (CM)</li>
<li><a title="Cable modem termination system" href="http://en.wikipedia.org/wiki/Cable_modem_termination_system">cable modem termination system</a> (CMTS)</li>
<li>the customer PC and associated peripherals are termed <a title="Customer-premises equipment" href="http://en.wikipedia.org/wiki/Customer-premises_equipment">Customer-premises equipment</a> (CPE)</li>
<li>Multimedia Terminal Adapter (<strong>MTA</strong>) to provide Voice-over-IP services</li>
</ul>
<p><a title="Docsis Example" href="http://docsis.org/node/221" target="_blank">Example of configuration</a></p>
<p>Example of CM config files and tools:</p>
<ul>
<li><a title="The Docsis utility" href="http://docsis.sourceforge.net/" target="_blank">The Docsis utility</a></li>
<li><a title="Docsis - Many useful pointers" href="http://bradyvolpe.com/document_library/" target="_blank">Many useful pointers</a></li>
<li><a title="Docsis - Creating DOCSIS Cable modem configuration files" href="http://www.cmtsinfo.net/index.php?howto=cm_config" target="_blank">Creating DOCSIS Cable modem configuration files</a></li>
<li><a title="Docsis configuration file format" href="http://src.gnu-darwin.org/ports/net-mgmt/docsis/work/docsis-0.9.5/doc/config-format.html" target="_blank">Docsis configuration file format </a></li>
<li><a title="Example of config file" href="http://docsis.sourceforge.net/examples/modem.cfg" target="_blank">Example of config file</a></li>
<li><a title="Config File Editor" href="http://www.excentis.com/product.php?product_id=7" target="_blank">Config File Editor</a></li>
</ul>
<p>For CATV frequencies here is a <a title="CATV frequency table" href="http://www.jneuhaus.com/fccindex/cablech.html" target="_blank">frequency table</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=484</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My favorite network tools</title>
		<link>http://ip6.com/projects/?p=482</link>
		<comments>http://ip6.com/projects/?p=482#comments</comments>
		<pubDate>Sun, 25 Mar 2012 16:43:45 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=482</guid>
		<description><![CDATA[Any &#8220;favorite network tool list&#8221; starts with Wireshark. The importance of this tool cannot be underestimated, since it has made network analysis available to everybody. To use wireshark efficiently you need to use capture filters: it is very easy to &#8230; <a href="http://ip6.com/projects/?p=482">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Any &#8220;favorite network tool list&#8221; starts with <a title="Wireshark" href="http://www.wireshark.org/" target="_blank">Wireshark</a>. The importance of this tool cannot be underestimated, since it has made network analysis available to everybody. To use wireshark efficiently you need to use <a title="Wireshark Capture filters" href="http://wiki.wireshark.org/CaptureFilters" target="_blank">capture filters</a>: it is very easy to get overloaded with traffic without capture filters. <span id="more-482"></span></p>
<p>A close second is <a title="NTOP" href="http://www.ntop.org/" target="_blank">NTOP</a>. You probably haven&#8217;t heard about this tool developed by my friend Luca Deri: it is a gem in the rough! It is a traffic analysis tool which provides you a more high level view of what is going on in your networks, which are the most used protocols, who consumes more bandwidth, is it there any BitTorent  traffic? I cannot recommend more this tools. Luca also develops other network tools that you will find on his <a title="NTOP" href="http://www.ntop.org/" target="_blank">website</a>.</p>
<p>In third place i have <a title="fping" href="http://fping.sourceforge.net/" target="_blank">fping</a>. fping is a program to ping host in parallel. It is very useful when you want to understand which hosts are active on a particular subnet. You can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying one host until it timeouts or replies, fping will send out a ping packet and move on to the next host in a round-robin fashion.</p>
<p>In fourth place I rank <a title="DNSBench" href="http://www.grc.com/dns/benchmark.htm" target="_blank">DNSBench</a>. One of the reasons of slow internet surfing is that we pick the wrong DNS server. DNSBench runs a survey of all the DNS servers and help you pick the most responsive one. Program them into your home router and all your hosts will benefit from this.</p>
<p>In fifth place I have <a title="snmpwalk" href="http://net-snmp.sourceforge.net/docs/man/snmpwalk.html" target="_blank">snmpwalk</a>. snmpwalk is an SNMP application that uses SNMP GETNEXT requests to query a network entity for a tree of information. For example you can type</p>
<pre> snmpwalk 192.168.0.231 -v 1 -c public .1</pre>
<p>and discover which OIDs are supported by the device 192.168.0.231.</p>
<p>When you have discoverted the OIDs, you can use my sixth place application <a title="MIB Browser" href="http://ireasoning.com/mibbrowser.shtml" target="_blank">MIB Browser </a>from iReasoning. If you work with SNMP, MIB Browser is a must. It will help you walk any MIB and read/set any parameter. It is very usefull for studying which parameters are worth monitoring through an SNMP tool like <a title="Nagios" href="http://ip6.com/projects/?p=569">Nagios</a>.</p>
<p>In the final place a tool that my friend <a title="Piero Nicoletti" href="http://www.studioreti.it/azienda/Nicoletti.html" target="_blank">Piero</a> recently recommended: <a title="gftp" href="http://www.gftp.org/" target="_blank">GFTP</a>. I haven&#8217;t yet tested it, but there is no guy I trust more than Piero when it comes to troubleshooting computer networks. I must admit that <a title="FileZilla" href="http://filezilla-project.org" target="_blank">FileZilla</a> is a valid alternative.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=482</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Backup or Cloning?</title>
		<link>http://ip6.com/projects/?p=471</link>
		<comments>http://ip6.com/projects/?p=471#comments</comments>
		<pubDate>Sun, 25 Mar 2012 14:12:00 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=471</guid>
		<description><![CDATA[I am almost done installing my CentOS servers (see previous post) and I want to backup them. So I call my friend Dinesh who is a true Linux expert and he recommends Déjà Dup. This software comes standard with many &#8230; <a href="http://ip6.com/projects/?p=471">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am almost done installing my CentOS servers (see previous post) and I want to backup them. So I call my friend Dinesh who is a true Linux expert and he recommends <a title="Deja Dup" href="https://launchpad.net/deja-dup" target="_blank">Déjà Dup.</a> <span id="more-471"></span>This software comes standard with many Linux distribution and it has a ton of nice feature that you can read on the previous link. It is based on <a title="Duplicity" href="http://duplicity.nongnu.org/" target="_blank">Duplicity</a> that uses the <a title="Rsync" href="http://en.wikipedia.org/wiki/Rsync" target="_blank">rsync algorithm</a>, a pillar of file and directory synchronization.</p>
<p>I am happy, I trust my friend Dinesh, but then I ask the question: &#8220;so if my boot disk fails I can restore it from the backup?&#8221;</p>
<p>Well to turn a long story short the answer is NO! Dinesh explains me that if I want to do that I need a cloning software, also called &#8220;bare metal backup&#8221;.Backup software like <a title="Deja Dup" href="https://launchpad.net/deja-dup" target="_blank">Déjà Dup </a>are good for backing up user data (very important application), not system files.</p>
<p>The original cloning software in Linux was &#8220;<a title="DD" href="http://en.wikipedia.org/wiki/Dd_%28Unix%29" target="_blank">dd</a>&#8220;. dd can be used to copy regions of raw device files, for example backing up the <a title="Boot sector" href="http://en.wikipedia.org/wiki/Boot_sector">boot sector</a> of a <a title="Hard disk" href="http://en.wikipedia.org/wiki/Hard_disk">hard disk</a>. The disadvantage of dd is that it copies also unused space. <a title="Partclone" href="http://partclone.org/" target="_blank">Partclone</a> on the other hand understand the file system structure and it is capable of cloning only used blocks.</p>
<p>It turns out that there are mini linux system that you can install on a USB key and that contain partclone and other tools.</p>
<ul>
<li><a title="SystemRescueCD" href="http://www.sysresccd.org" target="_blank">SystemRescueCD</a></li>
<li><a title="RedoBackup" href="http://redobackup.org/" target="_blank">RedoBackup</a></li>
<li><a title="CloneZilla" href="http://clonezilla.org/" target="_blank">CloneZilla</a></li>
<li><a title="RIP" href="http://www.tux.org/pub/people/kent-robotti/looplinux/rip/" target="_blank">RIP</a></li>
</ul>
<p>after some playing around I decided for <a title="RedoBackup" href="http://redobackup.org/" target="_blank">RedoBackup</a> and I have been very happy I have used it to backup Linux and Windows XP servers. It has all the tools I need.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=471</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mikrotik programming: part 2</title>
		<link>http://ip6.com/projects/?p=464</link>
		<comments>http://ip6.com/projects/?p=464#comments</comments>
		<pubDate>Sun, 25 Mar 2012 01:56:22 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Mikrotik]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=464</guid>
		<description><![CDATA[I covered the basic aspects of Mikrotik programming in this other post. Here I am going to cover additional aspects. If you need to enable routing, I recommend using OSPF, only the backbone area. There is an example on how &#8230; <a href="http://ip6.com/projects/?p=464">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I covered the basic aspects of Mikrotik programming in <a title="Introduction to Mikrotik programming" href="http://ip6.com/projects/?p=371">this other post</a>. Here I am going to cover additional aspects.</p>
<p><span id="more-464"></span>If you need to enable routing, I recommend using OSPF, only the backbone area. There is an example on how to do this <a title="Mikrotik OSPF Example" href="http://wiki.mikrotik.com/wiki/Manual:OSPF-examples" target="_blank">here</a>. The full description on how to program OSPF can be found <a title="Mikrotik OSPF" href="http://wiki.mikrotik.com/wiki/Manual:Routing/OSPF" target="_blank">here</a>.</p>
<p>If you need VRRP to have a stable default gateway for the host, it is pretty simple to program it following <a title="VRRP Example" href="http://wiki.mikrotik.com/wiki/VRRP-examples" target="_blank">this instructions</a>. Just be very careful that if you have a bridge interface, for example, because you want to run spanning tree, you need to enable VRRP on the bridge interface. Let&#8217;s assume you have created bridge1 over ether2-master-local. You need to enable VRRP on bridge1 and not on ether2-master-local. If you make a mistake you will get an I &#8211; Invalid Flag. In this case, the best thing is to remove the interfaces and recreate them correctly.</p>
<p>In general it is good to create two VRRP groups and have one active on a router and one active on the other, for example on router 1</p>
<pre>/int vrrp print                                       
Flags: X - disabled, I - invalid, R - running, M - master, B - backup
 #     NAME                INTERFACE                MAC-ADDRESS       VRID PRIORITY INTERVAL             VERSION V3-PROTOCOL
 0  RM vrrp208             bridge1                  00:00:5E:00:01:D0  208      200 1s                   3       ipv4       
 1   B vrrp209             bridge1                  00:00:5E:00:01:D1  209      100 1s                   3       ipv4</pre>
<p>and on router 2</p>
<pre>/int vrrp print                                      
Flags: X - disabled, I - invalid, R - running, M - master, B - backup
 #     NAME              INTERFACE             MAC-ADDRESS       VRID PRIORITY INTERVAL             VERSION V3-PROTOCOL
 0   B vrrp208           bridge1               00:00:5E:00:01:D0  208      100 1s                   3       ipv4       
 1  RM vrrp209           bridge1               00:00:5E:00:01:D1  209      200 1s                   3       ipv4</pre>
<p>Another thing I had to do was to monitor my NAT. I used:</p>
<pre># ip firewall nat print all stats</pre>
<p>&nbsp;</p>
<p>The next thing is t check which packages are installed and active and the software release. You can do that with:</p>
<pre>/ system package print
Flags: X - disabled
 #   NAME                                           VERSION                                          SCHEDULED              
 0   system                                         5.14                                                                    
 1   gps                                            5.14                                                                    
 2   advanced-tools                                 5.14                                                                    
 3   security                                       5.14                                                                    
 4 X ipv6                                           5.14                                                                    
 5   ntp                                            5.14                                                                    
 6   dhcp                                           5.14                                                                    
 7   calea                                          5.14                                                                    
 8   hotspot                                        5.14                                                                    
 9   lcd                                            5.14                                                                    
10 X mpls                                           5.14                                                                    
11   ppp                                            5.14                                                                    
12   user-manager                                   5.14                                                                    
13   routing                                        5.14                                                                    
14   multicast                                      5.14                                                                    
15   ups                                            5.14                                                                    
16   routerboard                                    5.14                                                                    
17 X wireless                                       5.14</pre>
<p>The content of the package is discussed <a title="Mikrotik Packages" href="http://wiki.mikrotik.com/wiki/Manual:System/Packages" target="_blank">here</a>.</p>
<p>You can enable and disable packages using:</p>
<pre>/system package enable
/system package disable</pre>
<p>You may also want to check if your router is eligible for a free upgrade, by typing:</p>
<pre>/system license print</pre>
<p>the <em>upgradable-to:</em> field will tell you the highest release you can upgrade to.  Read more <a title="Mikrotik License" href="http://wiki.mikrotik.com/wiki/License_allows" target="_blank">here</a>.</p>
<p>If you decide to upgrade follow one of <a title="Upgrading RouterOS" href="http://wiki.mikrotik.com/wiki/Manual:Upgrading_RouterOS" target="_blank">these methods</a>. I successfully used ftp.</p>
<p>Have fun !</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=464</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Wonderful Mikotik RB750/GL</title>
		<link>http://ip6.com/projects/?p=459</link>
		<comments>http://ip6.com/projects/?p=459#comments</comments>
		<pubDate>Fri, 23 Mar 2012 17:51:40 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[Mikrotik]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=459</guid>
		<description><![CDATA[The first time I used a Mikrotik RB750/GL I thought: &#8220;just another box with a four port switch and a two port router, what&#8217;s the big deal!&#8221; Then I started to use it seriously and I understood that it has &#8230; <a href="http://ip6.com/projects/?p=459">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The first time I used a <a title="RB750/GL" href="http://routerboard.com/RB750GL" target="_blank">Mikrotik RB750/GL</a> I thought: &#8220;just another box with a four port switch and a two port router, what&#8217;s the big deal!&#8221;</p>
<p><span id="more-459"></span></p>
<p>Then I started to use it seriously and I understood that it has on operating system that is very complete and that supports all the network feature that I need, from Radius to PPPoE, from conntrack, to NAT, OSPF, DHCP/client/relay/server, etc. I have a <a title="Introduction to Mikrotik programming" href="http://ip6.com/projects/?p=371">previous post t</a>hat explain how to program many features.</p>
<p>Still I was stuck with the four port switch and not being able to have a router, for example, with 3 or 4 ports. Then I read <a title="Mikrotik Switch Chip features" href="http://wiki.mikrotik.com/wiki/Manual:Switch_Chip_Features" target="_blank">this post</a>. As you can see the RB750/GL uses the <a title="Atheros 8327" href="http://www.qca.qualcomm.com/technology/brand.php?brand=5&amp;product=102" target="_blank">Atheros 8327</a> which allows to program the ports as bridged ports or routed ports.</p>
<p>The four port switch that comes standard with the RB750/GL is just a default configuration, not the only one, other are possible.</p>
<p>I started to play with my RB750/GL trying to transform port 5 from a bridged port to a routed port.</p>
<p>I started exploring with commands like:</p>
<pre>/interface ethernet switch print
/interface ethernet print</pre>
<p>then I took the courage and did</p>
<pre>/interface ethernet set master-port=none name=ether5-routed                  
/interface ethernet  print                                
Flags: X - disabled, R - running, S - slave
 #    NAME                                              MTU MAC-ADDRESS       ARP        MASTER-PORT                                          SWITCH                                         
 0 R  ether1-gateway                                   1500 00:0C:42:E6:90:A6 enabled    none                                                 switch1                                        
 1    ether2-master-local                              1500 00:0C:42:E6:90:A7 enabled    none                                                 switch1                                        
 2  S ether3-slave-local                               1500 00:0C:42:E6:90:A8 enabled    ether2-master-local                                  switch1                                        
 3  S ether4-slave-local                               1500 00:0C:42:E6:90:A9 enabled    ether2-master-local                                  switch1                                        
 4    ether5-routed                                    1500 00:0C:42:E6:90:AA enabled    none                                                 switch1</pre>
<p>and then decided to assign ether5-routed an IP address</p>
<pre>/ip address add address=10.49.47.210/24 interface=ether5-routed
/ip add print                                                   
Flags: X - disabled, I - invalid, D - dynamic
 #   ADDRESS            NETWORK         INTERFACE                                                                                                                                            
 0   10.49.49.211/24    10.49.49.0      ether2-master-local                                                                                                                                  
 1   12.0.64.211/24     12.0.64.0       ether1-gateway                                                                                                                                       
 2   12.0.64.205/32     12.0.64.205     ether1-gateway                                                                                                                                       
 3   12.0.64.206/32     12.0.64.206     ether1-gateway                                                                                                                                       
 4   10.255.255.1/32    10.255.255.1    loopback                                                                                                                                             
 5   10.49.47.210/24    10.49.47.0      ether5-routed</pre>
<p>Now, if you want, you can repeat the process for ether4-slave-local and ether3-slave-local.</p>
<p>Good Luck and Have fun !</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=459</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some notes on installing php</title>
		<link>http://ip6.com/projects/?p=455</link>
		<comments>http://ip6.com/projects/?p=455#comments</comments>
		<pubDate>Wed, 21 Mar 2012 01:28:06 +0000</pubDate>
		<dc:creator>Silvano</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://ip6.com/projects/?p=455</guid>
		<description><![CDATA[After my last installation of php on Centos, my apache log (/var/log/httpd/error_log) was full of:  PHP Warning: It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. &#8230; <a href="http://ip6.com/projects/?p=455">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After my last installation of php on Centos, my apache log (/var/log/httpd/error_log) was full of:</p>
<p><em> PHP Warning: It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected &#8216;America/Los_Angeles&#8217; for &#8216;PDT/-7.0/DST</em></p>
<p><span id="more-455"></span>To fix this I edited the file <em>/etc/php.in</em>i and changed the following line, fixing also my coordinates at the same time:</p>
<pre>[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = "America/Los_Angeles"

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-latitude
date.default_latitude = 37.8388

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-longitude
date.default_longitude = -120.2308</pre>
]]></content:encoded>
			<wfw:commentRss>http://ip6.com/projects/?feed=rss2&#038;p=455</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

