[Ninux-Wireless] rete mesh con gentoo e fonere, problemi con ipv6
Luca Postregna
luca.postregna a gmail.com
Mer 9 Maggio 2012 19:04:17 CEST
Salve,
sto cercando di configurare una piccola rete mesh, chissà forse in futuro
entrerà a far parte di ninux, ma per ora ancora non funziona.
Al momento ho a disposizione un server/gateway gentoo ed una coppia di
fonera2.0g con openwrt. Per il routing utilizzo batman-adv 2012.1
(installato su tutti i nodi)e per ora vorrei basare il network dei nodi e
tutta la rete solo su ipv6 (se in futuro avrò la necessità probabilmente
fornirò ipv4 ai client via vpn con tinc). A tutti i nodi gli ipv6
nella 2001:470:7023:2::/64 sono assegnati staticamente.
Questo è un disegno esplicitativo http://ompldr.org/vZG9rYQ della
seguente configurazione,
*1*. il server con due interfaccie di rete (br1 come wan e br2 per la mesh,
i bridge mi servono per eventuali macchine virtuali). Sul server la br2 è
creata a partire dalla bat0. Sul server gentoo nel runlevel di default ho
net.br1, net.br2 e radvd (questo mi serve per assegnare gli ipv6 ai client
della mesh, oltre che ai client della rete domestica).
Di seguito le configurazioni di /etc/conf.d/net:
> cat /etc/conf.d/net
config_eth0="null"
rc_need_br1="net.eth0"
brctl_br1="setfd 0"
bridge_br1="eth0"
config_br1="192.168.1.20/24
2001:470:7023:1::f8d1:114b:2e50/64"
routes_br1="default via 192.168.1.1"
dns_servers_br1="192.168.1.1 8.8.8.8"
brctl_br2="setfd 0"
bridge_br2="bat0"
config_br2="192.168.2.20/24"
config_br2="192.168.2.20/24
2001:470:7023:2::f8d1:114b:2e50/64"
preup (){
if test $IFACE == "br2"; then
modprobe batman-adv
ifconfig eth1 up
batctl if add eth1
fi
return 0
}
e di radvd.conf:
> cat /etc/radvd.conf
interface br1
{
AdvLinkMTU 1452;
AdvSendAdvert on;
AdvManagedFlag off;
AdvOtherConfigFlag off;
prefix 2001:470:7023:1::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};
interface br2
{
AdvLinkMTU 1452;
AdvSendAdvert on;
AdvManagedFlag off;
AdvOtherConfigFlag off;
prefix 2001:470:7023:2::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};
quindi lo stato della rete ipv6 sul server:
> ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 fe80::250:fcff:fec0:d980/64 scope link
valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 fe80::206:93ff:fe30:317/64 scope link
valid_lft forever preferred_lft forever
5: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
inet6 2001:470:7023:1:0:f8d1:114b:2e50/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::206:93ff:fe30:317/64 scope link
valid_lft forever preferred_lft forever
6: bat0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500
inet6 fe80::885b:46ff:fe22:2874/64 scope link
valid_lft forever preferred_lft forever
7: br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
inet6 2001:470:7023:2:0:f8d1:114b:2e50/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::885b:46ff:fe22:2874/64 scope link
valid_lft forever preferred_lft forever
8: tun: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qlen 500
inet6 2001:5c0:1400:a::51/128 scope global
valid_lft forever preferred_lft forever
> ip -6 r s
2001:470:7023:1::/64 dev br1 proto kernel metric 256
2001:470:7023:2::/64 dev br2 proto kernel metric 256
2001:5c0:1400:a::51 dev tun proto kernel metric 256 mtu 1280
2000::/3 dev tun metric 1
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev br1 proto kernel metric 256
fe80::/64 dev eth1 proto kernel metric 256
fe80::/64 dev bat0 proto kernel metric 256
fe80::/64 dev br2 proto kernel metric 256
fe80::/64 dev tun proto kernel metric 256
ff00::/8 dev eth0 metric 256
ff00::/8 dev br1 metric 256
ff00::/8 dev eth1 metric 256
ff00::/8 dev bat0 metric 256
ff00::/8 dev br2 metric 256
ff00::/8 dev tun metric 256
default dev tun metric 1
*2*. entrambe le fonera hanno la stessa configurazione: due interfaccie
wifi ap0 ed adhoc0. adhoc0 e eth0.2 sono in pasto a batman-adv e mi fanno
la bat0. ap0, eth0.1, e bat0 mi fanno al br-lan. I file di configurazione
delle due fonera sono identici. Di seguito i dati presi dalla fonA connessa
in ethernet al server gentoo:
root a drei:~# cat /etc/config/network
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'
config 'interface' 'lan'
option 'type' 'bridge'
option 'proto' 'none'
option 'accept_ra' '1'
option 'ifname' 'eth0.1'
config 'interface' 'mesh0'
option 'ifname' 'adhoc0'
option 'mtu' '1528'
option 'proto' 'none'
config 'interface' 'mesh1'
option 'ifname' 'eth0.2'
option 'proto' 'none'
root a drei:~# cat /etc/config/wireless
config wifi-device wifi0
option type atheros
option channel 11
config wifi-iface
option device wifi0
option ifname ap0
option mode ap
option network lan
option ssid kozlicAP
config wifi-iface
option device wifi0
option ifname adhoc0
option mode adhoc
option network mesh0
option ssid kozlicMESH
root a drei:~# cat /etc/config/batman-adv
config 'mesh' 'bat0'
option 'interfaces' 'mesh0 mesh1'
option 'aggregated_ogms'
option 'ap_isolation'
option 'bonding'
option 'fragmentation'
option 'gw_bandwidth'
option 'gw_mode' 'client'
option 'gw_sel_class'
option 'log_level'
option 'orig_interval'
option 'vis_mode'
root a drei:~# cat /etc/rc.local
#!/bin/sh
IPV6PREFIX="2001:470:7023:2"
LAN="br-lan"
IPV6=$IPV6PREFIX::$(cat /sys/class/net/eth0/address |awk -F: '{print
$1$2":"$3$4":"$5$6}')
echo $IPV6
ip addr add $IPV6/64 dev $LAN
ip addr add 192.168.254.1/24 dev $LAN
batman-adv reload
exit 0
root a drei:~# ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 fe80::218:84ff:fed0:559c/64 scope link
valid_lft forever preferred_lft forever
4: eth0.1 a eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
inet6 fe80::218:84ff:fed0:559c/64 scope link
valid_lft forever preferred_lft forever
5: eth0.2 a eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
inet6 fe80::218:84ff:fed0:559c/64 scope link
valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
inet6 2001:470:7023:2:0:18:84d0:559c/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::218:84ff:fed0:559c/64 scope link
valid_lft forever preferred_lft forever
8: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
inet6 fe80::218:84ff:fed0:559d/64 scope link
valid_lft forever preferred_lft forever
9: adhoc0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1528
inet6 fe80::418:84ff:fed0:559d/64 scope link
valid_lft forever preferred_lft forever
root a drei:~# ip -6 r s
2001:470:7023:2::/64 dev br-lan proto kernel metric 256 mtu 1500 advmss
1440 hoplimit 0
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
0
fe80::/64 dev eth0.1 proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 0
fe80::/64 dev br-lan proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 0
fe80::/64 dev eth0.2 proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 0
fe80::/64 dev ap0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev adhoc0 proto kernel metric 256 mtu 1528 advmss 1468
hoplimit 0
Questa è la situazione di batman sul server:
> batctl o
[B.A.T.M.A.N. adv 2012.1.0, MainIF/MAC: eth1/00:50:fc:c0:d9:80 (bat0)]
Originator last-seen (#/255) Nexthop [outgoingIF]:
Potential nexthops ...
06:18:84:d0:80:bd 0.393s (232) 00:18:84:d0:55:9c [ eth1]:
00:18:84:d0:55:9c (232)
00:18:84:d0:55:9c 0.373s (253) 00:18:84:d0:55:9c [ eth1]:
00:18:84:d0:55:9c (253)
06:18:84:d0:55:9d 0.342s (255) 00:18:84:d0:55:9c [ eth1]:
00:18:84:d0:55:9c (255)
Questo è batman sulla fonera connessa in ethernet al server:
root a drei:~# batctl o
[B.A.T.M.A.N. adv 2012.1.0, MainIF/MAC: adhoc0/06:18:84:d0:55:9d (bat0)]
Originator last-seen (#/255) Nexthop [outgoingIF]:
Potential nexthops ...
00:50:fc:c0:d9:80 0.260s (255) 00:50:fc:c0:d9:80 [ eth0.2]:
00:50:fc:c0:d9:80 (255)
06:18:84:d0:80:bd 0.280s (233) 06:18:84:d0:80:bd [ adhoc0]:
06:18:84:d0:80:bd (233)
Qual'è il problema? I nodi nella 2001:470:7023:2::/64 non si pingano!
Ogni aiuto è apprezzato.
Saluti,
LP
--
http://luca.postregna.name
Luca Postregna
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://ml.ninux.org/pipermail/wireless/attachments/20120509/e4bc962d/attachment-0001.html>
Maggiori informazioni sulla lista
Wireless