Analisi configurazione
Un'analisi della configurazione già funzionante preparata come da How To.
Appena entrati sul router si vede che su wlan0 è presente una interfaccia virtuale wlan0-1.
Questa è l'interfaccia che i router usano per la rete di backbone, l'interfaccia è configurata in modalità ad hoc tipica delle reti mesh, il nome dell'essid probabilmente è generato random con un suffisso che però probabilmente dovrà esssere uguale per tutti i nodi (da verificare).
root@Dancast-01:~# iwinfo wlan0-1 info wlan0-1 ESSID: "10-tsacnaD.lime" Access Point: 02:14:37:91:05:4E Mode: Ad-Hoc Channel: 1 (2.412 GHz) Tx-Power: 18 dBm Link Quality: unknown/70 Signal: unknown Noise: -95 dBm Bit Rate: unknown Encryption: unknown Type: nl80211 HW Mode(s): 802.11bgn Hardware: unknown [Generic MAC80211] TX power offset: unknown Frequency offset: unknown Supports VAPs: yes
in pratica i link verdi che si vedono in questa figura: http://dev.libre-mesh.org/attachments/download/19
Per la parte invece di distribuzione del segnale quella che è usata normalmente sugli access point viene usata wlan0 in modalità master con essid inpostato in fase di configurazione con chef nella pagina How To.
root@Dancast-01:~# iwinfo wlan0 info wlan0 ESSID: "NinuxBo" Access Point: 10:FE:ED:2B:19:E2 Mode: Master Channel: 1 (2.412 GHz) Tx-Power: 18 dBm Link Quality: 62/70 Signal: -48 dBm Noise: -95 dBm Bit Rate: 54.0 MBit/s Encryption: none Type: nl80211 HW Mode(s): 802.11bgn Hardware: unknown [Generic MAC80211] TX power offset: unknown Frequency offset: unknown Supports VAPs: yes
A questo punto possiamo collegarci normalmente alla rete wifi ninuxbo con i vari device e navigare.
Oppure molto più divertente analizzare il funzionamento della rete mesh collegandoci con un pc a vedere informazioni scambiate dal protocollo batman.
Per prima cosa è necessario installare batman e batctl:
apt-get install batman batctl
caricare il modulo batctl
modprobe batman-adv
eventualmente caricarlo di default all'avvio
echo "batman-adv" > /etc/modules
batctl if add wlan0
ifconfig bat0
iwconfig wlan0 mode ad-hoc essid 10-tsacnaD.lime channel 1
batctl tcpdump wlan0
16:01:02.607083 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317468, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:03.315079 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 852, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:03.419220 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 852, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:03.528663 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317469, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 16:01:03.631102 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317469, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:04.295077 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 853, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:04.398512 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 853, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:04.550669 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317470, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 16:01:04.651068 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317470, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:05.295080 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 854, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:05.398536 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 854, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:05.548925 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317471, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 16:01:05.647060 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317471, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:06.275042 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 855, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:06.379515 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 855, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:06.558621 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317472, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 Warning - batman vis packet received: function not implemented yet 16:01:06.659108 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317472, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:07.255029 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 856, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:07.288615 BAT 12:fe:ed:2b:19:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.291084 BAT 00:25:d3:11:f6:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.295157 BAT 00:25:d3:11:f6:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.299072 BAT 00:25:d3:11:f6:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.312137 BAT 12:fe:ed:2b:19:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.358514 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 856, tq 220, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26
root@debian:/home/daniele# batctl o [B.A.T.M.A.N. adv 2011.4.0, MainIF/MAC: wlan0/00:25:d3:11:f6:e3 (bat0)]
Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ...
12:fe:ed:2b:19:e3 0.808s (245) 12:fe:ed:2b:19:e3 [ wlan0]: 12:fe:ed:2b:19:e3 (245)
root@debian:/home/daniele# batctl tl
Locally retrieved addresses (from bat0) announced via TT (TTVN: 1):
* 2e:c8:5c:e8:e3:f0 [.P...]
root@debian:/home/daniele# batctl tr 12:fe:ed:2b:19:e3 traceroute to 12:fe:ed:2b:19:e3 (12:fe:ed:2b:19:e3), 50 hops max, 20 byte packets
1: 12:fe:ed:2b:19:e3 1.288 ms 1.241 ms 2.730 ms
bat0 Link encap:Ethernet HWaddr 62:9f:7a:a7:88:12 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
collegarsi alla rete mettendo wlan0 del pc in modalità ad hoc
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 mode ad-hoc essid 10-tsacnaD.lime channel 1
batctl tcpdump wlan0
16:01:02.607083 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317468, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:03.315079 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 852, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:03.419220 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 852, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:03.528663 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317469, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 16:01:03.631102 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317469, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:04.295077 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 853, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:04.398512 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 853, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:04.550669 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317470, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 16:01:04.651068 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317470, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:05.295080 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 854, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:05.398536 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 854, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:05.548925 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317471, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 16:01:05.647060 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317471, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:06.275042 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 855, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:06.379515 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 855, tq 217, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26 16:01:06.558621 BAT 12:fe:ed:2b:19:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 1483317472, tq 255, ttvn 8, ttcrc 41200, ttl 50, v 14, flags [.VF.], length 26 Warning - batman vis packet received: function not implemented yet 16:01:06.659108 BAT 12:fe:ed:2b:19:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 1483317472, tq 245, ttvn 8, ttcrc 41200, ttl 49, v 14, flags [DV..], length 26 16:01:07.255029 BAT 00:25:d3:11:f6:e3: OGM via neigh 00:25:d3:11:f6:e3, seq 856, tq 255, ttvn 1, ttcrc 36412, ttl 50, v 14, flags [..F.], length 26 16:01:07.288615 BAT 12:fe:ed:2b:19:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.291084 BAT 00:25:d3:11:f6:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.295157 BAT 00:25:d3:11:f6:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.299072 BAT 00:25:d3:11:f6:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.312137 BAT 12:fe:ed:2b:19:e3: BCAST, orig 12:fe:ed:2b:19:e3, seq 2917, Warning - packet contains unknown ether type: 0x86dd 16:01:07.358514 BAT 00:25:d3:11:f6:e3: OGM via neigh 12:fe:ed:2b:19:e3, seq 856, tq 220, ttvn 1, ttcrc 36412, ttl 49, v 14, flags [D...], length 26
root@debian:/home/daniele# batctl o [B.A.T.M.A.N. adv 2011.4.0, MainIF/MAC: wlan0/00:25:d3:11:f6:e3 (bat0)]
Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ...
12:fe:ed:2b:19:e3 0.808s (245) 12:fe:ed:2b:19:e3 [ wlan0]: 12:fe:ed:2b:19:e3 (245)
root@debian:/home/daniele# batctl tl
Locally retrieved addresses (from bat0) announced via TT (TTVN: 1):
* 2e:c8:5c:e8:e3:f0 [.P...]
root@debian:/home/daniele# batctl tr 12:fe:ed:2b:19:e3 traceroute to 12:fe:ed:2b:19:e3 (12:fe:ed:2b:19:e3), 50 hops max, 20 byte packets
1: 12:fe:ed:2b:19:e3 1.288 ms 1.241 ms 2.730 ms