Configuration IPv6
From Fixme.ch
Une fois le RPi3 booté avec ses modules chargés la commande ifconfig -a rend cela :
root@raspberrypi:~# ifconfig -a eth0 Link encap:Ethernet HWaddr b8:27:eb:e3:b4:bb inet6 addr: fe80::fee:cb7a:1ab0:211f/64 Scope:Link UP 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 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:1 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr b8:27:eb:b6:e1:ee inet addr:192.168.130.204 Bcast:192.168.130.255 Mask:255.255.255.0 inet6 addr: fe80::468:a46c:b9be:706e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:185 errors:0 dropped:0 overruns:0 frame:0 TX packets:169 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:27991 (27.3 KiB) TX bytes:32030 (31.2 KiB) wpan0 Link encap:UNSPEC HWaddr 0E-79-86-4A-5E-68-30-50-00-00-00-00-00-00-00-00 BROADCAST NOARP MTU:123 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:300 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
On voit que le wpan0 n'est pas UP et qu'il n'existe pas d'interface lowpan0
Il faut créer le lien entre ce qui est un port de bridge wpan0 et ce qui deviendra une interface lowpan0 puis mettre ces interfaces UP.
ip link add link wpan0 name lowpan0 type lowpan ifconfig wpan0 up ifconfig lowpan0 up
On a alors la configuration suivante :
root@raspberrypi:~# ifconfig -a eth0 Link encap:Ethernet HWaddr b8:27:eb:e3:b4:bb inet6 addr: fe80::fee:cb7a:1ab0:211f/64 Scope:Link UP 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 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:1 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lowpan0 Link encap:UNSPEC HWaddr 2E-29-30-60-57-58-A0-CC-00-00-00-00-00-00-00-00 inet6 addr: fe80::2c29:3060:5758:a0cc/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1280 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:0 (0.0 B) TX bytes:3246 (3.1 KiB) wlan0 Link encap:Ethernet HWaddr b8:27:eb:b6:e1:ee inet addr:192.168.130.204 Bcast:192.168.130.255 Mask:255.255.255.0 inet6 addr: fe80::468:a46c:b9be:706e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:555 errors:0 dropped:0 overruns:0 frame:0 TX packets:625 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:67396 (65.8 KiB) TX bytes:146552 (143.1 KiB) wpan0 Link encap:UNSPEC HWaddr 2E-29-30-60-57-58-A0-CC-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING NOARP MTU:123 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:33 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:300 RX bytes:0 (0.0 B) TX bytes:3300 (3.2 KiB) root@raspberrypi:~#
Les circuits at86rf230 sont faits de telle sorte que la mac adresse du composant change à chaque reboot du coup, il vaut mieux fixer une adresse IPv6 à cette interface pour savoir à qui l'on parle ;-) Par exemple sur une carte qui sera le routeur :
ip addr add fd28::1/64 dev lowpan0
Et sur l'autre...
ip addr add fd28::2/64 dev lowpan0
Pour obtenir enfin ce que nous voulions :
root@raspberrypi:~# ping6 -I lowpan0 fd28::2 PING fd28::2(fd28::2) from fd28::1 lowpan0: 56 data bytes 64 bytes from fd28::2: icmp_seq=1 ttl=64 time=24.6 ms 64 bytes from fd28::2: icmp_seq=2 ttl=64 time=14.9 ms 64 bytes from fd28::2: icmp_seq=3 ttl=64 time=14.7 ms 64 bytes from fd28::2: icmp_seq=4 ttl=64 time=13.5 ms 64 bytes from fd28::2: icmp_seq=5 ttl=64 time=12.9 ms 64 bytes from fd28::2: icmp_seq=6 ttl=64 time=15.9 ms 64 bytes from fd28::2: icmp_seq=7 ttl=64 time=22.4 ms 64 bytes from fd28::2: icmp_seq=8 ttl=64 time=21.8 ms 64 bytes from fd28::2: icmp_seq=9 ttl=64 time=27.8 ms ^C --- fd28::2 ping statistics --- 9 packets transmitted, 9 received, 0% packet loss, time 8012ms rtt min/avg/max/mdev = 12.901/18.778/27.853/5.172 ms root@raspberrypi:~#