<?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>Linux 360° &#124; Italia &#187; mikrotik</title>
	<atom:link href="http://www.linux360.it/tag/mikrotik-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linux360.it</link>
	<description>Notizie, guide e tutorial per il mondo Linux a 360°</description>
	<lastBuildDate>Tue, 16 Dec 2014 14:03:33 +0000</lastBuildDate>
	<language>it-IT</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>DHCP Options: Rotte Statiche via DHCP</title>
		<link>http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/</link>
		<comments>http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/#comments</comments>
		<pubDate>Tue, 16 Dec 2014 09:15:48 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Vari]]></category>
		<category><![CDATA[121]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[pfsense]]></category>
		<category><![CDATA[rotte]]></category>
		<category><![CDATA[statiche]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=2051</guid>
		<description><![CDATA[<p>Ciao Ragazzi, oggi andiamo sull&#8217;avanzato. Tutti conoscono il DHCP e cosa fa un DHCP Server, ma pochi sanno che tramite DHCP si possono passare altre informazioni agli utenti che si collegano. In diversi casi, specie in grandi aziende, con molte subnet diverse, è necessario passare delle rotte statiche ai client che si collegano in automatico: ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/">DHCP Options: Rotte Statiche via DHCP</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>oggi andiamo sull&#8217;avanzato. Tutti conoscono il DHCP e cosa fa un DHCP Server, ma pochi sanno che tramite DHCP si possono passare altre informazioni agli utenti che si collegano.</p>
<p>In diversi casi, specie in grandi aziende, con molte subnet diverse, è necessario passare delle rotte statiche ai client che si collegano in automatico: questo per semplificare l&#8217;aggiunta di rotte statiche sui pc degli utenti.</p>
<p>Per lavoro utilizzo molto due strumenti che permettono l&#8217;inserimento di queste opzioni, ma che sono leggermente diversi tra loro.</p>
<p>Il primo è PfSense, uno dei migliori firewall open source presenti in circolazione.</p>
<p>Il secondo è Mikrotik.</p>
<p>Analizziamoli:</p>
<p><strong>1) PfSense</strong></p>
<p>Su PfSense è possibile definire due tipi di rotte statiche via DHCP:</p>
<ul>
<li>Single route (<a href="http://www.networksorcery.com/enp/protocol/bootp/option033.htm">DHCP Option 33</a>)</li>
<li>Classless Static Route (<a href="http://tools.ietf.org/html/rfc3442">DHCP Option 121</a>)</li>
</ul>
<p>Nel primo caso si definisce solo l&#8217;IP di destinazione ed il Gateway come nella figura:</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-33_2.png"><img class="alignnone  wp-image-2052" src="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-33_2.png" alt="pfsense-dhcp-option-33_2" width="558" height="114" /></a></p>
<p>Il valore Esadecimale è calcolato in questo modo:</p>
<ul>
<li>IP Destinazione: 192.168.123.234 (Hex: C0:A8:7B:EA)</li>
<li>IP Gateway: 10.34.72.42 (Hex: 0A:22:48:2A)</li>
</ul>
<p>Quindi il valore da inserire sulla PFSense sarà: <strong>C0:A8:7B:EA:0A:22:48:2A</strong></p>
<p>Nel secondo caso, si definisce IP destinazione, Subnet Mask e Gateway:</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-121.png"><img class="alignnone  wp-image-2053" src="http://www.paolodaniele.it/wp-content/uploads/2014/12/pfsense-dhcp-option-121.png" alt="pfsense-dhcp-option-121" width="556" height="112" /></a></p>
<p>Come si nota anche dall&#8217;immagine, la differenza è che il valore che precede tutto è la conversione in Hex della netmask.</p>
<ul>
<li>IP Destinazione: 192.168.123.234 (Hex: C0:A8:7B:EA)</li>
<li>IP Gateway: 10.34.72.42 (Hex: 0A:22:48:2A)</li>
<li>Netmask: 24 (Hex: 18)</li>
</ul>
<p>Quindi il valore da inserire sulla PFSense sarà: <strong>18:C0:A8:7B:EA:0A:22:48:2A</strong></p>
<p>&nbsp;</p>
<p><strong>2) Mikrotik</strong></p>
<p>Sui dispositivi Mikrotik, a partire dalla versione <strong>6.00 </strong>(prima non funziona correttamente) è possibile impostare le rotte statiche via DHCP, utilizzando il seguente formato:</p>
<p>0xnnddddddddgggggggg</p>
<p>Dove:</p>
<ul>
<li>nn = Netmask</li>
<li>dddddddd = IP Destinazione</li>
<li>gggggggg = IP Gateway</li>
</ul>
<p>Quindi per aggiungere la regola di esempio precedente dovremmo eseguire:</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip dhcp<span class="sy0">-</span>server option add name<span class="sy0">=</span>classlessroutes code<span class="sy0">=</span><span class="nu0">121</span> value<span class="sy0">=</span>0x18C0A87BEA0A22482A</pre></div></div>
<p>&nbsp;</p>
<p>Per semplificare la vita a chi non ha &#8220;voglia&#8221; di fare le conversioni ho realizzato un piccolo tool in Java che permette di effettuare la conversione direttamente per il tipo di sistema desiderato.</p>
<p>Da questo <a href="http://we.tl/A3ofi5t96Y">link</a> è possibile scaricare il programma da eseguire semplicemente con:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">java <span class="re5">-jar</span> frank.jar</pre></div></div>
<p>Il programma ovviamente si chiama come l&#8217;amico che mi ha dato l&#8217;idea di realizzarlo!</p>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/">DHCP Options: Rotte Statiche via DHCP</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/12/16/dhcp-options-rotte-statiche-via-dhcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mikrotik Site to Site IPsec VPN</title>
		<link>http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/</link>
		<comments>http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/#comments</comments>
		<pubDate>Mon, 20 Oct 2014 08:45:34 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Wireless & Networking]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=2005</guid>
		<description><![CDATA[<p>Ciao Ragazzi, dopo qualche giorno di pausa si ritorna alla carica! Oggi vi spiego come mettere su una VPN tra due siti che utilizzano come punto di accesso alla rete. Una VPN (Virtual Private Network) è una rete che permette a due punti, connessi ad internet, distanti fisicamente tra loro di apparire come se fossero ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/">Mikrotik Site to Site IPsec VPN</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>dopo qualche giorno di pausa si ritorna alla carica!</p>
<p>Oggi vi spiego come mettere su una VPN tra due siti che utilizzano come punto di accesso alla rete.</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/10/mikrotik_vpn.jpg"><img class="alignnone wp-image-2008" src="http://www.paolodaniele.it/wp-content/uploads/2014/10/mikrotik_vpn.jpg" alt="mikrotik_vpn" width="725" height="279" /></a></p>
<p>Una <strong>VPN</strong> (Virtual Private Network) è una rete che permette a due punti, connessi ad internet, distanti fisicamente tra loro di apparire come se fossero sulla stessa rete fisica.</p>
<p>Generalmente questo tipo di tunnel viene cifrato per evitare lo &#8220;sniffing&#8221; dei pacchetti dalla rete.</p>
<p>Esistono diversi sistemi per realizzare VPN sui dispositivi Mikrotik ognuno con vantaggi e svantaggi, ma quello più diffuso è sicuramente IPSec.</p>
<p>Nella figura sopra possiamo vedere come le due rete private abbiano indirizzi ip di classi diverse, <strong>192.168.1.0/24</strong> e <strong>192.168.2.0/24</strong> questo <strong>non è fondamentale ma è preferibile</strong> per evitare conflitti IP tra le due sedi remote.</p>
<p>Gli indirizzi 1.1.1.1 e 2.2.2.2 sono invece gli IP Pubblici con i quali le due sedi &#8220;escono&#8221; su Internet.</p>
<p>Quello che dobbiamo configurare principalmente sono 3 cose:</p>
<p>- Policy IPSec;</p>
<p>- Peers IPSec;</p>
<p>- NAT Firewall per permettere il passaggio dei pacchetti</p>
<p>Iniziamo!</p>
<p><strong> SITO 1</strong></p>
<p>IP Pubblico: 1.1.1.1</p>
<p>IP privato: 192.168.1.0/24</p>
<p>Configurazione Indirizzi IP:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip address
add address<span class="sy0">=</span>192.168.1.1<span class="sy0">/</span><span class="nu0">24</span> interface<span class="sy0">=</span>ether1<span class="sy0">-</span>local network<span class="sy0">=</span>192.168.1.0</pre></div></div>
<p>Aggiungiamo le regole di NAT per permettere il traffico VPN da e verso le antenne:</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip firewall nat
add chain<span class="sy0">=</span>srcnat comment<span class="sy0">=</span><span class="st0">&quot;Nat Bypass VPN&quot;</span> dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span>
add action<span class="sy0">=</span>masquerade chain<span class="sy0">=</span>srcnat out<span class="sy0">-</span>interface<span class="sy0">=</span>pppoe<span class="sy0">-</span>out1</pre></div></div>
<p>&nbsp;</p>
<p>Come avrete notato come dst-address ho usato una <strong>/16</strong> questo perchè le due subnet sono differenti, quindi così sono sicuro di inglobare entrambe.</p>
<p>Fatto questo possiamo creare il tunnell VPN con IPSec:</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip ipsec peer
add address<span class="sy0">=</span>2.2.2.2<span class="sy0">/</span><span class="nu0">32</span> dpd<span class="sy0">-</span>interval<span class="sy0">=</span>disable<span class="sy0">-</span>dpd enc<span class="sy0">-</span>algorithm<span class="sy0">=</span>3des hash<span class="sy0">-</span>algorithm<span class="sy0">=</span>md5 nat<span class="sy0">-</span>traversal<span class="sy0">=</span>no secret<span class="sy0">=!</span>mys3cr3t
&nbsp;
<span class="sy0">/</span>ip ipsec policy
add dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span> sa<span class="sy0">-</span>dst<span class="sy0">-</span>address<span class="sy0">=</span>2.2.2.2 sa<span class="sy0">-</span>src<span class="sy0">-</span>address<span class="sy0">=</span>1.1.1.1 src<span class="sy0">-</span>address<span class="sy0">=</span>192.168.1.0<span class="sy0">/</span><span class="nu0">24</span> tunnel<span class="sy0">=</span>yes</pre></div></div>
<p>Per il Sito 1 abbiamo finito&#8230;passiamo al Sito 2</p>
<p><strong>SITO 2</strong></p>
<p>IP Pubblico: 2.2.2.2</p>
<p>IP privato: 192.168.2.0/24</p>
<p>Configurazione Indirizzi IP:</p>
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip address
add address<span class="sy0">=</span>192.168.2.1<span class="sy0">/</span><span class="nu0">24</span> interface<span class="sy0">=</span>ether1<span class="sy0">-</span>local network<span class="sy0">=</span>192.168.2.0</pre></div></div>
<p>Aggiungiamo le regole di NAT per permettere il traffico VPN da e verso le antenne:</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip firewall nat
add chain<span class="sy0">=</span>srcnat comment<span class="sy0">=</span><span class="st0">&quot;Nat Bypass VPN&quot;</span> dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span>
add action<span class="sy0">=</span>masquerade chain<span class="sy0">=</span>srcnat out<span class="sy0">-</span>interface<span class="sy0">=</span>pppoe<span class="sy0">-</span>out1</pre></div></div>
<p>Anche per il Sito 2 come dst-address ho usato una <strong>/16</strong> questo perchè le due subnet sono differenti, quindi così sono sicuro di inglobare entrambe.</p>
<p>Fatto questo possiamo creare il tunnell VPN con IPSec:</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="sy0">/</span>ip ipsec peer
add address<span class="sy0">=</span>1.1.1.1<span class="sy0">/</span><span class="nu0">32</span> dpd<span class="sy0">-</span>interval<span class="sy0">=</span>disable<span class="sy0">-</span>dpd enc<span class="sy0">-</span>algorithm<span class="sy0">=</span>3des hash<span class="sy0">-</span>algorithm<span class="sy0">=</span>md5 nat<span class="sy0">-</span>traversal<span class="sy0">=</span>no secret<span class="sy0">=!</span>mys3cr3t
&nbsp;
<span class="sy0">/</span>ip ipsec policy
add dst<span class="sy0">-</span>address<span class="sy0">=</span>192.168.0.0<span class="sy0">/</span><span class="nu0">16</span> sa<span class="sy0">-</span>dst<span class="sy0">-</span>address<span class="sy0">=</span>1.1.1.1 sa<span class="sy0">-</span>src<span class="sy0">-</span>address<span class="sy0">=</span>2.2.2.2 src<span class="sy0">-</span>address<span class="sy0">=</span>192.168.2.0<span class="sy0">/</span><span class="nu0">24</span> tunnel<span class="sy0">=</span>yes</pre></div></div>
<p>Il gioco è fatto!</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/">Mikrotik Site to Site IPsec VPN</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/10/20/mikrotik-site-to-site-ipsec-vpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mikrotik Scripting: Evitare cadute Asterisk causate da Failover</title>
		<link>http://www.linux360.it/2014/06/25/mikrotik-scripting-evitare-cadute-asterisk-causate-failover/</link>
		<comments>http://www.linux360.it/2014/06/25/mikrotik-scripting-evitare-cadute-asterisk-causate-failover/#comments</comments>
		<pubDate>Wed, 25 Jun 2014 15:06:11 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[routerOS]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1914</guid>
		<description><![CDATA[<p>Ciao Ragazzi, oggi vi mostro alcuni trucchi di scripting Mikrotik! Supponiamo di avere 2 Connessioni internet (es. due gestori diversi per avere banda ridondata) e un dispositivo Mikrotik che gestisce il failover, ossia quando cade la primaria effettua in automatico lo switch sulla secondaria. Fino a qua non ci sono problemi. Cosa succede se abbiamo ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/06/25/mikrotik-scripting-evitare-cadute-asterisk-causate-failover/">Mikrotik Scripting: Evitare cadute Asterisk causate da Failover</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ciao Ragazzi,</p>
<p>oggi vi mostro alcuni trucchi di scripting Mikrotik!</p>
<p>Supponiamo di avere 2 Connessioni internet (es. due gestori diversi per avere banda ridondata) e un dispositivo Mikrotik che gestisce il failover, ossia quando cade la primaria effettua in automatico lo switch sulla secondaria.</p>
<p>Fino a qua non ci sono problemi. Cosa succede se abbiamo un centralino VoIP con Asterisk.</p>
<p>Se cade la connessione primaria e switchamo sulla secondaria, si verifica il problema che le connessioni voip rimangono appese sulla primaria e quindi il problema persiste perchè non funziona la parte telefonica anche se la connessione c&#8217;è.</p>
<p>Come risolvere questo problema?</p>
<p>Andiamo a programmare!!</p>
<p>Per prima cosa vi spiego l&#8217;idea alla base dello script.</p>
<p>Periodicamente effettuiamo un check ping su due indirizzi ip (ovviamente su due reti geografiche diverse). Se il ping è ok non succede niente, il sistema continua a funzionare.</p>
<p>Quando entrambi i ping falliscono, vuol dire che abbiamo perso la connessione primaria (es. Adsl down, problemi in centrale e robe simili): questo fa da trigger al nostro script!</p>
<p>Il primo script, che chiameremo &#8220;Check Script&#8221;, disabilità l&#8217;interfaccia primaria (quella down per capirci) e ci manda una mail indicando il problema e su quale apparato è avvenuto.</p>
<p>Dopo 3 secondi riavvia il router.</p>
<p>Al riavvio entra in funzione il secondo script, che chiameremo &#8220;Restart Script&#8221;, che dopo 10 sec (il tempo necessario a far ripartire totalmente il device) controlla se l&#8217;interfaccia primaria è ritornata funzionante (es. se uno riavvia il router per qualunque motivo non è che deve ogni volta disabilitare/abilitare le interfacce di rete!)</p>
<p>Se è disabilitata e non è ritornata su, allora le viene assegnata priorità/distanza 3 (quindi l&#8217;interfaccia secondaria diventa la Master) e la riabilita per provare a vedere se è ritornata attiva.</p>
<p>Se i ping sono apposto cambia la distanza a 1 e torna tutto come prima, se i ping falliscono allora la connessione rimane up sulla interfaccia secondaria.</p>
<p>Sotto questo scenario le chiamate voip, tranne per il breve momento necessario al riavvio della Mikrotik, continueranno a funzionare!</p>
<p>Ecco i due script:</p>
<p><strong>CHECK SCRIPT</strong></p>
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;">:global strDate <span class="br0">[</span><span class="sy0">/</span>system clock get date<span class="br0">]</span>
:global strTime <span class="br0">[</span><span class="sy0">/</span>system clock get time<span class="br0">]</span>
:global strSystemName <span class="br0">[</span><span class="sy0">/</span>system identity get name<span class="br0">]</span>
&nbsp;
&nbsp;
:<span class="kw3">if</span> <span class="br0">&#40;</span><span class="br0">[</span><span class="sy0">/</span>ping 10.104.7.187 interface<span class="sy0">=</span>pppoe<span class="sy0">-</span>out1 count<span class="sy0">=</span><span class="nu0">5</span><span class="br0">]</span> <span class="sy0">=</span> <span class="nu0">0</span> <span class="sy0">&amp;&amp;</span> <span class="br0">[</span><span class="sy0">/</span>ping 8.8.4.4 interface<span class="sy0">=</span>pppoe<span class="sy0">-</span>out1 count<span class="sy0">=</span><span class="nu0">5</span><span class="br0">]</span> <span class="sy0">=</span> <span class="nu0">0</span> <span class="sy0">&amp;&amp;</span> <span class="br0">[</span><span class="sy0">/</span>ip route get <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> disabled<span class="br0">]</span><span class="sy0">=</span>false<span class="br0">&#41;</span> <span class="kw3">do</span><span class="sy0">=</span><span class="br0">&#123;</span>
    :log info <span class="st0">&quot;Disabling Primary&quot;</span>;
    <span class="sy0">/</span>ip route <span class="kw2">set</span> <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> disabled<span class="sy0">=</span>yes
    <span class="sy0">/</span>tool e<span class="sy0">-</span>mail send from<span class="sy0">=</span><span class="st0">&quot;yyyyy@gmail.com&quot;</span> to<span class="sy0">=</span><span class="st0">&quot;xxxx@gmail.com&quot;</span> subject<span class="sy0">=</span><span class="st0">&quot;Route Failover - $strDate $strTime - $strSystemName&quot;</span> body<span class="sy0">=</span><span class="st0">&quot;Failover to Telecom occurred at $strDate $strTime on $strSystemName&quot;</span>
    :delay 3
    <span class="sy0">/</span>system reboot
&nbsp;
<span class="br0">&#125;</span> <span class="kw3">else</span><span class="sy0">=</span> <span class="br0">&#123;</span>
    :log info <span class="st0">&quot;No Failover Necessary&quot;</span>;
<span class="br0">&#125;</span></pre></div></div>
<p>&nbsp;</p>
<p><strong>RESTART SCRIPT</strong></p>
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;">:delay <span class="nu0">10</span>;
:<span class="kw3">if</span> <span class="br0">&#40;</span><span class="br0">[</span><span class="sy0">/</span>ip route get <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> disabled<span class="br0">]</span><span class="sy0">=</span>true<span class="br0">&#41;</span> <span class="kw3">do</span><span class="sy0">=</span><span class="br0">&#123;</span>
    <span class="sy0">/</span>interface ethernet <span class="kw2">set</span> numbers<span class="sy0">=</span>4 disabled<span class="sy0">=</span>no
   
     <span class="sy0">/</span>ip route <span class="kw2">set</span> <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> disabled<span class="sy0">=</span>no
     <span class="sy0">/</span>ip route <span class="kw2">set</span> <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> distance<span class="sy0">=</span>3
    :delay 10
    :<span class="kw3">if</span> <span class="br0">&#40;</span><span class="br0">[</span><span class="sy0">/</span>ping 10.104.7.187 routing<span class="sy0">-</span>table<span class="sy0">=</span>Primary count<span class="sy0">=</span>5<span class="br0">]</span> <span class="sy0">&gt;</span> 0 <span class="sy0">&amp;&amp;</span> <span class="br0">[</span><span class="sy0">/</span>ping 8.8.4.4 routing<span class="sy0">-</span>table<span class="sy0">=</span>Primary count<span class="sy0">=</span>5<span class="br0">]</span> <span class="sy0">&gt;</span> 0<span class="br0">&#41;</span> <span class="kw3">do</span><span class="sy0">=</span><span class="br0">&#123;</span>
&nbsp;
       <span class="sy0">/</span>ip route <span class="kw2">set</span> <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> distance<span class="sy0">=</span>1
       <span class="sy0">/</span>system reboot
    <span class="br0">&#125;</span>
     <span class="kw3">else</span><span class="sy0">=</span> <span class="br0">&#123;</span>
       
        <span class="sy0">/</span>ip route <span class="kw2">set</span> <span class="br0">[</span>find comment<span class="sy0">=</span><span class="st0">&quot;Primary&quot;</span><span class="br0">]</span> distance<span class="sy0">=</span>3
&nbsp;
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span> <span class="kw3">else</span><span class="sy0">=</span> <span class="br0">&#123;</span>
    :log info <span class="st0">&quot;No Failover Necessary&quot;</span>;
<span class="br0">&#125;</span></pre></div></div>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/06/25/mikrotik-scripting-evitare-cadute-asterisk-causate-failover/">Mikrotik Scripting: Evitare cadute Asterisk causate da Failover</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/06/25/mikrotik-scripting-evitare-cadute-asterisk-causate-failover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurazione Punto &#8211; Punto WDS Mikrotik</title>
		<link>http://www.linux360.it/2014/05/21/configurazione-punto-punto-wds-mikrotik/</link>
		<comments>http://www.linux360.it/2014/05/21/configurazione-punto-punto-wds-mikrotik/#comments</comments>
		<pubDate>Wed, 21 May 2014 09:18:10 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[wds mikrotik]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=617</guid>
		<description><![CDATA[<p>In questo esempio fornisce uno script di configurazione MikroTik di base per due Access Point configurati in WDS. Questo script è perfetto per creare un ponte in layer2 tra due punti che utilizzano MikroTik. È possibile incollare questo script direttamente in una finestra &#8220;New Terminal&#8221; o configurare ogni passo individualmente in Winbox, la struttura dei ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/05/21/configurazione-punto-punto-wds-mikrotik/">Configurazione Punto &#8211; Punto WDS Mikrotik</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><span id="result_box" lang="it"><span class="hps">In questo esempio</span> <span class="hps">fornisce</span> <span class="hps">uno script di configurazione</span> <span class="hps">MikroTik</span> <span class="hps">di base</span> <span class="hps">per</span> <span class="hps">due Access Point configurati in WDS</span>. <span class="hps">Questo script è perfetto per</span> <span class="hps">creare un ponte</span> in <span class="hps">layer2</span> <span class="hps">tra due</span> punti<span class="hps"> che utilizzano</span> <span class="hps">MikroTik</span>.<br />
</span><span id="result_box" lang="it"></span><span id="result_box" lang="it"></span><span id="result_box" lang="it"></span></p>
<p><span id="result_box" lang="it"><span class="hps">È possibile incollare</span> <span class="hps">questo script</span> <span class="hps">direttamente in una</span> <span class="hps atn">finestra &#8220;New </span>Terminal&#8221; o <span class="hps">configurare ogni</span> <span class="hps">passo</span> <span class="hps">individualmente in</span> <span class="hps">Winbox,</span> <span class="hps">la struttura</span> <span class="hps">dei comandi </span><span class="hps">riflette</span> <span class="hps">il menu</span> <span class="hps">Winbox</span>. <span class="hps">Tutte le linee</span> <span class="hps">che iniziano</span> <span class="hps atn">con un &#8220;</span>#&#8221; essendo commenti <span class="hps">vengono ignorate da</span> <span class="hps">MikroTik.</span><br />
</span></p>
<p><span id="result_box" lang="it"><span class="hps">La</span> <span class="hps">configurazione di rete wireless</span> <span class="hps">varia a seconda</span> <span class="hps">del tipo di RouterBoard che si utilizza</span> <span class="hps">e quindi la configurazione </span></span><span id="result_box" lang="it"><span class="hps">può richiedere</span> <span class="hps">qualche ritocco</span>.</span></p>
<p><strong>Configurazione Ap Principale:</strong><br />
# Access Point WDS<br />
#<br />
### Create Bridge Interface ###<br />
/interface bridge<br />
add name=wds-bridge comment=wds-bridge-interface disabled=no</p>
<p>### Add ether1 to the Bridge###<br />
/interface bridge port<br />
add interface=ether1 bridge=wds-bridge</p>
<p>### Create Wireless Security Profile ###<br />
/interface wireless security-profiles<br />
add mode=dynamic-keys authentication-types=wpa2-psk group-ciphers=aes-ccm name=wifi_baleno unicast-ciphers=aes-ccm wpa2-pre-shared-key=&#8221;balenowireless&#8221;</p>
<p>### Wireless Network Configuration ###<br />
/interface wireless<br />
set 0 band=5ghz-a/n channel-width=20/40mhz-ht-above disabled=no frequency=5765 mode=bridge security-profile=wifi_baleno ssid=&#8221;Baleno WDS Bridge&#8221; wds-default-bridge=wds-bridge wds-mode=dynamic wireless-protocol=nv2 ht-txchains=0,1 ht-rxchains=0,1</p>
<p>### IP Address of Bridge Interface ###<br />
/ip address<br />
add address=192.168.88.101/24 interface=wds-bridge</p>
<p>### Disable firewall connection tracking to reduce overhead ###<br />
/ip firewall<br />
connection tracking set enabled=no</p>
<p>### Set Hostname ###<br />
/system identity<br />
set name=AP-BALENO-WDS</p>
<p>### End of configuration ###</p>
<p><strong>Configurazione AP Secondario:</strong><br />
# Station WDS<br />
#<br />
### Create Bridge Interface ###<br />
/interface bridge<br />
add name=wds-bridge comment=wds-bridge-interface disabled=no</p>
<p>### Add ether1 and wlan1 to the Bridge###<br />
/interface bridge port<br />
add interface=ether1 bridge=wds-bridge<br />
add interface=wlan1 bridge=wds-bridge</p>
<p>### Create Wireless Security Profile ###<br />
/interface wireless security-profiles<br />
add authentication-types=wpa2-psk group-ciphers=aes-ccm name=wifi_security unicast-ciphers=aes-ccm wpa2-pre-shared-key=&#8221;balenowireless&#8221;</p>
<p>### Wireless Network Configuration ###<br />
/interface wireless<br />
set 0 band=5ghz-a/n channel-width=20/40mhz-ht-above mode=station-wds security-profile=wifi_baleno ssid=&#8221;Baleno WDS Bridge&#8221; wireless-protocol=nv2-nstreme-802.11 disabled=no ht-txchains=0,1 ht-rxchains=0,1</p>
<p>### IP Address of Bridge Interface ###<br />
/ip address<br />
add address=192.168.88.102/24 interface=wds-bridge</p>
<p>### Disable firewall connection tracking to reduce overhead ###<br />
/ip firewall<br />
connection tracking set enabled=no</p>
<p>### Set Hostname ###<br />
/system identity<br />
set name=ST-BALENO-WDS</p>
<p>### End of configuration ###</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/05/21/configurazione-punto-punto-wds-mikrotik/">Configurazione Punto &#8211; Punto WDS Mikrotik</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/05/21/configurazione-punto-punto-wds-mikrotik/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurazione MultiSid + Vlan tra Ubiquiti Unifi e Routerboard Mikrotik</title>
		<link>http://www.linux360.it/2014/05/20/configurazione-multisid-vlan-tra-ubiquiti-unifi-e-routerboard-mikrotik/</link>
		<comments>http://www.linux360.it/2014/05/20/configurazione-multisid-vlan-tra-ubiquiti-unifi-e-routerboard-mikrotik/#comments</comments>
		<pubDate>Tue, 20 May 2014 15:38:41 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[ubiquiti unifi]]></category>
		<category><![CDATA[vlan mikrotik]]></category>
		<category><![CDATA[vlan unifi]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=584</guid>
		<description><![CDATA[<p>L’altro giorno mi è capitato di fare una config un po particolare, e visto che ci ho sbattuto per farla volevo condividerla con il mondo In questo esempio vi mostrerò come configurare 3 interfacce con la propria sottorete ed il proprio dhcp-server utilizzando una antenna Ubiquiti Unifi ed una RouterBoard Mikrotik 1000. Queste reti sono ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/05/20/configurazione-multisid-vlan-tra-ubiquiti-unifi-e-routerboard-mikrotik/">Configurazione MultiSid + Vlan tra Ubiquiti Unifi e Routerboard Mikrotik</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>L’altro giorno mi è capitato di fare una config un po particolare, e visto che ci ho sbattuto per farla volevo condividerla con il mondo <img src="http://www.linux360.it/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley" /><br />
In questo esempio vi mostrerò come configurare 3 interfacce con la propria sottorete ed il proprio dhcp-server utilizzando una antenna<br />
Ubiquiti Unifi ed una RouterBoard Mikrotik 1000.<br />
Queste reti sono due interfacce fisiche e due vlan, le fisiche saranno ether3 ed ether4 mentre le vlan sono 10 e 20.<br />
La porta ether4 sarà configurata come trunk per l’Unifi e trasporterà due Vlan la 10 e la 20 mentre la ether3<br />
sara configurata con la network di management senza tag così da poter raggiungere il software il computer dove<br />
è installato il software per il controllo degli ap UniFI.</p>
<p>&nbsp;</p>
<p><strong>Fase 1 &#8211; Configurazione RouterBoard Mikrotik</strong></p>
<p>/interface bridge<br />
add l2mtu=1598 name=lan<br />
add l2mtu=1594 name=vlan10<br />
add l2mtu=1594 name=vlan20</p>
<p>/interface vlan<br />
add interface=ether4 l2mtu=1594 name=vl-lan10-ether4 vlan-id=10<br />
add interface=ether4 l2mtu=1594 name=vl-lan20-ether4 vlan-id=20</p>
<p>/ip dns<br />
set allow-remote-requests=yes servers=8.8.4.4,208.67.220.220<br />
/ip dns static<br />
add address=192.168.9.100 name=unifi</p>
<p>/interface bridge port<br />
add bridge=lan interface=ether3<br />
add bridge=lan interface=ether4<br />
add bridge=vlan10 interface=vl-lan10-ether4<br />
add bridge=vlan20 interface=vl-lan20-ether4</p>
<p>/ip neighbor discovery<br />
set vl-lan10-ether4 discover=no<br />
set vl-lan20-ether4 discover=no</p>
<p>/ip pool<br />
add name=dhcp_lan ranges=192.168.9.2-192.168.9.254<br />
add name=dhcp_vlan10 ranges=192.168.10.2-192.168.10.254<br />
add name=dhcp_vlan20 ranges=192.168.20.2-192.168.20.254</p>
<p>/ip dhcp-server<br />
add address-pool=dhcp_lan disabled=no interface=lan name=dhcp_lan<br />
add address-pool=dhcp_vlan10 disabled=no interface=vlan10 name=dhcp_vlan10<br />
add address-pool=dhcp_vlan20 disabled=no interface=vlan20 name=dhcp_vlan20</p>
<p>/ip address<br />
add address=192.168.9.1/24 interface=lan network=192.168.9.0<br />
add address=192.168.10.1/24 interface=vlan10 network=192.168.10.0<br />
add address=192.168.20.1/24 interface=vlan20 network=192.168.20.0</p>
<p>/ip dhcp-server network<br />
add address=192.168.9.0/24 dhcp-option=unifi dns-server=192.168.9.1 gateway=<br />
192.168.9.1<br />
add address=192.168.10.0/24 dhcp-option=unifi dns-server=192.168.10.1 gateway=<br />
192.168.10.1<br />
add address=192.168.20.0/24 dhcp-option=unifi dns-server=192.168.20.1 gateway=<br />
192.168.20.1</p>
<p>&nbsp;</p>
<p><strong>Fase &#8211; Configurazione del controller Unifi:</strong></p>
<p>Video di esempio dove mostra gli step di una prima configurazione del controller</p>
[topswf swf='http://www.ubuntuserver.it/wp-content/uploads/2014/05/unifi_wizard.swf' width='450' height='300']
<p>&nbsp;</p>
<p>Colleghiamoci con il PC dove è installato il software Ubiquiti sulla porta ether3 ed impostiamo sulla nostra interfaccia di rete l’ip 192.168.9.100/24 con gateway 192.168.9.1. Apriamo il browser all&#8217;indirizzo https://localhost:8443 ed eseguiamo il Wizard della prima configurazione, dopo aver terminato il wizard andiamo in Settings &#8211; Wlan Group ed aggiungiamo un ESSID WIFI-MGM senza vlan così farà parte della network 192.168.9.0/24 così riuscita a comunicare con il controller senza traffico taggato. Dopo aggiungeremo altri due ESSID WIFI-VLAN10 e WIFI-VLAN20 con le rispettive vlan 10 e 20, ed avranno le network 192.168.10.0/24 e 192.168.20.0/24, fatto questo se ci colleghiamo in Wifi ad ogni singolo ESSID avremo accesso a network diverse e sulla nostra Mikrotik possiamo fare quello che vogliamo ad ex. Hotspot sulla VLAN10 oppure regole di Banda o di accesso alle singole network.</p>
<p>Spero possa essere utile a molti <img src="http://www.linux360.it/wp-includes/images/smilies/icon_biggrin.gif" alt=":-D" class="wp-smiley" /> </p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/05/20/configurazione-multisid-vlan-tra-ubiquiti-unifi-e-routerboard-mikrotik/">Configurazione MultiSid + Vlan tra Ubiquiti Unifi e Routerboard Mikrotik</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/05/20/configurazione-multisid-vlan-tra-ubiquiti-unifi-e-routerboard-mikrotik/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mikrotik Scripting: Queue Tree Limit Exceeded</title>
		<link>http://www.linux360.it/2014/05/10/mikrotik-scripting-queue-tree-limit-exceeded/</link>
		<comments>http://www.linux360.it/2014/05/10/mikrotik-scripting-queue-tree-limit-exceeded/#comments</comments>
		<pubDate>Sat, 10 May 2014 16:10:36 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[queue tree]]></category>
		<category><![CDATA[routerOS]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1877</guid>
		<description><![CDATA[<p>Today i&#8217;ll show you a little script for RouterOS to check if queue tree exceed the limit you set. For. Example i&#8217;ve a queue tree that limit the amount o total traffic(Upload+Download) to 50MBps I want to know whenever this queue exceed the limit, and i want the system to send me an email. This ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/05/10/mikrotik-scripting-queue-tree-limit-exceeded/">Mikrotik Scripting: Queue Tree Limit Exceeded</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Today i&#8217;ll show you a little script for RouterOS to check if queue tree exceed the limit you set.</p>
<p>For. Example i&#8217;ve a queue tree that limit the amount o total traffic(Upload+Download) to 50MBps</p>
<p>I want to know whenever this queue exceed the limit, and i want the system to send me an email.</p>
<p>This is the script:</p>
<div id="wpshdo_11" class="wp-synhighlighter-outer"><div id="wpshdt_11" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_11"></a><a id="wpshat_11" class="wp-synhighlighter-title" href="#codesyntax_11"  onClick="javascript:wpsh_toggleBlock(11)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_11" onClick="javascript:wpsh_code(11)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_11" onClick="javascript:wpsh_print(11)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_11" class="wp-synhighlighter-inner" style="display: block;"><ol class="php" style="font-family:monospace;"><li class="li1"><div class="de1"><span class="sy0">:</span><span class="kw2">global</span> checkrate <span class="br0">[</span><span class="sy0">/</span>queue tree get total<span class="sy0">-</span>traffic rate<span class="br0">]</span></div></li>
<li class="li1"><div class="de1"><span class="sy0">:</span>local limit 50000000</div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="sy0">:</span><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="re0">$checkrate</span> <span class="sy0">&lt;</span> <span class="re0">$limit</span> <span class="br0">&#41;</span> <span class="kw1">do</span><span class="sy0">=</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1"><span class="sy0">:</span><a href="http://www.php.net/log"><span class="kw3">log</span></a> info <span class="br0">&#40;</span><span class="st0">&quot;Queue not Exceeded&quot;</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="sy0">:</span><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="re0">$checkrate</span> <span class="sy0">&gt;</span> <span class="re0">$limit</span> <span class="br0">&#41;</span> <span class="kw1">do</span><span class="sy0">=</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1"><span class="sy0">:</span><a href="http://www.php.net/log"><span class="kw3">log</span></a> info <span class="br0">&#40;</span><span class="st0">&quot;Queue Exceeded&quot;</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1"><span class="sy0">/</span>tool e<span class="sy0">-</span><a href="http://www.php.net/mail"><span class="kw3">mail</span></a> send server<span class="sy0">=</span>xxx<span class="sy0">.</span>xxx<span class="sy0">.</span>xxx<span class="sy0">.</span>xxx from<span class="sy0">=</span><span class="st0">&quot;me@myself.com&quot;</span> to<span class="sy0">=</span><span class="st0">&quot;me@myself.com&quot;</span> subject<span class="sy0">=</span><span class="br0">&#40;</span><span class="st0">&quot;Queue Limit Exceed&quot;</span><span class="br0">&#41;</span> body<span class="sy0">=</span><span class="br0">&#40;</span><span class="st0">&quot;Queue Limit Exceed, Limit is: &quot;</span> <span class="sy0">.</span> <span class="re0">$checkrate</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<p>&nbsp;</p>
<p>I&#8217;ll explain the code:</p>
<p>First i define a variable <strong>checkrate</strong> that represent the instant rate of the queue tree named <strong>total-traffic</strong> then i define a <strong>limit</strong>(this case i&#8217;ve used 50Mbps) then i check if rate less than limit do nothing or just log to test the script.</p>
<p>If checkrate greater than limit send an email to myself.</p>
<p>Be sure to specify as email server an IP address and not the name of the server(ex. mail.myself.com)</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/05/10/mikrotik-scripting-queue-tree-limit-exceeded/">Mikrotik Scripting: Queue Tree Limit Exceeded</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/05/10/mikrotik-scripting-queue-tree-limit-exceeded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bloccare Teamviewer tramite Mikrotik OS</title>
		<link>http://www.linux360.it/2014/04/18/bloccare-teamviewer-tramite-mikrotik-os/</link>
		<comments>http://www.linux360.it/2014/04/18/bloccare-teamviewer-tramite-mikrotik-os/#comments</comments>
		<pubDate>Fri, 18 Apr 2014 07:59:59 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[BloccoTeamviewer]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[Teamviewer]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=510</guid>
		<description><![CDATA[<p>&#160; &#160; &#160; Ciao a tutti, di seguito vi mostro delle semplici regole firewall per bloccare Teamviewer all&#8217;interno della vostra rete: /ip firewall filter add chain=forward action=add-dst-to-address-list protocol=tcp address-list=TeamViewer address-list-timeout=1d dst-port=5938 add chain=forward action=drop src-address-list=TeamViewer add chain=forward action=drop dst-address-list=TeamViewer &#160; &#160;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/04/18/bloccare-teamviewer-tramite-mikrotik-os/">Bloccare Teamviewer tramite Mikrotik OS</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Ciao a tutti,</p>
<p>di seguito vi mostro delle semplici regole firewall per bloccare Teamviewer all&#8217;interno della vostra rete:</p>
<p>/ip firewall filter<br />
add chain=forward action=add-dst-to-address-list protocol=tcp address-list=TeamViewer<br />
address-list-timeout=1d dst-port=5938<br />
add chain=forward action=drop src-address-list=TeamViewer<br />
add chain=forward action=drop dst-address-list=TeamViewer</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/04/18/bloccare-teamviewer-tramite-mikrotik-os/">Bloccare Teamviewer tramite Mikrotik OS</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/04/18/bloccare-teamviewer-tramite-mikrotik-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bridge Punto-Punto con Mikrotik</title>
		<link>http://www.linux360.it/2013/09/13/bridge-punto-punto-con-mikrotik/</link>
		<comments>http://www.linux360.it/2013/09/13/bridge-punto-punto-con-mikrotik/#comments</comments>
		<pubDate>Fri, 13 Sep 2013 15:34:20 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Wireless & Networking]]></category>
		<category><![CDATA[bridge]]></category>
		<category><![CDATA[cpe]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[sxt]]></category>
		<category><![CDATA[transparent]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1615</guid>
		<description><![CDATA[<p>Ecco come realizzare un collegamento punto-punto utilizzando due cpe Mikrotik SXT. Un ringraziamento al mio amico e compare Frank per le immagini della guida! colleghiamo la prima delle due SXT Mikrotik ad un pc, dando alla rete LAN un indirizzo ( consiglio: utilizzare 192.168.88.100/24). Utilizziamo il tool winbox (disponibile a questo indirizzo) e colleghiamoci o ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/09/13/bridge-punto-punto-con-mikrotik/">Bridge Punto-Punto con Mikrotik</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ecco come realizzare un collegamento punto-punto utilizzando due cpe Mikrotik SXT. Un ringraziamento al mio amico e compare <a href="http://www.ubuntuserver.it" target="_blank">Frank</a> per le immagini della guida!</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_setup1.png"><img class="alignnone size-full wp-image-1616" title="Sxt_setup1" src="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_setup1.png" alt="" width="722" height="158" /></a></p>
<p>colleghiamo la prima delle due SXT Mikrotik ad un pc, dando alla rete LAN un indirizzo ( consiglio: utilizzare 192.168.88.100/24).</p>
<p>Utilizziamo il tool winbox (disponibile a questo <a href="http://download2.mikrotik.com/winbox.exe" target="_blank">indirizzo</a>) e colleghiamoci o tramite l&#8217;indirizzo ip della CPE o tramite il mac address utilizzando username: admin e password vuoto(se è la prima volta che si accede al dispositivo)</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_winbox1.png"><img class="alignnone size-full wp-image-1617" title="Sxt_winbox1" src="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_winbox1.png" alt="" width="544" height="336" /></a></p>
<p>Configuriamo adesso la prima SXT come Bridge.</p>
<p>Andare su Interfaces, doppio click sull&#8217;interfaccia radio e aprire il tab Wireless. Cambiare, come mostrato in figura il Mode in Bridge, impostare una frequenza e poi fare Apply</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_advanced1.png"><img class="alignnone size-full wp-image-1618" title="Sxt_advanced1" src="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_advanced1.png" alt="" width="890" height="657" /></a></p>
<p>Andare nel Menu IP-&gt;Firewall e scegliere il tab NAT.</p>
<p>Disabilitare la regola Masquerade:</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_nat1.png"><img class="alignnone size-full wp-image-1619" title="Sxt_nat1" src="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_nat1.png" alt="" width="718" height="388" /></a></p>
<p>Andare su IP-&gt;DHCP Server e IP-&gt;DHCP Client e disabilitare i due servizi in quanto non servono in modalità trasparente.</p>
<p>Scegliere dal menu Bridge e creare un nuovo bridge tra l&#8217;interfaccia Ethernet(ether1-local) e l&#8217;interfaccia radio(wlan1-gateway):</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_bridge1.png"><img class="alignnone size-full wp-image-1620" title="Sxt_bridge1" src="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_bridge1.png" alt="" width="801" height="552" /></a></p>
<p>Ora che è stato aggiunto il Bridge bisogna assegnare l&#8217;ip non più all&#8217;interfaccia Eth ma al bridge(funziona anche lasciando l&#8217;ip alla eth, ma è più corretto in questo modo!)</p>
<p>Scegliere un indirizzo IP es. 10.0.0.11 e assegnarlo al bridge</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_ip1.png"><img class="alignnone size-full wp-image-1621" title="Sxt_ip1" src="http://www.paolodaniele.it/wp-content/uploads/2013/09/Sxt_ip1.png" alt="" width="336" height="366" /></a></p>
<p>Poi rimuovere l&#8217;IP dalla interfaccia ether1-local</p>
<p>Il secondo dispositivo va configurato esattamente allo stesso modo semplicemente cambiando l&#8217;IP del bridge con un altro indirizzo della rete 10.0.0.X es. 10.0.0.12</p>
<p>Per chi necessità di far passare le VLAN sul bridge, bisogna prima creare la VLAN dal menu Interfaces con il tasto + e poi creare un bridge tra la VLAN e la wlan1-gateway.</p>
<p>Di seguito il codice per chi volesse creare le vlan da terminale:</p>
<blockquote><p>interface vlan add name=vlan-10 vlan-id=10 interface=wlan1-gateway disabled=no<br />
interface vlan add name=vlan-20 vlan-id=20 interface=wlan1-gateway disabled=no<br />
interface bridge add name=br-vlan10 disabled=no<br />
interface bridge add name=br-vlan20 disabled=no<br />
interface bridge port add interface=&#8221;vlan-10&#8243; bridge=&#8221;br-vlan10&#8243; disabled=no<br />
interface bridge port add interface=&#8221;wlan1-gateway&#8221; bridge=&#8221;br-vlan10&#8243; disabled=no<br />
interface bridge port add interface=&#8221;vlan-20&#8243; bridge=&#8221;br-vlan20&#8243; disabled=no<br />
interface bridge port add interface=&#8221;wlan1-gateway&#8221; bridge=&#8221;br-vlan20&#8243; disabled=no</p></blockquote>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/09/13/bridge-punto-punto-con-mikrotik/">Bridge Punto-Punto con Mikrotik</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2013/09/13/bridge-punto-punto-con-mikrotik/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic DNS Update Script for NO-IP behind NAT on Mikrotik Router V2</title>
		<link>http://www.linux360.it/2013/07/13/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-v2/</link>
		<comments>http://www.linux360.it/2013/07/13/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-v2/#comments</comments>
		<pubDate>Sat, 13 Jul 2013 14:40:58 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[noip]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=394</guid>
		<description><![CDATA[<p>Googlando ho trovato questa versione che sembra essere piu completo del mio precedente script #Dynamic DNS Update Script for No-IP DNS behind nat # Set needed variables :local username "your no-ip user login" :local password "your no-ip password" :local host "your no-ip host name" :global previousIP # print some debug info :log info ("Update No-IP ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/07/13/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-v2/">Dynamic DNS Update Script for NO-IP behind NAT on Mikrotik Router V2</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Googlando ho trovato questa versione che sembra essere piu completo del mio precedente script <img src="http://www.linux360.it/wp-includes/images/smilies/icon_razz.gif" alt=":P" class="wp-smiley" /> </p>
<pre class="bbcode_code" style="height: 372px;">#Dynamic DNS Update Script for No-IP DNS behind nat
# Set needed variables
:local username "your no-ip user login"
:local password "your no-ip password"
:local host "your no-ip host name"
:global previousIP
# print some debug info
:log info ("Update No-IP DNS: username = $username")
:log info ("Update No-IP DNS: hostname = $host")
:log info ("Update No-IP DNS: previousIP = $previousIP")
#
# behind nat - get the public address using dyndns url http://checkip.dyndns.org
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:delay 2
:local result [/file get dyndns.checkip.html contents]
:log info "dyndns result = $result"
# parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "&lt;/body&gt;" -1]
:local currentIP [pick $result $startLoc $endLoc]
:log info "No-IP DNS: currentIP = $currentIP"
:if ($currentIP != $previousIP) do={
:log info "No-IP: Current IP $currentIP is not equal to previous IP, update needed"
:set previousIP $currentIP
:local url "http://dynupdate.no-ip.com/nic/update/?myip=$currentIP&amp;hostname=$host"
:log info "No-IP DNS: Sending update for $host"
/tool fetch url=$url user=$username password=$password mode=http dst-path=("no-ip_ddns_update.txt")
:log info "No-IP DNS: Host $host updated on No-IP with IP $currentIP"
:delay 2
:local result [/file get "no-ip_ddns_update.txt" contents]
:log info "Update Result = $result"
} else={
:log info "No-IP: update not needed "
}
# end</pre>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/07/13/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-v2/">Dynamic DNS Update Script for NO-IP behind NAT on Mikrotik Router V2</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2013/07/13/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic DNS Update Script for NO-IP behind NAT on Mikrotik Router</title>
		<link>http://www.linux360.it/2013/06/22/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-2/</link>
		<comments>http://www.linux360.it/2013/06/22/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-2/#comments</comments>
		<pubDate>Sat, 22 Jun 2013 17:22:09 +0000</pubDate>
		<dc:creator><![CDATA[Francesco Gabriele]]></dc:creator>
				<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[nat]]></category>
		<category><![CDATA[no-ip]]></category>
		<category><![CDATA[noip]]></category>

		<guid isPermaLink="false">http://www.ubuntuserver.it/?p=378</guid>
		<description><![CDATA[<p>Basandomi sul mio precedente script  p ho effettuate alcune modifiche prendendo esempio da un esempio di script che utilizza DynDNS sempre dietro nat  p Eccolo: # No-IP automatic Dynamic DNS update Behind Nat By Frank #&#8212;&#8212;&#8212;&#8212;&#8212; Change Values in this section to match your setup &#8212;&#8212;&#8212;&#8212;&#8212;&#8212; # No-IP User account info :local noipuser &#8220;noip_user&#8221; :local noippass ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/06/22/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-2/">Dynamic DNS Update Script for NO-IP behind NAT on Mikrotik Router</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><strong>Basandomi sul mio precedente script  <a title="Dynamic DNS Update Script for No-IP DNS on Mikrotik Router" href="http://www.ubuntuserver.it/?p=372" target="_blank">p</a> ho effettuate alcune modifiche prendendo esempio da un esempio di script che utilizza DynDNS sempre dietro nat  <a title="Dynamic DNS Update Script for dynDNS behind NAT" href="http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_dynDNS_behind_NAT" target="_blank">p</a></strong><a href="http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_dynDNS_behind_NAT" target="_blank"><br />
</a></p>
<p><strong>Eccolo:</strong></p>
<p># No-IP automatic Dynamic DNS update Behind Nat By Frank</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212; Change Values in this section to match your setup &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p># No-IP User account info<br />
:local noipuser &#8220;noip_user&#8221;<br />
:local noippass &#8220;noip_password&#8221;</p>
<p># Set the hostname or label of network to be updated.<br />
# Hostnames with spaces are unsupported. Replace the value in the quotations below with your host names.<br />
# To specify multiple hosts, separate them with commas.<br />
:local noiphost &#8220;noip_domain&#8221;</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>:global previousIP</p>
<p># get the current IP address from the internet (in case of double-nat)<br />
/tool fetch mode=http address=&#8221;checkip.dyndns.org&#8221; src-path=&#8221;/&#8221; dst-path=&#8221;/nat.checkip.html&#8221;<br />
:local result [/file get nat.checkip.html contents]
<p># parse the current IP result<br />
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)<br />
:local endLoc [:find $result "&lt;/body&gt;" -1]
:local currentIP [:pick $result $startLoc $endLoc]
:log info &#8220;UpdateNatNoipDNS: currentIP = $currentIP&#8221;</p>
<p># The update URL. Note the &#8220;3F&#8221; is hex for question mark (?). Required since ? is a special character in commands.<br />
:local url &#8220;http://dynupdate.no-ip.com/nic/update3Fmyip=$currentIP&#8221;<br />
:local noiphostarray<br />
:set noiphostarray [:toarray $noiphost]
:foreach host in=$noiphostarray do={<br />
:log info &#8220;No-IP: Sending update for $host&#8221;<br />
/tool fetch url=($url . &#8220;&amp;hostname=$host&#8221;) user=$noipuser password=$noippass mode=http dst-path=(&#8220;no-ip_ddns_update-&#8221; . $host . &#8220;.txt&#8221;)<br />
:log info &#8220;No-IP: Host $host updated on No-IP with IP $currentIP&#8221;<br />
}</p>
<p><strong>Di seguito la solita schedulazione:</strong></p>
<p>/system scheduler</p>
<p>add disabled=no interval=5m name=no-ip_ddns_update on-event=no-ip_ddns_update policy=ftp,read,write,test,winbox,api start-date=apr/21/2013 start-time=18:46:4</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/06/22/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-2/">Dynamic DNS Update Script for NO-IP behind NAT on Mikrotik Router</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2013/06/22/dynamic-dns-update-script-for-no-ip-behind-nat-on-mikrotik-router-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
