1

I want to route data between BT/6lowpan interface and wifi interface on a Raspberry Pi platform. Done all the setup as described below. But the Ping6 from Bluetooth (bt0) to Wifi (wlan0) not working.

ping6 from bt0 in RPI to a BT node working. Ping6 from wifi to internet working. Any suggestion where is the mistake?

Platform:

Raspberry Pi 3 Model B+ and Raspbian Stretch

My Setup is exactly like this:

Bluetooth Node <-- BT --> Raspberry Pi <-- Wifi --> 4G Wireless Router --> Internet

RPI Wifi gets 2405:204:1290:3eb1:ab2c:9c70:7c27:xxxx/64 address from 4G Wireless Router.

My etc/radvd.conf

interface bt0
{
    AdvSendAdvert on;
    AdvSourceLLAddress on;
    prefix 2002::/64
    {
        AdvOnLink off;
        AdvAutonomous on;
        AdvRouterAddr on;
    }; # End of prefix definition
};

I added a static IPv6 address to bt0:

Ip address add 2002::1/64 dev bt0

My “ip -6 addr show” gives:

ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2405:204:1290:3eb1:ab2c:9c70:7c27:xxxx/64 scope global mngtmpaddr noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::9ed1:3e80:de2a:e601/64 scope link 
       valid_lft forever preferred_lft forever

4: bt0: <MULTICAST,UP,LOWER_UP> mtu 1280 state UNKNOWN qlen 1000
    inet6 2002::1/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::b827:ebff:fe3d:4f70/64 scope link 
       valid_lft forever preferred_lft forever

Other commands I have run:

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
ip route add 2002::/64 dev bt0
ip6tables -A FORWARD -i bt0 -o wlan0 -j ACCEPT
ip6tables -A FORWARD -i wlan0 -o bt0 -j ACCEPT
ip6tables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
service radvd restart

My “ip -6 route show” gives:

ip -6 route show
2002::/64 dev bt0 proto kernel metric 256  pref medium
2002::/64 dev bt0 metric 1024  pref medium
2405:204:1290:3eb1::/64 dev wlan0 proto kernel metric 303  mtu 1500 pref medium
fe80::/64 dev wlan0 proto kernel metric 256  pref medium
fe80::/64 dev bt0 proto kernel metric 256  pref medium
default via fe80::8bf:4ace:e70a:xxxx dev wlan0 metric 303  mtu 1500 pref medium

My ping6 from bt0 to wlan0 global address returns:

ping6 -I bt0 2405:204:1290:3eb1:ab2c:9c70:7c27:xxxx
connect: Network is unreachable

My ping6 from bt0 to wlan0 Link Local address returns:

ping6 -I bt0 fe80::9ed1:3e80:de2a:e601
PING fe80::9ed1:3e80:de2a:e601(fe80::9ed1:3e80:de2a:e601) from fe80::b827:ebff:fe3d:4f70%bt0 bt0: 56 data bytes
--- fe80::9ed1:3e80:de2a:e601 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1071ms

Where is the mistake and what extra I need to setup to get the ping6 working?

Gone through all the below links for guidelines:

https://devzone.nordicsemi.com/f/nordic-q-a/5481/making-ipv6-device-available-on-the-internet

Raspberry Pi WiFi to Ethernet Bridge for a server?

Access point as WiFi router/repeater, optional with bridge

Workaround for a wifi bridge on a Raspberry Pi with proxy arp

https://visualgdb.com/tutorials/arm/nrf51/6lowpan/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.