cetic / 6lbr

A deployment-ready 6LoWPAN Border Router solution based on Contiki
github.com/cetic/6lbr/wiki
Other
337 stars 194 forks source link

No address assigned on Beaglebone Black #149

Closed jjmcdn closed 8 years ago

jjmcdn commented 8 years ago

I apologize if this is a FAQ, I'm searching through the mail archives now, too, but so far I haven't found a solution to my problem.

I'm trying to bring up 6lbr on my BeagleBone Black with a TI CC2531EMK. I've flashed the slip radio firmware on it as described here then started working through the howto described here with no success.

So now I've taken a step back and all I want to see first is the interface come up in some expected configuration such that I might be able to ping a remote 6lowPAN device.

My BBB is currently running the 2016-01-24 image of Debian Jessie from BeagleBoard.org (I changed the default /bin/sh->bash from dash because dash would throw errors on <6lbr-functions> when it was sourced) and I've cloned 6lbr and built it directly on the board with the following steps:

cd 6lbr/examples/6lbr
make TARGET=native all plugins tools
suod make install

Then I copied the <6lbr.conf.beaglebone> to </etc/6lbr/6lbr> and changed <DEV_RADIO=/dev/ttyUSB0> to <DEV_RADIO=/dev/ttyACM0> since that's how my 2531 appears on the system. And I bumped up the verbosity of the debug messages hoping it'd help me figure out what was going wrong. So my config file looks like this:

root@beaglebone:~# cat /etc/6lbr/6lbr.conf
#This file contains a default configuration for BeagleBone platform using
#a Telos SLIP Radio
#The full list of parameters and their meaning can be found in 6lbr.conf.example

MODE=ROUTER
#MODE=SMART-BRIDGE
#MODE=RPL-RELAY
#MODE=FULL-TRANSPARENT-BRIDGE
#MODE=NDP-ROUTER
#MODE=6LR
#MODE=RPL-ROOT

RAW_ETH=0
BRIDGE=1
DEV_BRIDGE=br0
DEV_TAP=tap0
DEV_ETH=eth0
RAW_ETH_FCS=1

DEV_RADIO=/dev/ttyACM0
BAUDRATE=115200

#Enable this line if radio device is not detected
#SCAN_DEVICE=/usr/lib/6lbr/bb-scan-usb.sh

LOG_LEVEL=4 #INFO and above only

Then I ensured I had my system configured to accept RA messages as described here and enabled forwarding for both IPv4 and IPv6:

root@beaglebone:~# sysctl net.ipv6.conf.eth0 | grep accept_ra
net.ipv6.conf.eth0.accept_ra = 1
net.ipv6.conf.eth0.accept_ra_defrtr = 1
net.ipv6.conf.eth0.accept_ra_from_local = 0
net.ipv6.conf.eth0.accept_ra_mtu = 1
net.ipv6.conf.eth0.accept_ra_pinfo = 1
net.ipv6.conf.eth0.accept_ra_rt_info_max_plen = 64
net.ipv6.conf.eth0.accept_ra_rtr_pref = 1
sysctl: reading key "net.ipv6.conf.eth0.stable_secret"
root@beaglebone:~# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
root@beaglebone:~# sysctl net.ipv6.conf.all.forwarding
net.ipv6.conf.all.forwarding = 1
root@beaglebone:~#

Then I started 6lbr:

root@beaglebone:~# service 6lbr start
root@beaglebone:~# service 6lbr status
● 6lbr.service - LSB: 6LoWPAN Border Router
   Loaded: loaded (/etc/init.d/6lbr)
   Active: active (running) since Tue 2016-04-05 20:42:27 UTC; 3s ago
  Process: 2859 ExecStart=/etc/init.d/6lbr start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/6lbr.service
           ├─2865 /bin/bash /usr/lib/6lbr/6lbr /etc/6lbr/6lbr.conf
           ├─2870 /usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -s /dev/ttyACM0 -t tap0 -R -B 115200 -U /usr/lib/6lbr/6lbr-ifup -D /usr/lib/6lbr/6lbr-ifdown -w /usr/lib/6lbr/www -L 4 -W /var/log/6lbr.timestamp -P 60 -C /var/log/6lbr.ip -m /usr/lib/6lbr/plug...
           ├─2871 /bin/bash /usr/lib/6lbr/6lbr /etc/6lbr/6lbr.conf
           └─2957 sleep 1

Apr 05 20:42:27 beaglebone 6lbr[2859]: Starting 6LoWPAN Border Router:.

And at no point do my interfaces ever get a aaaa:: or bbbb:: configuration, I never see an ipv6 route and nothing seems to happen.

root@beaglebone:~# route -6 -n
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         U    256 0     0 lo
fe80::/64                      ::                         U    256 0     0 br0
::/0                           ::                         !n   -1  1    35 lo
::1/128                        ::                         Un   0   1   780 lo
fe80::/128                     ::                         Un   0   1     0 lo
fe80::7aa5:4ff:febc:d004/128   ::                         Un   0   1     0 lo
ff00::/8                       ::                         U    256 0     0 eth0
ff00::/8                       ::                         U    256 0     0 tap0
ff00::/8                       ::                         U    256 0     0 br0
::/0                           ::                         !n   -1  1    35 lo
root@beaglebone:~#

Below is the relevant block of my <6lbr.log> from the above run:

********************************************************************************
Tue Apr 5 20:42:27 UTC 2016 : Starting 6LBR
/usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -s /dev/ttyACM0 -t tap0 -R -B 115200 -U /usr/lib/6lbr/6lbr-ifup -D /usr/lib/6lbr/6lbr-ifdown -w /usr/lib/6lbr/www -L 4  -W /var/log/6lbr.timestamp -P 60 -C /var/log/6lbr.ip  -m /usr/lib/6lbr/plugins
Contiki-6lbr-1.3.3 started with IPV6, RPL
Rime started with address 1.2.3.4.5.6.7.8
MAC CSMA RDC br-rdc NETWORK sicslowpan
Log level : 40
Log services : ffffffff
2016-03-05 20:42:27.706670: INFO: ETH: 6LBR watchdog started (interval: 60)
2016-03-05 20:42:27.707645: INFO: 6LBR: Starting 6LBR version 1.3.3 (Contiki-6lbr-1.3.3)
2016-03-05 20:42:27.707665: INFO: NVM: Opening nvm file '/etc/6lbr/nvm.dat'
2016-03-05 20:42:27.707751: INFO: NVM: NVM Magic : 2009
2016-03-05 20:42:27.707763: INFO: NVM: NVM Version : 1
2016-03-05 20:42:27.707773: INFO: SCMD: Started br-cmd process
2016-03-05 20:42:27.707782: INFO: NODECFG: No node_config.conf file specified
2016-03-05 20:42:27.707793: INFO: ETH: RAW/TAP init
2016-03-05 20:42:27.733203: INFO: SLIP: SLIP started on /dev/ttyACM0
2016-03-05 20:42:27.750491: INFO: TAP: opened device /dev/tap0
2016-03-05 20:42:27.750743: INFO: TAP: Running 6lbr-ifup script '/usr/lib/6lbr/6lbr-ifup'
6lbr-ifup: Create bridge br0
6lbr-ifup: attach device eth0
br0       Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          inet6 addr: fe80::7aa5:4ff:febc:d004/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:247 (247.0 B)  TX bytes:220 (220.0 B)

tap0      Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          UP BROADCAST RUNNING 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:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

2016-03-05 20:42:28.504603: INFO: BR-RDC: Reset SLIP Radio
2016-03-05 20:42:28.504840: INFO: BR-RDC: Fetching MAC address
2016-03-05 20:42:28.505370: WARN: PF: No input function set
2016-03-05 20:42:28.505850: WARN: PF: No input function set
2016-03-05 20:42:28.506002: WARN: PF: No input function set
2016-03-05 20:42:28.537860: INFO: SLIP: cc2531: Reboot requested
2016-03-05 20:42:28.539313: INFO: SLIP: cc2531: Reverting to h/w MAC but not rebooting
2016-03-05 20:42:28.568534: DEBUG: SCMD: Setting MAC address
2016-03-05 20:42:28.568729: INFO: BR-RDC: Got MAC: 00:12:4b:00:07:68:d2:37
2016-03-05 20:42:28.678970: WARN: PF: No input function set
2016-03-05 20:42:28.709350: WARN: PF: No input function set
2016-03-05 20:42:29.504175: INFO: ETH: Eth MAC address : 02:00:07:68:d2:37
2016-03-05 20:42:29.505077: INFO: 6LBR: Tentative local IPv6 address fe80::212:4b00:768:d237
2016-03-05 20:42:29.505640: INFO: 6LBR: Tentative global IPv6 address (WSN) aaaa::212:4b00:768:d237
2016-03-05 20:42:29.506002: INFO: 6LBR: Tentative global IPv6 address (ETH) bbbb::100
2016-03-05 20:42:29.506320: DEBUG: RIO: Adding route information: length=64, flags=0, route lifetime=1800, dest=aaaa::
2016-03-05 20:42:29.506590: INFO: 6LBR: RA Daemon enabled
2016-03-05 20:42:29.506711: INFO: NVM: Opening nvm file '/etc/6lbr/nvm.dat'
2016-03-05 20:42:29.507940: INFO: 6LBR: Configured as DODAG Root
2016-03-05 20:42:29.508125: INFO: 6LBR: Starting as RPL ROUTER
2016-03-05 20:42:29.510542: INFO: UDPS: UDP server started
2016-03-05 20:42:29.510993: INFO: 6LBR: CETIC 6LBR Started
2016-03-05 20:42:29.511229: INFO: SLIP: cc2531: Setting RF channel 0x1a
2016-03-05 20:42:30.140452: DEBUG: SCMD: Packet data report for sid:1 st:0 tx:1
2016-03-05 20:42:30.440023: DEBUG: SCMD: Packet data report for sid:2 st:0 tx:1
2016-03-05 20:42:30.640520: DEBUG: SCMD: Packet data report for sid:3 st:0 tx:1
2016-03-05 20:42:40.945889: DEBUG: SCMD: Packet data report for sid:4 st:0 tx:1
2016-03-05 20:42:47.335851: DEBUG: SCMD: Packet data report for sid:5 st:0 tx:1
2016-03-05 20:43:06.337819: DEBUG: SCMD: Packet data report for sid:6 st:0 tx:1
2016-03-05 20:43:30.23898: DEBUG: SCMD: Packet data report for sid:7 st:0 tx:1
2016-03-05 20:44:17.974110: DEBUG: SCMD: Packet data report for sid:8 st:0 tx:1

So the tentative addresses look sane, but it never goes any further than that.

Since I've done a fair bit of digging around to try to debug this myself, I thought I should also include some more detail in case I've broken something else while I was looking around for a solution.

root@beaglebone:~# cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
root@beaglebone:~# /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat
Reading nvm file '/etc/6lbr/nvm.dat'
Channel : 26

WSN network prefix : aaaa::
WSN network prefix length : 64
WSN IP address : aaaa::100
WSN accept RA : True
WSN IP address autoconf : True

Eth network prefix : bbbb::
Eth network prefix length : 64
Eth IP address : bbbb::100
Eth default router : ::
Eth IP address autoconf : False

Local address rewrite : True
Smart Multi BR : False

RA daemon : True
RA router lifetime : 0
RA maximum interval : 600
RA minimum interval : 200
RA minimum delay : 3
RA PIO enabled : True
RA prefix valid lifetime : 86400
RA prefix preferred lifetime : 14400
RA RIO enabled : True
RA RIO lifetime : 1800

RPL instance ID : 30
RPL Preference : 0
RPL version ID :  : 254
RPL DIO interval doubling : 8
RPL DIO minimum interval : 12
RPL DIO redundancy : 10
RPL default lifetime : 30
RPL minimum rank increment : 256
RPL lifetime unit : 256

Webserver configuration page disabled : False
root@beaglebone:~# tail /var/log/6lbr.ip
bbbb::100
root@beaglebone:~# tail /var/log/6lbr.err
********************************************************************************
Tue Apr 5 20:42:27 UTC 2016 : Starting 6LBR
root@beaglebone:~# ifconfig
br0       Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          inet6 addr: fe80::7aa5:4ff:febc:d004/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:515 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:60811 (59.3 KiB)  TX bytes:5463 (5.3 KiB)

eth0      Link encap:Ethernet  HWaddr 78:a5:04:bc:d0:04
          UP BROADCAST RUNNING MULTICAST DYNAMIC  MTU:1500  Metric:1
          RX packets:3796 errors:0 dropped:3 overruns:0 frame:0
          TX packets:412 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:496135 (484.5 KiB)  TX bytes:82504 (80.5 KiB)
          Interrupt:177

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:2664 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2664 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:208351 (203.4 KiB)  TX bytes:208351 (203.4 KiB)

tap0      Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:531 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:614 (614.0 B)  TX bytes:73050 (71.3 KiB)

Any idea what I'm missing or doing wrong here?

laurentderu commented 8 years ago

At first sight everything looks good, except that you have enabled accept_ra and accept_ra_rt_info_max_plen on eth0 and not br0 As eth0 is part of a bridge, it's IP stack is disabled. You have to use br0 instead.

sysctl -w net.ipv6.conf.br0.accept_ra=1
sysctl -w net.ipv6.conf.br0.accept_ra_rt_info_max_plen=64

If that does not solve your problem, maybe you have a network manager, like wicd or NetworkManager that override your configuration.

jjmcdn commented 8 years ago

If that does not solve your problem, maybe you have a network manager, like wicd or NetworkManager that override your configuration.

That's a very good point, I realized after I read your comment that the Debian image runs connman by default and thought it might be getting in the way. First I went back and disabled it with service connman disable and that didn't seem to help, so I swapped out my whole image in favour of the Debian console image from http://elinux.org/Beagleboard:BeagleBoneBlack_Debian. I corrected the /bin/sh link again then grabbed the 1.3.3 6lbr release from https://github.com/cetic/6lbr/wiki/Releases and installed the .deb rather than going through the build process again. The console image is very limited. I had to install bridge-utils but after that 6lbr seemed happy enough to start.

I'm still not seeing any routes set up and the configuration applied.

Just to re-cap what I've done since re-imaging my SD card:

root@beaglebone:~# cat /etc/6lbr/6lbr.conf
#This file contains a default configuration for BeagleBone platform using
#a Telos SLIP Radio
#The full list of parameters and their meaning can be found in 6lbr.conf.example

MODE=ROUTER
#MODE=SMART-BRIDGE
#MODE=RPL-RELAY
#MODE=FULL-TRANSPARENT-BRIDGE
#MODE=NDP-ROUTER
#MODE=6LR
#MODE=RPL-ROOT

RAW_ETH=0
BRIDGE=1
DEV_BRIDGE=br0
DEV_TAP=tap0
DEV_ETH=eth0
RAW_ETH_FCS=1

DEV_RADIO=/dev/ttyACM0
BAUDRATE=115200

#Enable this line if radio device is not detected
#SCAN_DEVICE=/usr/lib/6lbr/bb-scan-usb.sh

LOG_LEVEL=4 #INFO and above only

Which is the 6lbr.conf.beaglebone file tweaked with a higher log-level and DEV_RADIO pointing at ttyACM0 rather than ttyUSB0 since that's where my device appears.

root@beaglebone:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

iface eth0 inet static
address 0.0.0.0

auto br0
iface br0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    up echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
    post-up ip link set br0 address `ip link show eth0 | grep ether | awk '{print $2}'`

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
#    wpa-ssid "essid"
#    wpa-psk  "password"

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1

Which I took wholesale from /etc/6lbr/interfaces.beaglebone.example because it looked like a reasonable drop-in replacement for the /etc/network/interfaces on my image.

Then I set this:

root@beaglebone:~# tail -15 /etc/sysctl.conf 
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
net.ipv6.conf.all.accept_ra = 1
net.ipv6.conf.all.accept_ra_defrtr = 1
net.ipv6.conf.all.accept_ra_from_local = 0
net.ipv6.conf.all.accept_ra_mtu = 1
net.ipv6.conf.all.accept_ra_pinfo = 1
net.ipv6.conf.all.accept_ra_rt_info_max_plen = 64
net.ipv6.conf.all.accept_ra_rtr_pref = 1
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1

Because I'm a big fan of using syslog.conf. Unfortunately that still doesn't work for net.ipv6.conf.br0.accept_ra and ...accept_ra_rt_info_max_plen as I'd hoped, so I added this to 50bridge:

root@beaglebone:~# grep jjm -n -C3 /etc/6lbr/ifup.d/50bridge 
37-             fi
38-             ip addr flush dev $DEV
39-             brctl addif $DEV_BRIDGE $DEV
40:             # jjm
41-             sysctl -w net.ipv6.conf.br0.accept_ra=1
42-             sysctl -w net.ipv6.conf.br0.accept_ra_rt_info_max_plen=64
43:             # /jjm
44-             ;;
45-
46-     Darwin)

Which now seems to ensure that when the bridge comes up the sysctl settings are as expected. But even so I'm still not getting any routes created and my interfaces are not getting assigned addresses as I thought I should see:

root@beaglebone:~# route -6 -n
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         U    256 0     0 lo
fe80::/64                      ::                         U    256 0     0 usb0
fe80::/64                      ::                         U    256 0     0 br0
::/0                           ::                         !n   -1  1    33 lo
::1/128                        ::                         Un   0   1     1 lo
fe80::/128                     ::                         Un   0   1     0 lo
fe80::/128                     ::                         Un   0   1     0 lo
fe80::7aa5:4ff:febc:d000/128   ::                         Un   0   1     0 lo
fe80::7aa5:4ff:febc:d004/128   ::                         Un   0   1     0 lo
ff00::/8                       ::                         U    256 0     0 usb0
ff00::/8                       ::                         U    256 0     0 tap0
ff00::/8                       ::                         U    256 1     0 br0
::/0                           ::                         !n   -1  1    33 lo
root@beaglebone:~# ifconfig
br0       Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e  
          inet6 addr: fe80::7aa5:4ff:febc:d004/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1188 errors:0 dropped:108 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:117002 (114.2 KiB)  TX bytes:738 (738.0 B)

eth0      Link encap:Ethernet  HWaddr 78:a5:04:bc:d0:04  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3307 errors:0 dropped:25 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:370456 (361.7 KiB)  TX bytes:3234 (3.1 KiB)
          Interrupt:175 

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:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tap0      Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:614 (614.0 B)  TX bytes:133958 (130.8 KiB)

usb0      Link encap:Ethernet  HWaddr 78:a5:04:bc:d0:00  
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::7aa5:4ff:febc:d000/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8909 (8.7 KiB)  TX bytes:1422 (1.3 KiB)

root@beaglebone:~# cat /var/log/6lbr.err 
********************************************************************************
Wed Apr 6 17:33:30 UTC 2016 : Starting 6LBR
root@beaglebone:~# cat /var/log/6lbr.log 
********************************************************************************
Wed Apr 6 17:33:30 UTC 2016 : Starting 6LBR
/usr/lib/6lbr/bin/cetic_6lbr_router -c /etc/6lbr/nvm.dat -s /dev/ttyACM0 -t tap0 -R -B 115200 -U /usr/lib/6lbr/6lbr-ifup -D /usr/lib/6lbr/6lbr-ifdown -w /usr/lib/6lbr/www -L 4  -W /var/log/6lbr.timestamp -P 60 -C /var/log/6lbr.ip  -m /usr/lib/6lbr/plugins
Contiki-6lbr-1.3.3 started with IPV6, RPL
Rime started with address 1.2.3.4.5.6.7.8
MAC CSMA RDC br-rdc NETWORK sicslowpan
Log level : 40
Log services : ffffffff
2016-03-06 17:33:30.381988: INFO: ETH: 6LBR watchdog started (interval: 60)
2016-03-06 17:33:30.382789: INFO: 6LBR: Starting 6LBR version 1.3.3 (Contiki-6lbr-1.3.3)
2016-03-06 17:33:30.382806: INFO: NVM: Opening nvm file '/etc/6lbr/nvm.dat'
2016-03-06 17:33:30.382870: INFO: NVM: NVM Magic : 2009
2016-03-06 17:33:30.382882: INFO: NVM: NVM Version : 1
2016-03-06 17:33:30.382892: INFO: SCMD: Started br-cmd process
2016-03-06 17:33:30.382902: INFO: NODECFG: No node_config.conf file specified
2016-03-06 17:33:30.382911: INFO: ETH: RAW/TAP init
2016-03-06 17:33:30.387701: INFO: SLIP: SLIP started on /dev/ttyACM0
2016-03-06 17:33:30.401854: INFO: TAP: opened device /dev/tap0
2016-03-06 17:33:30.402062: INFO: TAP: Running 6lbr-ifup script '/usr/lib/6lbr/6lbr-ifup'
6lbr-ifup: Create bridge br0
6lbr-ifup: attach device eth0
net.ipv6.conf.br0.accept_ra = 1
net.ipv6.conf.br0.accept_ra_rt_info_max_plen = 64
br0       Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          inet6 addr: fe80::7aa5:4ff:febc:d004/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:110 (110.0 B)

tap0      Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          UP BROADCAST RUNNING 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:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

2016-03-06 17:33:30.818679: INFO: BR-RDC: Reset SLIP Radio
2016-03-06 17:33:30.818857: INFO: BR-RDC: Fetching MAC address
2016-03-06 17:33:30.819253: WARN: PF: No input function set
2016-03-06 17:33:30.819595: WARN: PF: No input function set
2016-03-06 17:33:30.851830: INFO: SLIP: cc2531: Reboot requested
2016-03-06 17:33:30.853189: INFO: SLIP: cc2531: Reverting to h/w MAC but not rebooting
2016-03-06 17:33:30.882490: DEBUG: SCMD: Setting MAC address
2016-03-06 17:33:30.882610: INFO: BR-RDC: Got MAC: 00:12:4b:00:07:68:d2:37
2016-03-06 17:33:30.926510: WARN: PF: No input function set
2016-03-06 17:33:31.226668: WARN: PF: No input function set
2016-03-06 17:33:31.226829: WARN: PF: No input function set
2016-03-06 17:33:31.818161: INFO: ETH: Eth MAC address : 02:00:07:68:d2:37
2016-03-06 17:33:31.818761: INFO: 6LBR: Tentative local IPv6 address fe80::212:4b00:768:d237
2016-03-06 17:33:31.818987: INFO: 6LBR: Tentative global IPv6 address (WSN) aaaa::212:4b00:768:d237
2016-03-06 17:33:31.819174: INFO: 6LBR: Tentative global IPv6 address (ETH) bbbb::100
2016-03-06 17:33:31.819375: DEBUG: RIO: Adding route information: length=64, flags=0, route lifetime=1800, dest=aaaa::
2016-03-06 17:33:31.819478: INFO: 6LBR: RA Daemon enabled
2016-03-06 17:33:31.819542: INFO: NVM: Opening nvm file '/etc/6lbr/nvm.dat'
2016-03-06 17:33:31.820405: INFO: 6LBR: Configured as DODAG Root
2016-03-06 17:33:31.820526: INFO: 6LBR: Starting as RPL ROUTER
2016-03-06 17:33:31.821560: INFO: UDPS: UDP server started
2016-03-06 17:33:31.821859: INFO: 6LBR: CETIC 6LBR Started
2016-03-06 17:33:31.822012: INFO: SLIP: cc2531: Setting RF channel 0x1a
2016-03-06 17:33:32.453878: DEBUG: SCMD: Packet data report for sid:1 st:0 tx:1
2016-03-06 17:33:32.753136: DEBUG: SCMD: Packet data report for sid:2 st:0 tx:1
2016-03-06 17:33:32.953967: DEBUG: SCMD: Packet data report for sid:3 st:0 tx:1
2016-03-06 17:33:43.254179: DEBUG: SCMD: Packet data report for sid:4 st:0 tx:1
2016-03-06 17:33:49.648323: DEBUG: SCMD: Packet data report for sid:5 st:0 tx:1
2016-03-06 17:34:08.650459: DEBUG: SCMD: Packet data report for sid:6 st:0 tx:1
2016-03-06 17:34:32.339387: DEBUG: SCMD: Packet data report for sid:7 st:0 tx:1
2016-03-06 17:35:20.287919: DEBUG: SCMD: Packet data report for sid:8 st:0 tx:1
2016-03-06 17:37:02.463602: DEBUG: SCMD: Packet data report for sid:9 st:0 tx:1
2016-03-06 17:41:04.310469: DEBUG: SCMD: Packet data report for sid:10 st:0 tx:1
root@beaglebone:~# cat /var/log/6lbr.ip 
bbbb::100
root@beaglebone:~# /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat
Reading nvm file '/etc/6lbr/nvm.dat'
Channel : 26

WSN network prefix : aaaa::
WSN network prefix length : 64
WSN IP address : aaaa::100
WSN accept RA : True
WSN IP address autoconf : True

Eth network prefix : bbbb::
Eth network prefix length : 64
Eth IP address : bbbb::100
Eth default router : ::
Eth IP address autoconf : False

Local address rewrite : True
Smart Multi BR : False

RA daemon : True
RA router lifetime : 0
RA maximum interval : 600
RA minimum interval : 200
RA minimum delay : 3
RA PIO enabled : True
RA prefix valid lifetime : 86400
RA prefix preferred lifetime : 14400
RA RIO enabled : True
RA RIO lifetime : 1800

RPL instance ID : 30
RPL Preference : 0
RPL version ID :  : 246
RPL DIO interval doubling : 8
RPL DIO minimum interval : 12
RPL DIO redundancy : 10
RPL default lifetime : 30
RPL minimum rank increment : 256
RPL lifetime unit : 256

Webserver configuration page disabled : False

Obviously I've cycled my logs on my system while debugging so we're only looking at the latest run of logs above. Is there something else I could provide or look at that might help me understand what's going on here?

Right now I'm having my BBB build master from git to see if that helps, but that's kind of a lengthy process, as you probably know. :-)

Somewhat related, in the future if I'm providing longer blocks of information like this, would it be better for me to put it all in a gist and link to it from the comments or dump the info right in the comments? Different projects / maintainers / devs have different preferences and I want to stick to whatever is easiest.

laurentderu commented 8 years ago

Thanks to you extensive blocks of information ;) I think I know the root cause of your problem :

net.ipv6.conf.all.forwarding = 1

This setup configure your system as an IP Router, and, by definition a router never listen to RA messages. So, the RA sent by 6LBR is ignored by the beaglebone. You can either reverse it to 0 or use a magic mode provided by the linux kernel :

net.ipv6.conf.br0.accept_ra=2

With this value, the system will behave as a router, but your interface will still listen to RA and use them for the address autoconfiguration

jjmcdn commented 8 years ago

Awesome, that was it. I set net.ipv6.conf.br0.accept_ra=2 and now:

root@beaglebone:~# ifconfig
br0       Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          inet6 addr: bbbb::a:bff:fe0c:d0e/64 Scope:Global
          inet6 addr: fe80::a:bff:fe0c:d0e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:616 (616.0 B)  TX bytes:1026 (1.0 KiB)

eth0      Link encap:Ethernet  HWaddr 78:a5:04:bc:d0:04
          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)
          Interrupt:175

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:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tap0      Link encap:Ethernet  HWaddr 02:0a:0b:0c:0d:0e
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:714 (714.0 B)  TX bytes:1336 (1.3 KiB)

usb0      Link encap:Ethernet  HWaddr 78:a5:04:bc:d0:00
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          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)

root@beaglebone:~# route -6 -n
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         U    256 0     0 lo
aaaa::/64                      fe80::7ff:ff68:d0f5        UGAe 1024 0     0 br0
bbbb::/64                      ::                         UAe  256 0     0 br0
fe80::/64                      ::                         U    256 0     0 br0
::/0                           ::                         !n   -1  1     1 lo
::1/128                        ::                         Un   0   1     1 lo
bbbb::/128                     ::                         Un   0   1     0 lo
bbbb::a:bff:fe0c:d0e/128       ::                         Un   0   1     0 lo
fe80::/128                     ::                         Un   0   1     0 lo
fe80::a:bff:fe0c:d0e/128       ::                         Un   0   1     0 lo
ff00::/8                       ::                         U    256 0     0 tap0
ff00::/8                       ::                         U    256 3     0 br0
::/0                           ::                         !n   -1  1     1 lo

Thanks so much!

RaghavendraSurpur commented 6 years ago

Hi All,

We are working on BBB using 04.00.00.04 TI SDK (arago on linux) , After using this command "make TARGET=native all plugins tools" we are getting these errors :+1: make TARGET=native all plugins tools
rm -rf bin mkdir -p bin make TARGET=native clean make[1]: Entering directory '/etc/6lbr/examples/6lbr' rm -f ~ core core .srec \ .lst .map \ .cprg .bin .data contiki.a .firmware core-labels.S .ihex .ini \ .ce .co rm -rf .so obj_native/.so rm -rf obj_native make[1]: Leaving directory '/etc/6lbr/examples/6lbr' make TARGET=native bin/cetic_6lbr_smart_bridge make[1]: Entering directory '/etc/6lbr/examples/6lbr' make TARGET=native CETIC_6LBR_SMARTBRIDGE=1 WITH_UDPCLIENT=0 make[2]: Entering directory '/etc/6lbr/examples/6lbr' make[2]: Nothing to be done for 'cetic-6lbr'. make[2]: Leaving directory '/etc/6lbr/examples/6lbr' mkdir -p bin mv cetic-6lbr.native bin/cetic_6lbr_smart_bridge mv: can't rename 'cetic-6lbr.native': No such file or directory make[1]: [platform/native/Makefile.native:40: bin/cetic_6lbr_smart_bridge] E1 make[1]: Leaving directory '/etc/6lbr/examples/6lbr' make: [platform/native/Makefile.native:76: all] Error 2

So please give any solutions for this,

Thanks, Raghavendra