This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MQTT Example - Radvd not disseminating an address?

I am using a Raspberry PI as a 6LoWPAN router, running Raspbian 9.4. Linux 4.14.34. Radvd 2.15.

I configured everything as described in IoT User Guide. I am using Miredo client for IPv6 connectivity, as I do not have IPv6 from my ISP. It is working okay.

Connecting using 6lowpan_control works fine, a bt0 interface shows up.

bt0: flags=4161<UP,RUNNING,MULTICAST>  mtu 1280
        inet6 fe80::b827:ebff:fe0e:72eb  prefixlen 64  scopeid 0x20<link>
        unspec B8-27-EB-0E-72-EB-10-CD-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 1  bytes 28 (28.0 B)
        RX errors 0  dropped 2  overruns 0  frame 0
        TX packets 16  bytes 1631 (1.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

If I try to run tcpdump on the bt0 interface, right after connecting I get the following:

tcpdump: listening on bt0, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
14:00:25.966605 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 24) fe80::4f:eff:fe05:ba5b > ip6-allrouters: [bad icmp6 cksum 0xd865 -> 0xda65!] ICMP6, router solicitation, length 24
	  source link-address option (1), length 16 (2): 00:4f:0e:ff:fe:05:05:5b:0e:ff:fe:05:ba:5b
	    0x0000:  004f 0eff fe05 055b 0eff fe05 ba5b
14:00:26.471518 IP6 (hlim 1, next-header Options (0) payload length: 76) fe80::b827:ebff:fe0e:72eb > ff02::16: HBH (rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 3 group record(s) [gaddr ff02::1:ff00:0 to_ex { }] [gaddr ff02::1:ff0e:72eb to_ex { }] [gaddr ip6-allrouters to_ex { }]
14:00:26.501387 IP6 (hlim 1, next-header Options (0) payload length: 56) fe80::b827:ebff:fe0e:72eb > ff02::16: HBH (rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 2 group record(s) [gaddr ff02::fb to_ex { }] [gaddr ff02::1:ff00:0 to_ex { }]
14:00:26.652788 IP6 (flowlabel 0x9f6a9, hlim 255, next-header ICMPv6 (58) payload length: 56) fe80::b827:ebff:fe0e:72eb > ip6-allnodes: [icmp6 sum ok] ICMP6, router advertisement, length 56
	hop limit 64, Flags [none], pref medium, router lifetime 1800s, reachable time 0s, retrans time 0s
	  prefix info option (3), length 32 (4): 2001:db8::/64, Flags [auto, router], valid time 86400s, pref. time 14400s
	    0x0000:  4060 0001 5180 0000 3840 0000 0000 2001
	    0x0010:  0db8 0000 0000 0000 0000 0000 0000
	  source link-address option (1), length 8 (1): b8:27:eb:0e:72:eb
	    0x0000:  b827 eb0e 72eb
14:00:26.731808 IP6 (flowlabel 0xad260, hlim 255, next-header UDP (17) payload length: 165) fe80::b827:ebff:fe0e:72eb.mdns > ff02::fb.mdns: [udp sum ok] 0 [2q] [2n] ANY (QM)? b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. ANY (QM)? raspberrypi-2.local. ns: raspberrypi-2.local. AAAA fe80::b827:ebff:fe0e:72eb, b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. PTR raspberrypi-2.local. (157)
14:00:26.781333 IP6 (hlim 1, next-header Options (0) payload length: 96) fe80::b827:ebff:fe0e:72eb > ff02::16: HBH (rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 4 group record(s) [gaddr ff02::fb to_ex { }] [gaddr ff02::1:ff00:0 to_ex { }] [gaddr ff02::1:ff0e:72eb to_ex { }] [gaddr ip6-allrouters to_ex { }]
14:00:26.982164 IP6 (flowlabel 0xad260, hlim 255, next-header UDP (17) payload length: 165) fe80::b827:ebff:fe0e:72eb.mdns > ff02::fb.mdns: [udp sum ok] 0 [2q] [2n] ANY (QM)? b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. ANY (QM)? raspberrypi-2.local. ns: raspberrypi-2.local. AAAA fe80::b827:ebff:fe0e:72eb, b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. PTR raspberrypi-2.local. (157)
14:00:27.232361 IP6 (flowlabel 0xad260, hlim 255, next-header UDP (17) payload length: 165) fe80::b827:ebff:fe0e:72eb.mdns > ff02::fb.mdns: [udp sum ok] 0 [2q] [2n] ANY (QM)? b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. ANY (QM)? raspberrypi-2.local. ns: raspberrypi-2.local. AAAA fe80::b827:ebff:fe0e:72eb, b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. PTR raspberrypi-2.local. (157)
14:00:27.351348 IP6 (hlim 1, next-header Options (0) payload length: 56) fe80::b827:ebff:fe0e:72eb > ff02::16: HBH (rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 2 group record(s) [gaddr ff02::fb to_ex { }] [gaddr ff02::1:ff00:0 to_ex { }]
14:00:27.432632 IP6 (flowlabel 0xad260, hlim 255, next-header UDP (17) payload length: 153) fe80::b827:ebff:fe0e:72eb.mdns > ff02::fb.mdns: [udp sum ok] 0*- [0q] 2/0/0 b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (Cache flush) PTR raspberrypi-2.local., raspberrypi-2.local. (Cache flush) AAAA fe80::b827:ebff:fe0e:72eb (145)
14:00:28.641836 IP6 (flowlabel 0xad260, hlim 255, next-header UDP (17) payload length: 153) fe80::b827:ebff:fe0e:72eb.mdns > ff02::fb.mdns: [udp sum ok] 0*- [0q] 2/0/0 b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (Cache flush) PTR raspberrypi-2.local., raspberrypi-2.local. (Cache flush) AAAA fe80::b827:ebff:fe0e:72eb (145)
14:00:30.852115 IP6 (flowlabel 0xad260, hlim 255, next-header UDP (17) payload length: 153) fe80::b827:ebff:fe0e:72eb.mdns > ff02::fb.mdns: [udp sum ok] 0*- [0q] 2/0/0 b.e.2.7.e.0.e.f.f.f.b.e.7.2.8.b.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (Cache flush) PTR raspberrypi-2.local., raspberrypi-2.local. (Cache flush) AAAA fe80::b827:ebff:fe0e:72eb (145)
14:00:42.669348 IP6 (flowlabel 0x9f6a9, hlim 255, next-header ICMPv6 (58) payload length: 56) fe80::b827:ebff:fe0e:72eb > ip6-allnodes: [icmp6 sum ok] ICMP6, router advertisement, length 56
	hop limit 64, Flags [none], pref medium, router lifetime 1800s, reachable time 0s, retrans time 0s
	  prefix info option (3), length 32 (4): 2001:db8::/64, Flags [auto, router], valid time 86400s, pref. time 14400s
	    0x0000:  4060 0001 5180 0000 3840 0000 0000 2001
	    0x0010:  0db8 0000 0000 0000 0000 0000 0000
	  source link-address option (1), length 8 (1): b8:27:eb:0e:72:eb
	    0x0000:  b827 eb0e 72eb
14:00:58.681657 IP6 (flowlabel 0x9f6a9, hlim 255, next-header ICMPv6 (58) payload length: 56) fe80::b827:ebff:fe0e:72eb > ip6-allnodes: [icmp6 sum ok] ICMP6, router advertisement, length 56
	hop limit 64, Flags [none], pref medium, router lifetime 1800s, reachable time 0s, retrans time 0s
	  prefix info option (3), length 32 (4): 2001:db8::/64, Flags [auto, router], valid time 86400s, pref. time 14400s
	    0x0000:  4060 0001 5180 0000 3840 0000 0000 2001
	    0x0010:  0db8 0000 0000 0000 0000 0000 0000
	  source link-address option (1), length 8 (1): b8:27:eb:0e:72:eb
	    0x0000:  b827 eb0e 72eb

My radvd conf is:

interface bt0
{
    AdvSendAdvert on;
    prefix 2001:db8::/64
    {
        AdvOnLink off;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
};

My broker address is set to a global IPv6 address. If I press button 0 to connect, tcp_connect() fails with ERR_RTE. If I debug things further into ip6_select_source_address(), netif->ip_addr array contains only a single ip address, link local. I assume it should contain a link local and global address, as advertised by radvd?

If I change the broker address to a link local address of the bt0 interface, I get no error and I do seem to be getting packets, here's a tcpdump:

14:22:18.450041 IP6 (hlim 255, next-header TCP (6) payload length: 24) fe80::4f:eff:fe05:ba5b.49153 > fe80::b827:ebff:fe0e:72eb.1883: Flags [S], cksum 0xcfbd (incorrect -> 0xd1bd), seq 6509, win 3584, options [mss 896], length 0
14:22:21.326306 IP6 (hlim 255, next-header TCP (6) payload length: 24) fe80::4f:eff:fe05:ba5b.49153 > fe80::b827:ebff:fe0e:72eb.1883: Flags [S], cksum 0xcfbd (incorrect -> 0xd1bd), seq 6509, win 3584, options [mss 896], length 0
14:22:24.251359 IP6 (hlim 255, next-header TCP (6) payload length: 24) fe80::4f:eff:fe05:ba5b.49153 > fe80::b827:ebff:fe0e:72eb.1883: Flags [S], cksum 0xcfbd (incorrect -> 0xd1bd), seq 6509, win 3584, options [mss 896], length 0
14:22:27.176363 IP6 (hlim 255, next-header TCP (6) payload length: 24) fe80::4f:eff:fe05:ba5b.49153 > fe80::b827:ebff:fe0e:72eb.1883: Flags [S], cksum 0xcfbd (incorrect -> 0xd1bd), seq 6509, win 3584, options [mss 896], length 0

Related