<div dir="ltr">Cari amici,<div><br></div><div>per l&#39; antenna di verde stiamo sereni, poca roba, molta commozione, nulla cambia, al massimo migliora.</div><div><br></div><div>Ieri, per il comple di verde, ho configurato il nostro groundrouter, desidero condividere metodo e obiettivi della configurazione scelta.</div>

<div><br></div><div>Innanzitutto una bella fotina riassuntiva:</div><div><a href="http://fotogallery.ninux.org/calabria/CS_Verdebinario/IMG_20131220_013303.jpg" target="_blank">http://fotogallery.ninux.org/calabria/CS_Verdebinario/IMG_20131220_013303.jpg</a><br>

</div><div><br></div><div>Queste le porte, tenendo in considerazione che su questo router sono un pò a &quot;caso&quot; - come si può vedere dalla foto. Nel caso di openWRT se non esistesse &quot;il terminale&quot; saremmo uomini finiti.</div>
<div><br></div><div>&lt;ordine porte&gt;</div><div><div>root@OpenWrt:~# swconfig dev eth0 show</div><div>Global attributes:</div><div><span style="white-space:pre-wrap">        </span>enable_vlan: 1</div>
<div>Port 0:</div><div><span style="white-space:pre-wrap">        </span>pvid: 0</div><div><span style="white-space:pre-wrap">        </span>link: port:0 link:up speed:1000baseT full-duplex txflow rxflow </div><div>Port 1:</div>
<div><span style="white-space:pre-wrap">        </span>pvid: 2</div><div><span style="white-space:pre-wrap">        </span>link: port:1 link:down</div><div>Port 2:</div><div><span style="white-space:pre-wrap">        </span>pvid: 1</div>
<div><span style="white-space:pre-wrap">        </span>link: port:2 link:down</div><div>Port 3:</div><div><span style="white-space:pre-wrap">        </span>pvid: 0</div><div><span style="white-space:pre-wrap">        </span>link: port:3 link:up speed:100baseT full-duplex auto</div>

<div>Port 4:</div><div><span style="white-space:pre-wrap">        </span>pvid: 0</div><div><span style="white-space:pre-wrap">        </span>link: port:4 link:down</div><div>VLAN 0:</div><div><span style="white-space:pre-wrap">        </span>vid: 0</div>

<div><span style="white-space:pre-wrap">        </span>ports: 0t 3 4t </div><div>VLAN 1:</div><div><span style="white-space:pre-wrap">        </span>vid: 1</div><div><span style="white-space:pre-wrap">        </span>ports: 0t 2 4t </div>
<div>VLAN 2:</div><div><span style="white-space:pre-wrap">        </span>vid: 2</div><div><span style="white-space:pre-wrap">        </span>ports: 0t 1 4t </div><div>VLAN 3:</div><div><span style="white-space:pre-wrap">        </span>vid: 3</div>

<div><span style="white-space:pre-wrap">        </span>ports: 0t 4t </div><div>VLAN 4:</div><div><span style="white-space:pre-wrap">        </span>vid: 4</div><div><span style="white-space:pre-wrap">        </span>ports: 0t </div>
</div><div>&lt;/ordine porte&gt;</div><div><br></div><div>In altre parole</div><div><br></div><div>porta 1 è quella descritta dal rilievo in plastica, sul router, come la 4</div><div>porta 4 è la 3</div><div>porta 3 è la 2</div>
<div>porta 2 è la 1</div><div><br></div><div>(!)</div><div><br></div><div><br></div><div>Detto ciò ecco la configurazione della rete:</div><div><br></div><div>&lt;/etc/config/network&gt;</div><div><div>config interface &#39;loopback&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ifname &#39;lo&#39;</div><div><span class="" style="white-space:pre">        </span>option proto &#39;static&#39;</div><div><span class="" style="white-space:pre">        </span>option ipaddr &#39;127.0.0.1&#39;</div>
<div><span class="" style="white-space:pre">        </span>option netmask &#39;255.0.0.0&#39;</div><div><br></div><div>config interface &#39;lan&#39;</div><div><span class="" style="white-space:pre">        </span>option type &#39;bridge&#39;</div>
<div><span class="" style="white-space:pre">        </span>option proto &#39;static&#39;</div><div><span class="" style="white-space:pre">        </span>option ipaddr &#39;10.87.8.1&#39;</div><div><span class="" style="white-space:pre">        </span>option netmask &#39;255.255.255.0&#39;</div>
<div><span class="" style="white-space:pre">        </span>option _orig_ifname &#39;eth0 radio0.network1&#39;</div><div><span class="" style="white-space:pre">        </span>option _orig_bridge &#39;true&#39;</div><div><span class="" style="white-space:pre">        </span>option ifname &#39;eth0&#39;</div>
<div><br></div><div>config interface &#39;wan&#39;</div><div><span class="" style="white-space:pre">        </span>option ifname &#39;eth1&#39;</div><div><span class="" style="white-space:pre">        </span>option proto &#39;dhcp&#39;</div>
<div><br></div><div>config switch</div><div><span class="" style="white-space:pre">        </span>option name &#39;eth0&#39;</div><div><span class="" style="white-space:pre">        </span>option reset &#39;1&#39;</div><div><span class="" style="white-space:pre">        </span>option enable_vlan &#39;1&#39;</div>
<div><br></div><div>config switch_vlan</div><div><span class="" style="white-space:pre">        </span>option device &#39;eth0&#39;</div><div><span class="" style="white-space:pre">        </span>option vlan &#39;1&#39;</div><div><span class="" style="white-space:pre">        </span>option vid &#39;1&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ports &#39;0t 2 4t&#39;</div><div><br></div><div>config interface &#39;verdebinario_192&#39;</div><div><span class="" style="white-space:pre">        </span>option proto &#39;static&#39;</div>
<div><span class="" style="white-space:pre">        </span>option netmask &#39;255.255.255.0&#39;</div><div><span class="" style="white-space:pre">        </span>option ipaddr &#39;192.168.1.33&#39;</div><div><span class="" style="white-space:pre">        </span>option ifname &#39;eth0.2&#39;</div>
<div><span class="" style="white-space:pre">        </span>option gateway &#39;192.168.1.1&#39;</div><div><br></div><div>config switch_vlan</div><div><span class="" style="white-space:pre">        </span>option device &#39;eth0&#39;</div>
<div><span class="" style="white-space:pre">        </span>option vlan &#39;2&#39;</div><div><span class="" style="white-space:pre">        </span>option vid &#39;2&#39;</div><div><span class="" style="white-space:pre">        </span>option ports &#39;0t 1 4t&#39;</div>
<div><br></div><div>config switch_vlan</div><div><span class="" style="white-space:pre">        </span>option device &#39;eth0&#39;</div><div><span class="" style="white-space:pre">        </span>option vlan &#39;3&#39;</div><div><span class="" style="white-space:pre">        </span>option vid &#39;3&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ports &#39;0t 4t&#39;</div><div><br></div><div>config interface &#39;network_trunking&#39;</div><div><span class="" style="white-space:pre">        </span>option proto &#39;static&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ifname &#39;eth0.3&#39;</div></div><div><br></div><div><div>config interface &#39;ninux_172&#39;</div><div><span class="" style="white-space:pre">        </span>option proto &#39;static&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ifname &#39;eth0.1&#39;</div><div><span class="" style="white-space:pre">        </span>option ipaddr &#39;172.17.87.13&#39;</div><div><span class="" style="white-space:pre">        </span>option netmask &#39;255.255.0.0&#39;</div>
<div><span class="" style="white-space:pre">        </span>option gateway &#39;172.17.87.10&#39;</div><div><span class="" style="white-space:pre">        </span>option broadcast &#39;172.17.255.255&#39;</div><div><span class="" style="white-space:pre">        </span>option dns &#39;8.8.8.8&#39;</div>
<div><br></div><div>config switch_vlan</div><div><span class="" style="white-space:pre">        </span>option device &#39;eth0&#39;</div><div><span class="" style="white-space:pre">        </span>option vlan &#39;4&#39;</div><div><span class="" style="white-space:pre">        </span>option vid &#39;4&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ports &#39;0t&#39;</div><div><br></div><div>config interface &#39;dummy&#39;</div><div><span class="" style="white-space:pre">        </span>option proto &#39;static&#39;</div>
<div><span class="" style="white-space:pre">        </span>option ifname &#39;eth0.4&#39;</div></div><div><br></div><div>&lt;fine /etc/config/network&gt;</div><div><br></div><div>i bridge si leggono meglio così:</div><div><br></div>
<div><div>root@OpenWrt:~# brctl show</div><div>bridge name<span class="" style="white-space:pre">        </span>bridge id<span class="" style="white-space:pre">                </span>STP enabled<span class="" style="white-space:pre">        </span>interfaces</div>
<div>br-lan<span class="" style="white-space:pre">                </span>8000.6466b3413f71<span class="" style="white-space:pre">        </span>no<span class="" style="white-space:pre">                </span>eth0</div><div><span class="" style="white-space:pre">                                                                        </span>wlan0</div>
</div><div><br></div><div><br></div><div>mentre questo è l&#39;ifconfig</div><div><br></div><div>&lt;ifconfig&gt;</div><div><div>root@OpenWrt:~# ifconfig </div><div>br-lan    Link encap:Ethernet  HWaddr 64:66:B3:41:3F:71  </div>
<div>          inet addr:10.87.8.1  Bcast:10.87.8.255  Mask:255.255.255.0</div><div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div><div>          RX packets:44064 errors:0 dropped:23415 overruns:0 frame:0</div>
<div>          TX packets:676 errors:0 dropped:0 overruns:0 carrier:0</div><div>          collisions:0 txqueuelen:0 </div><div>          RX bytes:4901485 (4.6 MiB)  TX bytes:88790 (86.7 KiB)</div><div><br></div><div>eth0      Link encap:Ethernet  HWaddr 64:66:B3:41:3F:71  </div>
<div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div><div>          RX packets:49390 errors:0 dropped:71 overruns:0 frame:0</div><div>          TX packets:2013 errors:0 dropped:0 overruns:0 carrier:0</div>
<div>          collisions:0 txqueuelen:1000 </div><div>          RX bytes:6319530 (6.0 MiB)  TX bytes:150292 (146.7 KiB)</div><div>          Interrupt:5 </div><div><br></div><div>eth0.1    Link encap:Ethernet  HWaddr 64:66:B3:41:3F:71  </div>
<div>          inet addr:172.17.87.13  Bcast:172.17.255.255  Mask:255.255.0.0</div><div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div><div>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div>
<div>          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0</div><div>          collisions:0 txqueuelen:0 </div><div>          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)</div><div><br></div><div>eth0.2    Link encap:Ethernet  HWaddr 64:66:B3:41:3F:71  </div>
<div>          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0</div><div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div><div>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div>
<div>          TX packets:1336 errors:0 dropped:0 overruns:0 carrier:0</div><div>          collisions:0 txqueuelen:0 </div><div>          RX bytes:0 (0.0 B)  TX bytes:56112 (54.7 KiB)</div><div><br></div><div>eth1      Link encap:Ethernet  HWaddr 64:66:B3:41:3F:73  </div>
<div>          UP BROADCAST MULTICAST  MTU:1500  Metric:1</div><div>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div><div>          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0</div><div>          collisions:0 txqueuelen:1000 </div>
<div>          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)</div><div>          Interrupt:4 </div><div><br></div><div>lo        Link encap:Local Loopback  </div><div>          inet addr:127.0.0.1  Mask:255.0.0.0</div><div>          UP LOOPBACK RUNNING  MTU:16436  Metric:1</div>
<div>          RX packets:1327 errors:0 dropped:0 overruns:0 frame:0</div><div>          TX packets:1327 errors:0 dropped:0 overruns:0 carrier:0</div><div>          collisions:0 txqueuelen:0 </div><div>          RX bytes:164755 (160.8 KiB)  TX bytes:164755 (160.8 KiB)</div>
<div><br></div><div>wlan0     Link encap:Ethernet  HWaddr 64:66:B3:41:3F:72  </div><div>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</div><div>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div>
<div>          TX packets:43044 errors:0 dropped:0 overruns:0 carrier:0</div><div>          collisions:0 txqueuelen:32 </div><div>          RX bytes:0 (0.0 B)  TX bytes:6390363 (6.0 MiB)</div></div><div>&lt;/ifconfig&gt;</div>
<div><br></div><div>Detto ciò andiamo alle motivazioni di q<u>uesta configurazione.</u></div><div><u><br></u></div><div><u>RETE WAN DHCP iface eth1</u></div><div>LA porta WAN è configurata con dhcp e può essere collegata a qualsiasi rete con tale servizio.</div>
<div>La firewall impostata non è la classica openwrt per le wan ma è equivalente a quella lan.</div><div><u><br></u></div><div><u>RETE <a href="http://10.87.8.0/24">10.87.8.0/24</a>  iface br-lan</u></div><div>Ho creato un bridge tra wlan0 e eth0 per erogare la rete <a href="http://10.87.8.0/24">10.87.8.0/24</a> sia via wireless che tramite cablaggio ethernet puro (untagged). il link ethernet a 10.87.8 è sia sulla porta 3 che sulla porta 4 (quella di trunk, dove viaggiano tutte le reti). Il link untagged consente a qualsiasi socio di verde, che non conosce le vlan, di pluggarsi nella rete o appendere uno switch stupido.</div>
<div><br></div><div><u>RETE <a href="http://172.17.87.0/16">172.17.87.0/16</a> iface eth0.1</u></div><div>Questa VLAN comunica in ethernet untagged sulla porta 2 e tramite trunk (tagged) sulla porta 4.</div><div>Questo mi consente di collegare l&#39;antenna in bridge senza ulteriori configurazioni o hack. Ancora meglio collegare tutte le antenne in uno switch e questo alla porta untagged di openWRT (come ho fatto a casa mia e come preferisco fare per evitare di giungere al layer 3 solo all&#39;interno della CPU del router).</div>
<div><br></div><div><u>RETE <a href="http://192.168.1.0/24">192.168.1.0/24</a> iface eth0.2</u></div><div>Questa rete collega la rete preesistente di verdebinario, sebbene questa non verrà annunciata tramite OLSR. sulla porta 4 è possibile linkarla tramite tag id 2.</div>
<div><br></div><div><u>strategia TAGGED e UNTAGGED</u></div><div>Ho diviso le reti riservando loro una porta untagged rispettivamente e una porta di trunk, per espasioni di rete (o per testare l&#39;antenna CPE con il tag sulla interfaccia, seguendo la speritamentazione proposta insieme a Stefano). </div>
<div>il partizionamento trunk/untagged ci consente di sfruttare tutte le potenzialità delle VLAN senza però ridurre accessibilità e usabilità del groundrouter, specie nei confronti dei soci ai quali non importa niente delle VLAN e che potrebbero vedere in queste una costrizione inutile alle loro finalità, per non suscitare forme di resistenza, o aumentare il costo psicologico (vedi teoria dello scambio sociale).</div>
<div><br></div><div>Ho pensato a questa configurazione anche per evitare di sbattermi con il tagging di vlan su hardware obsoleto (verdebinario docet) e su AirOS che al momento riesco a configurare a dovere solo da terminale.<br>
</div><div><br></div><div>Questo fine settimana sarò a verde per &quot;collocare&quot; la rete e avviare OLSR sul router,</div><div>siamo tutti invitati,</div><div>G</div><div><br></div><div><br></div><div><br></div><div>
<br></div><div><br></div><div><br></div></div>